Only ONCE Add x Seconds delay at Start of Strategy, You need this if you are collecting data from Chart 1 to Chart2 through EL Collection.Dll as if Chart2 is loaded first then Error will be issued by Dll. By adding delay you can keep Chart2 Strategy buzzy for 3 seconds in initial calculation so Chart1 can load properly.
Solution: Only One time X Seconds delay for Strategy calculation in the start of First Bar strategy calculation. To do this, just add below code in the Start of your strategy.
Code: Select all
Input:xSecondsDelay(3);
vars: xSecondsDelay1(0),xSecondsDelay2(0),xSecondsDelay3(0);
Once ClearPrintLog;
Once xSecondsDelay1=CurrentTime_s+xSecondsDelay;
Once Print("Started=",CurrentTime_s," ","StopTarget=",xSecondsDelay1);
if xSecondsDelay3=0 then begin
For xSecondsDelay2=1 to 10000000000000000000
Begin
//Print(BarNumber," ",xSecondsDelay2);
If CurrentTime_s>xSecondsDelay1 then break;
End;
xSecondsDelay3=1;
Print("Started=",xSecondsDelay1-xSecondsDelay," ","Stopped=",CurrentTime_s);
End;
Successful Trading!!!
Thanks