Download MetaTrader 5
To add comments, please log in or register
Share your program via Code Base. Gain access to millions of traders!
jt27
36
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
5938
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).

marcboggs
513
marcboggs 2016.07.01 11:40  
Gooly,

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

Thanks.
Carl Schreiber
5938
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