Moving Volume Weighted Average Price (MVWAP)
A poster requested this indicator based on the definition found in Investopedia.https://www.investopedia.com/articles/trading/11/trading-with-vwap-mvwap.asp
An MVWAP is basically an average of the VWAP values. VWAP is only calculated per day, but MVWAP can move from day to day because it is an average of an average. This provides longer-term traders with a moving average volume weighted price.
Code has been updated to include Bollinger Bands. Click on the gear settings to turn them on or off.
I have not used it but as it is a simple study, I wrote up the syntax. If you find a use for it, report back.
Ruby:
# Moving volume weighted average price (MVWAP)
input n_periods = 10 ;
input BBlength = 10;
input BBNum_Dev = 1.0;
input showBands = yes ;
def VWAP = reference VWAP("time frame" = "DAY")."VWAP" ;
plot MVWAP = average(VWAP,n_periods) ;
MVWAP.SetDefaultColor(color.magenta) ;
plot BB_Upper = reference BollingerBands(price = MVWAP, length = BBlength, Num_Dev_Dn = -BBNum_Dev, Num_Dev_Up = BBNum_Dev).UpperBand;
def BB_Lower = reference BollingerBands(price = MVWAP, length = BBlength, Num_Dev_Dn = -BBNum_Dev, Num_Dev_Up = BBNum_Dev).Lowerband;
BB_Upper.SetDefaultColor(Color.LIGHT_GRAY);
AddCloud(if showBands then BB_Upper else double.NaN, if showBands then BB_Lower else double.NaN, Color.GRAY, Color.GRAY);
Easiest way to load shared links
Last edited: