#Indicator '************************************************************** '* Rate of Change Adjusted (ROCAdj.txt) '* by Jeremy Williams '* Feb. 6,2007 '* '* Adapted from Technical Analysis of Stocks and Commodities '* April 2007 '* '* Summary: '* '* This indicator addresses some of the shortcomings of the '* traditional Rate of Change calculation. In particular all data '* within the calculation range is analyzed, providing an elegant '* solution to the "Two Point Problem" of the classical calculation. '* For more information see "Two Point Problem of The Rate Of Change" '* in the April 2007 edition of Technical Analysis of Stocks and '* Commodities. '* '* Parameters: '* '* Periods - Specifies the number of periods used for the '* calculation. '* '************************************************************** #Param "Periods",5 Dim myROC As Single Dim myEMA As Single Dim myROCAdj As Single ' Calculatate the indicator myROC = ROC(1) myEMA = EMA(myRoc,Periods) myROCAdj = myEMA*Periods ' Plot the indicator values Plot("ROCAdj",myROCAdj) ' Return the value calculated by the indicator Return myROCAdj