#Indicator '************************************************************** '* Volume Price Ratio (VPR.txt) '* by Jeremy Williams '* May. 9, 2007 '* '* Adapted from Technical Analysis of Stocks and Commodities '* July 2007 '* '* Summary: '* '* This indicator is used in the calculation of the VPCI '* indicator. For more information see "Between Price and Volume" '* in the July 2007 issue of Technical Analysis of Stocks '* and Commodities. '* '* Parameters: '* '* Periods - Specifies the number of periods for the '* moving average calculation '* '************************************************************** #Param "Periods",14 Dim myMA As Single Dim myVWMA As Single Dim myVPR As Single ' Calculate the Moving Averages myMA = SMA(Periods) myVWMA = VWMA(Periods) ' Calculate the indicator myVPR = myVWMA/myMA ' Plot the indicator Plot("VPR",myVPR) ' Return the value calculated by the indicator Return myVPR