The indicator “Buff Averages” plots two moving averages based on the candlestick price and volume.
For each bar, the indicator calculates the sum of the volume over a number of bars specified in the ‘fastAVG’ and ‘slowAVG’ parameters, and then it sums the following formula: price multiplied by volume and then divided by the previously calculated sum of volume.
Original idea and code : “BUff Up Your Moving Averages”, Buff Dormeier, S&C Magazine, Traders Tips, 02/2001
//PRC_Buff Averages | indicator
//23.08.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
//fastAVG = 5
//slowAVG = 20
// --- end of settings
price = customclose
fast = Summation[fastAVG]( Volume * price) / Summation[fastAVG]( Volume )
slow = Summation[slowAVG]( Volume * price) / Summation[slowAVG]( Volume )
RETURN fast coloured(30,144,255) style(line,2) as "fast Buff Average", slow coloured(220,20,60) style(line,2) as "slow Buff Averages"