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

Re: XAverage (was: Van Tharp and system developements)



PureBytes Links

Trading Reference Links

Sentinel Trading wrote:
> 
> This should take care of 10 day Exponential Average of the 3 day ATR.
> 
> First create the XAverageV  function from Bob Fulks without it you can't use
> anything other than price in an XAverage function. Then create the indicator
> XAverageTrueRange. Code Below.
> 
> { *******************************************************************
> 
>  Study     : XAverage.V
> 
>  Last Edit : 11/2/96
> 
>  Provided By : Bob Fulks
> 
>  Description : This is a recoding of the XAverage function as a
>       "simple function" rather than as a "series function". For
>       correct results it must be evaluated on every bar, as is
>       normal for Omega simple functions.
> 
> ********************************************************************}
> inputs : Price(NumericSeries), Length(NumericSimple);
> vars   : Factor(0), XLast(0);
> 
> if Length + 1 <> 0
> then begin
>  if CurrentBar <= 1
>  then begin
>   Factor = 2 / (Length + 1);
>   XAverage.V = Price;
>   XLast = Price;
>  end
>  else begin
>   Value1 = Factor * Price + (1 - Factor) * XLast;
>   XAverage.V = Value1;
>   XLast = Value1;
>  end;
> end;
> 
> {******************************************************************}
>        {XAvgTrueRange}
> 
> Inputs:XAvgLen(10), ATRLen(3);
> 
>  Plot1(XAverage.V(AvgTrueRange(XAvgLen),ATRLen),"XAvgTR");     <------------
> 
>

2 questions:

It appears to me that XAvgLen and ATRLen are reversed above.  

Are you guys saying if I use the quick editor: custom 1 line, and type
in xaverage(truerange,20) , that it will not give me the 20 day
exponential average of the true range?

When I should use series vs. simple (or arrays??), when TS is
calculating every bar or not, and when it's carrying a value set on the
previous bar to the current bar, is something that is pretty fuzzy to
me!

Conrad Bowers