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

Re: Order of EL Execution



PureBytes Links

Trading Reference Links

>I've been trying to debug an indicator.  This indicator calls a couple
>functions and plots the returned values.  I planted several print
>statements in the debugging process. It appears that when CurrentBar =
>1, the initialization that must happen in the indicator prior to calling
>the functions is not happening until AFTER the first call of the two
>functions, giving me erroneous results.
>
>In other words, the indicator is (more or less):
>{Indicator}
>If CurrentBar = 1 Then
> Begin
> {Initialize code}
> End;
>Plot1(Function1,"F1");
>Plot2(Function2,"F2");
>
>However, the prints show that Function1 and Function2 are each executed
>prior to the execution of the initialization in the indicator.


Great Omega-list related topic!  Okay all you Omega developers, let's get
this list rolling again.  Fire up those synapse and get those fingers typing
again!

Here's what's happening:
Your user functions are probably "Series Type" functions which means there
executed on each and every bar before the rest of the code. So yes, they
will be executed before your initialization routine. To correct this, make
your functions "Simple" rather than "Series" if possible, or don't worry
about the first few messed up bars.