#Indicator
'**************************************************************
'*   Volume Multiplier (VM.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:
'*
'*  Short_Periods -  Specifies the number of periods for the 
'*                    short moving average calculation 
'*  
'*  Long_Periods - Specifies the number of periods for the
'*                    long moving average calculation
'*
'************************************************************** 
#Param "Short_Periods", 10
#Param "Long_Periods", 50

Dim myShortVMA	As Single
Dim myLongVMA	As Single
Dim myVM		As Single

' Calculate the moving averages of volume
myShortVMA = SMA(V,Short_Periods)
myLongVMA = SMA(V,Long_Periods)

' Calculate the multiplier
myVM = myShortVMA/myLongVMA

' Plot the indicator
Plot("VM",myVM)

' Return the value calculated by the indicator
Return myVM