'**********************************************************************
'*   VFI Moving Average Crossover (VFIMA)
'*     by Jeremy Williams
'*	   February 20,2006
'*
'*	Adapted from Technical Analysis of Stocks and Commodities
'*    June 2004 and July 2004
'*
'*  Summary: 
'*
'*      This system uses a Volume Flow Indicator (VFI) Moving
'*  Average crossover to generate long signals. It requires the VFI indicator.
'*  For more information see "Using Money Flow to Stay with the Trend",
'*  and "Volume Flow Indicator Performance" in the June 2004 and 
'*  July 2004 editions of Technical Analysis of Stocks and
'*  Commodities.
'*
'*  Parameters:
'*
'*  Period= Specifies the number of Periods used for VFI calculation
'*
'*  Coef = Specifies the fixed scaling factor for the VFI calculation
'*
'*  VolCoef= Specifies the cutoff for maximum volume in the VFI calculation
'*             
'*  ShortSmoothing= Specifies the number of periods used in the short moving average
'*
'*  LongSmoothing=Specifies the number of periods used in the long moving average 
'*
'******************************************************************** 

#System
#Param "Period",130
#Param "Coef", .2
#Param "VolCoef",2.5
#Param "SD_period",30
#Param "ShortSmoothing",3
#param "LongSmoothing",14


Dim ShortVFI 	As Single
Dim LongVFI 	As Single

ShortVFI = VFI(Period,Coef,VolCoef,SD_Period,ShortSmoothing)
LongVFI = VFI(Period,Coef,VolCoef,SD_Period,LongSmoothing)

If ShortVFI > LongVFI then             ' If the short moving average
Signal = LongSignal					   ' crosses the long moving average
End if								   ' generate long signal