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

"Variables and Arrays not allowed here"



PureBytes Links

Trading Reference Links

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