Download MetaTrader 5

Testing with Third-Party Data Offline

To add comments, please log in or register
Robert Martin
61
Robert Martin 2015.07.02 21:53 

Hello all,

Hopefully someone more intelligent at coding/MT4 than I can help me.

I'm backtesting offline on MT4 with my own data. My broker's usual MINLOT and LOTSTEP = 0.01.

 

When offline,

Print(MarketInfo(Symbol(),MODE_MINLOT));

and

Print(MarketInfo(Symbol(),MODE_LOTSTEP));

both return 0.1.

This is resulting in an "OrderSend error 131" due to my position sizing being in the format of xx.xx00000000xx after normalizing the value.

What can I do to solve this?

Thanks and have a great day. 

ydrol
593
ydrol 2015.07.02 22:17  
Are you testing with tick data? How & when are you creating the tick file? Various account settings are embedded in the header of the fxt file.  including minlot, lotstep etc.
Robert Martin
61
Robert Martin 2015.07.02 22:24  

I'm testing with tick data converted to 1m data so it's usable by MT4.

All the tick and 1m data are csv files.

ydrol
593
ydrol 2015.07.02 22:33  
you may need to go online briefly, run a test then go offline again ? 
Robert Martin
61
Robert Martin 2015.07.02 22:44  

I believe going online will cause the history center to be filled with server data, which I don't want. Possible there's a way around that.

Does anyone know if there is a way to manually change MODE_MINLOT and MODE_LOTSTEP when not connected to any servers? 

ydrol
593
ydrol 2015.07.02 23:20  

I'm guessing: 

  • copy your ./history/BROKERSERVER/*.hst files somewhere safe. 
  • go online
  • run short backtest
  • go offline
  • copy back hst files. - also for good measure make them read only 

I suspect the info is in ./config/BROKERSERVER.srv if you can find the format, you can patch it


Robert Martin
61
Robert Martin 2015.07.03 01:32  
I don't see either of those files anywhere, I'm just going to alter my position sizes to a less accurate value for now.
To add comments, please log in or register