Indicator · Pine Script v5 · On the chart

Fair value bands

by regalouisei· code credited to quantifytools

This overlay indicator plots a fair value basis on the price chart and surrounds it with threshold and deviation bands.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code478
Settings35inputs
LicenceNone stated
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  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

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

The basis can be an SMA, EMA, HMA, RMA, WMA, VWMA, median, or a VWAP anchored to a chosen timeframe, using a selectable price source and length. Trend coloring follows either cross or direction mode, and up to four source-versus-band crosses can be marked above or below selected offsets. Band width multipliers and colors control the display. An optional highlight shows metric calculations and time or volume counters in the Data Window. It does not place trades or set stops.

Details

Published by

regalouisei on GitHub

Code credit

quantifytools, as written in the script's header

Draws

On the price chart

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
Highlight metric calculationsboolfalsei_btCheck
Threshold band widthfloat1i_boost
Deviation band widthfloat1i_bandBoost
VWAP anchortimeframe1Di_anchorTf
i_sourceStringstringOHLC4i_sourceString
i_smoothingTypestringSMAi_smoothingType
i_lengthint20i_length
i_trendModestringCrossi_trendMode
▲stringLowi_thresholdUpString
▼stringHighi_thresholdDownString
Crosssourcehighi_crossSrc1
i_crossMethod1stringAbovei_crossMethod1
Show all 35 settings
SettingTypeDefaultVariable
i_crossRef1string+2i_crossRef1
Crosssourcelowi_crossSrc2
i_crossMethod2stringBelowi_crossMethod2
i_crossRef2string-2i_crossRef2
Crosssourceclosei_crossSrc3
i_crossMethod3stringAbovei_crossMethod3
i_crossRef3stringOffi_crossRef3
Crosssourceclosei_crossSrc4
i_crossMethod4stringAbovei_crossMethod4
i_crossRef4stringOffi_crossRef4
Abovecolorcolor.bluei_crossAboveCol
Belowcolorcolor.fuchsiai_crossBelowCol
Fair value basis ▲ / ▼colorcolor.new(color.white, 50)i_upColorLine
i_downColorLinecolorcolor.new(color.red, 50)i_downColorLine
Threshold band ▲ / ▼colorcolor.new(color.white, 97)i_upColorFill
i_downColorFillcolorcolor.new(color.red, 97)i_downColorFill
Deviation hue ▲ / ▼colorcolor.new(color.red, 10)extremeDeviationUp
extremeDeviationDowncolorcolor.new(#3c699e, 10)extremeDeviationDown
Deviation bands extreme ▲ / ▼colorcolor.new(color.red, 90)extremeUpColor
extremeDownColorcolorcolor.new(#205497, 90)extremeDownColor
Deviation bandscolorcolor.new(color.white, 95)deviationBandColor
Table positionstringTop righttablePos
Table sizeint3tableSize
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

Snag - VWAP

by dearvn
257 stars

This indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc

Indicator v5 Moving averagesVolatility & bands Repaints
Updated 7 weeks ago · None stated GitHub repository of Snag - VWAP
7 stars

This indicator overlays Bollinger Bands on the price chart and fills the area between upper and lower bands using a color based on Cumulative Volume Delta trend. It plots an EMA 9 line and fills between the EMA 9 and Bollinger basis in green or red depending o

Indicator v6 Volatility & bandsVolume
Updated 5 months ago · None stated GitHub repository of Deep Chart + BB (CVD Internal)

This overlay indicator combines a rolling volume profile, anchored VWAP, and trend filters for crypto chart analysis. It builds a value area from recent bars and can draw right-side profile boxes, with an Auto performance mode that reduces lookback, row count,

Indicator v6 VolumeSupport & resistance
Updated 5 months ago · MIT GitHub repository of Crypto AMT Toolkit v6.2 - Info Auto Performance
1 stars

This overlay indicator combines three optional modules on the price chart. Volume weighted bands plot a smoothed trend and ATR-scaled envelopes in cloud or line-only form. The Keltner Hull suite calculates a Hull moving average and Keltner channels from a chos

Indicator v6 Moving averagesVolatility & bands
Updated 7 months ago · None stated GitHub repository of Keltner Hull Swing Profile

Key Level Confluence

by mrme000m
1 stars

The Key Level Confluence indicator plots support and resistance levels on the price chart. It calculates pivot highs and lows, the point of control from a simplified volume profile, VWAP, EMA50 and EMA200, Bollinger Bands, and ATR-based stop levels. Confluence

Indicator v5 Support & resistanceMoving averages
Updated 7 weeks ago · None stated GitHub repository of Key Level Confluence

More Moving averages scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers