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

Obscure EasyLanguage Bug



PureBytes Links

Trading Reference Links

>>It is fairly well known that many functions, such as series functions, need
to be evaluated on every bar to return the correct values. Such functions
should not be included in conditional expressions such as:

       if <condition> then <function>;

that would prevent them from being evaluated on every bar.<<


It has been my experience that type SERIES user functions will get processed on 
every bar regardless of the logic surrounding it.  Type SERIES functions get 
evaluated before the rest of your code is executed.  Type SIMPLE functions, 
OTOH, get evaluated inline, so it that case, you need to be very careful about 
the embedding logic.

>>Thus, the functions further on in the expression are NOT EVALUATED on that
bar and will then give incorrect values on future bars.<<

Probably because the functions are of type SIMPLE instead of type SERIES.   If 
you can open these functions, then make new functions, copy in the text and 
recompile as type SERIES.

>>The workaround is to break up the expression into smaller parts...<<

YES.  However, there is no error in Omega's code.  Omega simply need to 
recompile them as type SERIES.  However, when you do that, you lose the ability 
to modify the input parameter on a bar-to-bar basis.  So, do you *really* want 
Omega to make the change?

>>But I don't see why this is necessary. Both gave the same result in my
testing. Perhaps someone can see a reason.<<

Your analysis is correct.  You don't need to go as far down as they suggested.

- Mark Jurik