Use of Timer Object to Delay Execution of Code in EasyLanguage
The Timer Object can be used to delay the execution of Easylanguage code. This may be useful when issuing orders from a strategy to , to ensure each step is received by the trade server and acknowledged before proceeding to the next step. Failure to do so can create out-of-sync conditions with strategies that use OrderTickets to generate or cancel orders, or when restarting the strategy to re-sync the real-world position and strategy position.
The following example of code shows how a series of code steps within a strategy or indicator may be delayed a user-specified number of seconds by reusing a single Timer Object:

Fig. 1. Code Creating a Series of Execution Delays Between Code Segments Using the Timer Object

Line 26
Lines 32-45
Lines 57-58
Print Log
Downloads
Initial posted version: 01/16/14
Latest Update: 01/16/14
*.ELD files are compiled for TS 9.1
All ELD and code text files packaged here:
The code may be visualized here: