Download MetaTrader 5

Use Debugger with Historical Data?

To add comments, please log in or register
jt27
75
jt27  
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
7372
Carl Schreiber  

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
841
Marc Boggs  
Gooly,

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

Thanks.
Carl Schreiber
7372
Carl Schreiber  

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