Matthew Greenslet
 Idol
    Posts: 2077
Joined: 2/27/2006
User Profile |
OT2009 has a new parser over OT2008. The new parser alleviates a lot of the limitations in the old parser due to complex or nested formulas. The vast majority of the changes will not have any impact on existing scripts, however there are a couple that need to be pointed out.
One noticeable change is that variable values are now carried over to the next bar. On the old parser you need to specifically carry over values (MyVar = MyVar[1]) otherwise your variable would equal 0 on each new bar requiring you to set it explicitly. This is no longer necessary. However if your script relied on the variable to always = 0 on a new bar because of some conditional check before setting it, be sure to either initialize your variable in the deceleration or set the variable value to 0 at the very top of the script before any other logic.
There was also a change to the way exits are calculated. With exits on the old parser there is no way to set the internal exit level on the first bar. When you set ExitLevel = SomeValue the change is not applied till the next bar. This is to prevent cheating by changing your exit level while a bar is forming. To resolve this we start calculating the exit on the bar before the entry bar. This way you can do your calculations and set ExitLevel = SomeValue and it will be active for the first trading bar.
Note: This change is under review and could change back at a later date. Please click here to read more about the issues this might cause.
Another common question is "Why am I getting this compiler error 'C' not declared? This worked in OT08.". This is a result of an unsupported work around or 'hack' implemented of using C.Length to obtain the total number of data bars. This hack no longer slips past in the new parser. There is a new unsupported work around (hack) to correct this. Instead of using C.Length you can use SymbolData.NumRec. This is a hack as well and I cannot guaranty this will continue to compile in later revisions of the parser. If this happens I will request there be some other way to get this information, since it is important for several indicators.
|