[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hull Mov Avg



PureBytes Links

Trading Reference Links

At 03:52 AM 1/6/2005, miltonc wrote:

>Would anyone have the following indicator for TS2000i
>I cannot get the code to verify in TS2000i
>
>Input: period (Default value 20)
>waverage(2*waverage(close,period/2)-waverage(close,period),
>SquareRoot(Period))


Here is the corrected code that verifies in TS8. It should work in TS2000i also.

It has little lag but overshoots quite a bit. (See picture)

Bob Fulks



{ *******************************************************************
 
   Function    : HullMA
   
   Written     : 010605
 
   Provided By : Bob Fulks
 
   Description : This is a corrected version of TradeStation code for 
      the Hull Moving Average as described at:
 
         <http://www.justdata.com/Journals/AllanHull/hull_ma.htm>
 
   Inputs:

      Price: The data series to filter.
      Period: The smoothing desired 
 
********************************************************************}
 
Input: Price(NumericSeries), Period(NumericSimple);
 
Var:   Len1(IntPortion(0.5 * Period)), Len2(IntPortion(SquareRoot(Period)));
 
HullMA = WAverage(2 * WAverage(Price, Len1) - WAverage(Price, Period), Len2);


Attachment: HullMA.png
Description: PNG image