When backtesting my EA is filling Stop Orders and TP, SL with market closed and in non existent traded levels.
My EA is based on price action on the analysis of each of the bars. But every time a Stop Loss, Take Profit, or Stop Order stays open from one day to the other, when next day market opens on a gap down or gap up, the strategy tester of the meta trader accepts and considers the order being filled on the Stop Order level, even if on that day markets never traded there.
This is bringing unreal results to the test. What I want is to make sure my EA only fills on really traded levels.
I tried closing positions everyday and opening in the morning, but it's not efficient, doubles my trade flow and this is not what i would do in real life.
Any thoughts?
Not sure about your problem...what is the red arrow you surrounded ?
That is the sell arrow, blues are the longs and reds the sell. In this piece of the chart, my EA connected directly longs to shorts, reversing open positions, that's why they are all connected.
That sell was triggered by a SellStop order on that level. But market opened gap down and never traded during that day on that level. the Strategy tester considered that level as valid and counted that as a real sale on that level.
when i get details over the symbol i am using it says the type of Trade Execution is "instant", do you think that maybe changing to "market" would solve? (is it possible to change or force that?). tried to find more detail on that but couldnt find
That is the sell arrow, blues are the longs and reds the sell. In this piece of the chart, my EA connected directly longs to shorts, reversing open positions, that's why they are all connected.
That sell was triggered by a SellStop order on that level. But market opened gap down and never traded during that day on that level. the Strategy tester considered that level as valid and counted that as a real sale on that level.
when i get details over the symbol i am using it says the type of Trade Execution is "instant", do you think that maybe changing to "market" would solve? (is it possible to change or force that?). tried to find more detail on that but couldnt find
![Bug in the Strategy Tester (MT4, build 950) Bug in the Strategy Tester (MT4, build 950)](/i/community/logo_mql5_small.png)
- www.mql5.com
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My EA is based on price action on the analysis of each of the bars. But every time a Stop Loss, Take Profit, or Stop Order stays open from one day to the other, when next day market opens on a gap down or gap up, the strategy tester of the meta trader accepts and considers the order being filled on the Stop Order level, even if on that day markets never traded there.
This is bringing unreal results to the test. What I want is to make sure my EA only fills on really traded levels.
I tried closing positions everyday and opening in the morning, but it's not efficient, doubles my trade flow and this is not what i would do in real life.
Any thoughts?