Download MetaTrader 5
To add comments, please log in or register
Freelance service: the safe way to order a trading robot. Try it!
jt27
46
jt27 2016.06.01 01:19 
Is it possible to use the debugger with historical data with MQL4?  I see the button for it and the tab in the options menu to set it up but the 'Start on History Data' button is greyed out.
Carl Schreiber
6129
Carl Schreiber 2016.06.01 21:29  

1) You can't use the strategy tester (and its historic data)  with the debugger.

2) In your EA you can start the calculation at the beginning of your chart (Bars - n).

Marc Boggs
537
Marc Boggs 2016.07.01 11:40  
Gooly,

Can you give a code example of how to do this?

Thanks.
Carl Schreiber
6129
Carl Schreiber 2016.07.01 11:51  

like (untested!)

int OnTick() { 

     int bar = Bars; 
     while (--bar>=0) { 
         ...
     }
}

This calculates always the available bars of the actual chart!

/
To add comments, please log in or register