PureBytes Links
Trading Reference Links
|
{*******************************************************************
Description: Exponential Average
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}
Inputs: Price(NumericSeries), Length(NumericSeries);
Variables: Factor(0);
If Length + 1 <> 0 Then Begin
If CurrentBar <= 1 Then Begin
Factor = 2 / (Length + 1);
_IXXAverage = Price;
End
Else
_IXXAverage = Factor * Price + (1 - Factor) * _IXXAverage[1];
End;
Create your own copy......as above:
note the difference between NumericSeries declaration and Numeric or
NumericSimple.
> -----Original Message-----
> From: imacauslan@xxxxxxx [mailto:imacauslan@xxxxxxx]
> Sent: Monday, November 01, 1999 6:39 PM
> To: omega-list@xxxxxxxxxx
> Subject: "Variables and Arrays not allowed here"
>
>
> Greetings
>
> I'm refining a 5-minute bar Exponential Moving Avg-based system, and am
> trying to write a simple method to "adjust out" the effect of gap
> opennings -- since these can wildly distort the calculation of the "true
> signal" the moving average is attempting to capture. (The distortion is
> most noticeable in the first hour or so.)
>
> I'm having a real EasyLanguage problem. Could someone tell me how I can
> get around this? It's telling me I can't use a variable in the
> calculation of TradeStation's XAVERAGE function.
>
> To simplify, here is a snippet:
>
> ...
>
> If Date <> Date[1] then
> GAP = Close - Close[1];
>
> CL_NOGAP = Close - GAP;
> HI_NOGAP = High - GAP;
> LO_NOGAP = Low - GAP;
>
> UpperMA = XAverage(CL_NOGAP, AvgLen)[1];
> LowerMA = XAverage(HI_NOGAP, AvgLen)[1];
>
> ...
>
> Does anyone know if there is a way I can get around this limitation?
>
> THANKS,
> Ian
>
|