Download MetaTrader 5

Getting Error during Backtesting in MT5: ERROR: Server error. Sending order to server again

To add comments, please log in or register
Abhay Agarwal
414
Abhay Agarwal  

Hi,

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.

Alain Verleyen
Moderator
35039
Alain Verleyen  
Abhay Agarwal:

Hi,

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.

Abhay Agarwal
414
Abhay Agarwal  
Alain Verleyen:

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:

         if(errorcode_bn==TRADE_RETCODE_CONNECTION 

             || errorcode_bn==TRADE_RETCODE_TIMEOUT

             || errorcode_bn==TRADE_RETCODE_INVALID_PRICE

             || errorcode_bn==TRADE_RETCODE_PRICE_OFF

             || errorcode_bn==TRADE_RETCODE_PRICE_CHANGED

             || errorcode_bn==TRADE_RETCODE_REQUOTE

             || errorcode_bn==TRADE_RETCODE_REJECT

             || errorcode_bn==TRADE_RETCODE_ERROR

             || errorcode_bn==TRADE_RETCODE_INVALID

             || errorcode_bn==TRADE_RETCODE_INVALID_VOLUME

             || errorcode_bn==TRADE_RETCODE_INVALID_STOPS

             || errorcode_bn==TRADE_RETCODE_INVALID_FILL

           ) 


Again my code is correct as it runs on other periods...

Alain Verleyen
Moderator
35039
Alain Verleyen  
Abhay Agarwal:

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.

To add comments, please log in or register