PureBytes Links
Trading Reference Links
|
I would guess that since your expression:
Value1 = Average(BB1(C,11,2),3) ;
uses the Average function and since BB2 uses the simple version of XAve,
that TradeStation used the simple version of Average to evaluate the
function. Since this repeatedly calls past values of the price input (which
is BB2) your XAve function probably gets screwed up. Just a guess.
And Omega thinks it is hiding the complexities of programming from the user
by all this stuff it does for us automatically!
As I recently said in a similar post - NEVER call a function as the
argument of another function. ALWAYS equate it to a variable first and then
use that variable as the argument in the subsequent function.
Bob Fulks
At 1:32 AM -0500 3/11/99, Cab Vinton wrote:
>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
|