Some options are ...
- Don't use pending orders. Use Market orders instead. Given that its an EA and not a human, it can easily monitor prices 24/7 and carry out the actions as programmed.
- Monitor spread and volatility and apply whatever rules are required.
- Analyse news calender and don't trade during events that could affect volatility of the symbol in question.
EDIT: On MT5, you can back-test with real tick data, including during historical news events with high volatility where spread widened.
As discussed with user in private, the topic has been moved to the section: Expert Advisors and Automated Trading.
I performed another test and that trade eventually closed in loss anyway, so I probably don't need to do anything. Just accept the risks.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
2023.06.01 20:13:41.782 '4117408': order #67975146 buy stop 0.02 GBPJPY.pro at 174.085 activated at price 174.090
2023.06.01 20:13:41.782 '4117408': order #67940641 sell 0.02 GBPJPY.pro at 172.947 closed due stop-loss at price 174.090
Note: order numbers change when a pending order is filled.
I think there was News at this time with a yellow code? not sure.
In any case the spread must have spiked to around 12 pips and filled it at the Ask price and immediately hit the stop for -45pips or 450 points.
The tester in MT4 was not able to test for such an incident, not sure if MT5 can either.
But are there any countermeasures that could be employed by a robot?
Perhaps checking the spread and closing pending orders out when above a threshold value?
Unfortunately not able to test the theory in the MT4 tester.
Just asking for any input or thoughts.