Does anyone know the reason for the error during backtestign in MT5
"ERROR: Server error. Sending order to server again"
My code is correct as I can backtest without problems for periods Sep'17 - Jan'18 but when I am trying to backtest for futures data from Jan'17 - Mar'17, then it is giving me this error.
When I test visually, then it does show the chart data but gives error when placing the order.
Are you sure this message doesn't come from your code ? I am almost sure it is.
Backtesting without problem on an other period doesn't mean you can't have this error on an other period.
Ok, it is coming from my code, but on these conditions:
Again my code is correct as it runs on other periods...
No it's not, as it gives you a useless error message.
Check what is the exact error and manage it, the above errors are very different.
Ok In Backtesting for the expired futures symbol, it gives the error:
It was working fine until 1 or 2 days ago.
For everyone's benefit, the issue was resolved by setting in the code, trade.setfillingtype(ORDER_FILLING_RETURN) , just before calling trade.PositionOpen request..