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

The Mysteries of Easy Language



PureBytes Links

Trading Reference Links

Once again TradeStation's "Easy Language" is driving me absolutely nuts.

I created two functions, called BB1 and BB2, both of which return the
value of an upper Bollinger Band. BB1 uses the series function of
XAverage and BB2 uses a simple version of XAverage (XAve).

BB1 = XAverage(C,20) + 2*StdDev(C,20) ;
BB2 = XAve(C,20) + 2*StdDev(C,20) ;

I verified that both BB1 and BB2 return the same values.

Next I created an indicator to plot a 3-bar average of the upper
Bollinger Band:

Value1 = Average(BB1(C,11,2),3) ;

Value2 = BB1(C,11,2) ;
Value3 = Average(Value2,3) ;

Plot1(Value1,"X") ;
Plot2(Value3,"Y") ;

The two plots are equivalent-- as they should be-- when I use BB1
(series version) but not when I use BB2 (simple version).

The root problem is that Value1 returns an incorrect value when using
BB2 (simple version).

It's hard to conceive that after all this time I'm still flailing around
with series/ simple stuff. I guess it's not enough that BB1 and BB2
return the same values ...

If someone has a good explanation for the above, I'd love to hear it.

Cheers,

Cab Vinton
cvinton@xxxxxxxxxxx