This indicator calculates four-year accumulated volume weighted average prices with recency weighting for the current year, previous year, two years ago and three years ago.
1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
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
4Y AVWAP SIP plots lines for each individual AVWAP, a recency-weighted composite and an equal-weight composite, along with a weekly moving average. Fair-value bands are defined using weekly ATR distances for mild discount, strong discount, deep discount and far-above regions. A SIP allocation table displays percentage adjustments based on current price position relative to the bands. The script draws all elements directly on the price chart with options to show or hide individual components, fills and tints.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
VWAP Source
source
hlc3
src
Current Year Weight
float
40.0
weightCurrentYear
Previous Year Weight
float
30.0
weightPreviousYear
Two Years Ago Weight
float
20.0
weightTwoYearsAgo
Three Years Ago Weight
float
10.0
weightThreeYearsAgo
Weekly ATR Length
int
14
weeklyATRLength
Zone 1 Distance: Mild Discount
float
0.5
initialZoneATR
Zone 2 Distance: Strong Discount
float
1.0
strongZoneATR
Zone 3 Distance: Deep Discount
float
1.5
deepZoneATR
Far Above Fair-Value Distance
float
1.5
expensiveZoneATR
Show Individual AVWAPs
bool
true
showIndividualAVWAPs
Show Equal-Weight Composite
bool
true
showEqualWeightComposite
Show all 34 settings
Setting
Type
Default
Variable
Fill Fair-Value Band
bool
true
showCentralBandFill
Show Discount Zone Lines
bool
true
showReferenceZones
Show Weekly Moving Average
bool
true
showWeeklyMA
Weekly Moving Average Length
int
40
weeklyMALength
Show Fair-Value Background Tint
bool
true
showValueBackground
Current Year AVWAP
color
color.aqua
colorCurrentYear
Previous Year AVWAP
color
color.blue
colorPreviousYear
Two Years Ago AVWAP
color
color.orange
colorTwoYearsAgo
Three Years Ago AVWAP
color
color.gray
colorThreeYearsAgo
Recency-Weighted Composite
color
color.aqua
colorWeightedComposite
Equal-Weight Composite
color
color.blue
colorEqualComposite
Weekly Moving Average
color
color.yellow
colorWeeklyMA
Tint Far Above Fair Value
color
color.new(color.red, 82)
colorAboveValueTint
Tint Inside Fair Value
color
color.new(color.gray, 100)
colorInsideValueTint
Tint at Deep Discount
color
color.new(color.green, 55)
colorBelowValueTint
Individual AVWAP Width
int
1
individualLineWidth
Composite Line Width
int
3
compositeLineWidth
Show SIP Allocation Table
bool
true
showSipTable
Minimum SIP % Far Above Fair Value
float
25.0
minSipPct
Normal SIP % Inside Fair Value
float
100.0
normalSipPct
Maximum SIP % at Deep Discount
float
200.0
maxSipPct
Table Position
string
Top Right
tablePosition
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.
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
This indicator overlays trend-following Supertrend bands on the price chart using Average True Range calculations. It plots trailing stop lines, highlights active trend directions, and prints buy or sell shape labels when price closes across band thresholds. I
The MA Envelope indicator calculates upper and lower channel bands shifted by a user-defined percentage around a baseline moving average. It supports Simple Moving Average, Exponential Moving Average, and Weighted Moving Average calculation types. The script p
This indicator estimates gamma exposure levels and intraday context for index instruments like SPY and ES. It calculates VWAP with standard deviation bands as a gamma flip proxy, highlighting market regimes through background colors. It plots prior day high, l
The Median indicator calculates the median of a selected source series such as the high-low average over a user-defined length and plots it as a red line on the price chart. It draws an EMA of the median as a blue line and fills the space between them, changin
This indicator calculates a base moving average (EMA, SMA, WMA, or HMA) and projects multiple symmetrical envelope bands around it directly on the price chart. Users can adjust the length, source, moving average type, and initial envelope multiplier. Additiona