Indicator · Pine Script v4 · Own pane

Kama-WAP

by nvFede· code credited to Tykhe_Ideas

A Pine v4 indicator in a separate pane that is a variant of a volume-weighted z-score oscillator.

View on GitHub

GitHub stars1on the repository
Pine versionv4older, still runs
Lines of code44
Settings6inputs
LicenceNone statedfile: MPL-2.0
Last update3 years ago19 Mar 2023

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

44 lines of Pine Script v4 from TradingView_old/test.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

test.pine
//@version=4
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Tykhe_Ideas

study("Kama-WAP", shorttitle="KWAP")
length = input(20)
smoothness = input(1)

make_kame(x, y) =>
    xvnoise = abs(x - x[1])
    nfastend = 0.666
    nslowend = 0.0645
    nsignal = abs(x - x[y])
    nnoise = sum(xvnoise, y)
    nefratio = iff(nnoise != 0, nsignal / nnoise, 0)
    nsmooth = pow(nefratio * (nfastend - nslowend) + nslowend, 2) 
    KAMA = nz(KAMA[1]) + nsmooth * (x - nz(KAMA[1]))

calc_zvwap(pds) =>
    mean = sum(volume * close, pds) / sum(volume, pds)
    vwapsd = sqrt(make_kame(pow(close - mean, 2), pds))
    (close - mean) / vwapsd

plot(0)
upperTop = input(2.5)
upperBottom = input(2.0)
lowerTop = input(-2.5)
lowerBottom = input(-2.0)

plot(1, style=3, color=gray)
plot(-1, style=3, color=gray)
ul1 = plot(upperTop, "OB High")
ul2 = plot(upperBottom, "OB Low")
fill(ul1, ul2, color=red)
ll1 = plot(lowerTop, "OS High")
ll2 = plot(lowerBottom, "OS Low")
fill(ll1, ll2, color=green)


//ma = make_kame(src, length)

wvap_smoothness = ema(calc_zvwap(length), smoothness)

plot(wvap_smoothness, title="ZVWAP", color=black, linewidth=2)

Overview

Kama-WAP measures the close against a rolling volume-weighted mean and divides by a volatility term smoothed with an adaptive Kaufman-style average instead of a simple one. Dotted lines at plus and minus one and shaded bands near plus and minus two to two and a half mark extremes. Length, smoothness and band levels are inputs.

Details

Published by

nvFede on GitHub

Code credit

Tykhe_Ideas, as written in the script's header

Type

Indicator, Pine Script v4

Draws

Separate pane below the chart

Category

Mean reversion, Volume

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
lengthint20length
smoothnessint1smoothness
upperTopfloat2.5upperTop
upperBottomfloat2.0upperBottom
lowerTopfloat-2.5lowerTop
lowerBottomfloat-2.0lowerBottom
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Medallion Cipher

by ricksimpsontrading
3 stars

Medallion Cipher is a separate-pane indicator that combines a four-state hidden Markov model (bull, bear, range, and crisis) with weighted confluence signals. It can include mean reversion, trend, session timing, pattern matching, Hurst exponent, Shannon entro

Indicator v6 AI / machine learningMean reversion
Updated 9 days ago · None stated GitHub repository of Medallion Cipher

Average Price VWAP

by ivansoft
1 stars

An indicator in a separate pane that works on the average of open and close and an anchored volume weighted average price. The VWAP and optional standard deviation bands are drawn on the price chart, with a settable multiplier and anchor period, daily by defau

Indicator v6 VolumeMean reversion
Updated 1 year ago · None stated GitHub repository of Average Price VWAP

FracDiff Z NQ 5m Filter Lab

by qmqvt44stq-del
1 stars

A fractional differencing Z-score oscillator in a separate pane, set up for testing optional entry filters on five-minute Nasdaq futures charts. Signal modes include the base snapback, a volume-exhaustion mode, a conservative mode and an early mode. Filters co

Indicator v6 Mean reversionOscillators & momentum
Updated 4 months ago · None stated GitHub repository of FracDiff Z NQ 5m Filter Lab
9 stars

This indicator plots an anchored MIDAS support and resistance curve from launch-anchored volume-weighted price on the price chart. It adds two configurable volume-weighted standard-deviation, ATR, or hybrid bands and a topfinder or bottomfinder accelerated exh

Indicator v6 Mean reversionSupport & resistance Repaints
Updated 2 days ago · MIT GitHub repository of MIDAS 2.0 [WavesUnchained]

VWAP Trader NXi

by eddiebelaval
7 stars

VWAP Trader NXi calculates a daily session-anchored Volume Weighted Average Price along with two custom standard deviation bands on the main price chart. It plots the core VWAP, Value Area bands, outer extension zones with background shading, and the previous

Indicator v5 VolumeVolatility & bands
Updated 3 months ago · None stated GitHub repository of VWAP Trader NXi
5 stars

This indicator identifies long mean-reversion trade opportunities when price stretches significantly below the Volume Weighted Average Price (VWAP). It triggers a signal during regular trading hours when price moves a defined minimum number of ticks below VWAP

Indicator v5 Mean reversionVolume
Updated 5 months ago · Custom licence GitHub repository of Path B — VWAP Reversion (Demo)

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers