Indicator · Pine Script v4 · Own pane

HWAP

by nvFede· code credited to Tykhe_Ideas

A Pine v4 indicator in a separate pane that measures how far the close sits from a 50-bar Hull moving average, scaled by the rolling standard deviation of that distance, which makes it a z-score style oscillator.

View on GitHub

GitHub stars1on the repository
Pine versionv4older, still runs
Lines of code45
Settings7inputs
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

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

hWap.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("HWAP", shorttitle="HWAP")
length = input(20)
smoothness = input(1)

src = input(close)


//--------------------------- Hull Moving average -----------------------------------
hull(x, longitud) =>
    hullma = wma(2*wma(x, longitud/2)-wma(x, longitud), round(sqrt(longitud)))
    

calc_zvwap(pds) =>
    //mean = sum(volume * close, pds) / sum(volume, pds)
    mean = hull(src, 50)
    vwapsd = sqrt(sma(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=color.gray)
plot(-1, style=3, color=color.gray)
ul1 = plot(upperTop, "OB High")
ul2 = plot(upperBottom, "OB Low")
fill(ul1, ul2, color=color.red)
ll1 = plot(lowerTop, "OS High")
ll2 = plot(lowerBottom, "OS Low")
fill(ll1, ll2, color=color.green)

wvap_smoothness = ema(calc_zvwap(length), smoothness)

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

// Correlation HWAP y activo

c = correlation(wvap_smoothness, close, 21) * 2.5
plot(c)

Overview

Dotted lines mark plus and minus one, and zones near plus and minus two to two and a half are used as overbought and oversold areas. 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, Moving averages

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
srcsourceclosesrc
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

114 stars

Calculates normalized reversal metrics across up to ten Forex currency pairs using user-selected moving average methods, including HarmonicMA, EMA, SMA, or WMA. The indicator identifies overbought, oversold, and mean-crossing conditions using a configurable th

Indicator v4 Screeners & dashboardsMean reversion
Updated 1 year ago · None stated GitHub repository of Multi-Pair Trend Reversal Widget
47 stars

This indicator applies the hyperbolic tangent to a chosen source series and plots the result in a separate pane. It centers the transform on a 200-bar simple moving average of that source, multiplies the deviation by a steepness factor, and maps the output int

Indicator v6 Moving averagesMean reversion
Updated 8 months ago · MIT GitHub repository of Hyperbolic Tangent (TANH)

This indicator builds a channel from a Hull moving average of the source and an ATR scaled by a band multiplier, then normalizes price inside that channel into a 0 to 100 oscillator. It smooths the result with a weighted moving average and plots the line in a

Indicator v6 Mean reversionVolatility & bands
Updated 3 months ago · None stated GitHub repository of Radiant Mean Reversion Channels [Pineify]

RSI

by trsdn
6 stars

This indicator calculates the Relative Strength Index along with a 200-period simple moving average. It plots the RSI oscillator line alongside horizontal reference levels for overbought and oversold thresholds in a separate pane below the main price chart. Co

Indicator v5 Oscillators & momentumMoving averages
Updated 6 days ago · MIT GitHub repository of RSI

MACD x RSI Study

by jerryinyang
5 stars

This indicator combines MACD and RSI to generate pullback signals on forex pairs. It plots MACD line, signal line and histogram alongside RSI and Wave Trend oscillator. Higher-timeframe MACD provides trend bias while RSI identifies overbought and oversold zone

Indicator v4 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of MACD x RSI Study
3 stars

This indicator estimates how many bars typically pass before a custom skew measure falls back below its exponential moving average. It builds the skew from smoothed upside and downside true-range deviations, then applies five fixed EMA lengths from 2 to 110. O

Indicator v5 Mean reversionMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Average Bars Before Reversion

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