Download MetaTrader 5

backtesting with pending STOP Orders

To add comments, please log in or register
Do you want to write a technical indicator? Find solution in MQL5 Reference!
marsupilami
45
marsupilami 2016.10.07 10:11 

Hello,

I have noticed when I backtest a strategy using OP_BUYSTOP or OP_SELLSTOP  types, execution levels are done at the exact STOP level even when such market execution would'nt have been possible ( gaps...) 

Normally if you backtest with OP_BUY and OP_SELL  and have a proper set of reliable tickdata your execution will be at the exact tick price reflecting the gap

 Has anyone noticed that and is there a way to overcome ?

 

Thanks

Bernhard Schweigert
5799
Bernhard Schweigert 2016.10.07 12:54  
marsupilami:

Hello,

I have noticed when I backtest a strategy using OP_BUYSTOP or OP_SELLSTOP  types, execution levels are done at the exact STOP level even when such market execution would'nt have been possible ( gaps...) 

Normally if you backtest with OP_BUY and OP_SELL  and have a proper set of reliable tickdata your execution will be at the exact tick price reflecting the gap

 Has anyone noticed that and is there a way to overcome ?

 

Thanks

a backtest does no ask line (live spread) and no gap. trades are open or closed within gaps!
marsupilami
45
marsupilami 2016.10.07 15:17  
Bernhard Schweigert:
a backtest does no ask line (live spread) and no gap. trades are open or closed within gaps!
Hi I use tickdata of my own broker (gathered through an ea with bid and ask) to create own .FXT file with live spreads (using TDS)
Jose Francisco Casado Fernandez
2407
Jose Francisco Casado Fernandez 2016.10.07 21:40  
marsupilami:
Hi I use tickdata of my own broker (gathered through an ea with bid and ask) to create own .FXT file with live spreads (using TDS)
Which is your broker???. I only know tick data from Dukascopy, Integral / Pepperstone, Gain Capital, MB Trading, Hisdata (free data source), and Oanda (only for real account clients), and I would like to know if there is another source else. Thanks.
marsupilami
45
marsupilami 2016.10.08 15:00  
Jose Francisco Casado Fernandez:
Which is your broker???. I only know tick data from Dukascopy, Integral / Pepperstone, Gain Capital, MB Trading, Hisdata (free data source), and Oanda (only for real account clients), and I would like to know if there is another source else. Thanks.

actually my broker doesn't provide tick data. I run a few expert advisors live on a real account and different pairs since years just to to log all tics (bid and ask) and then I use these csv files to create the .FXT.  I prefer this to Dukascopy just because they fit better to what I can expect from my broker's quote. You could do it with any broker but it'll take time before you get sufficient data logged to optimize.

Jose Francisco Casado Fernandez
2407
Jose Francisco Casado Fernandez 2016.10.08 18:13  
marsupilami:

actually my broker doesn't provide tick data. I run a few expert advisors live on a real account and different pairs since years just to to log all tics (bid and ask) and then I use these csv files to create the .FXT.  I prefer this to Dukascopy just because they fit better to what I can expect from my broker's quote. You could do it with any broker but it'll take time before you get sufficient data logged to optimize.

Ok, I have a friend that did the same way. Unfortunately there is no EA that save all the ticks. MT5 now saves ticks history. No need to PC or VPS working 24 hours. It's much more comfortable. Thanks.
To add comments, please log in or register