Error = 4756 - ERR_TRADE_SEND_FAILED: Trade request sending failed, RetCode = 10017 - TRADE_RETCODE_TRADE_DISABLED: Trade is disabled

 

When are times that trading get trade disabled in back testing. The order details are as follows:

Trade action: TRADE_ACTION_DEAL
Trade symbol: EURUSD
Magic number: 0
Order ticket: 0
Order type: ORDER_TYPE_BUY
Order filling: ORDER_FILLING_FOK
Order time type: ORDER_TIME_GTC
Order expiration: 1970.01.01 00:00
Price: 1.02275
Volume: 0.01
Stop Limit: 0
Deviation points: 18446744073709551615
Stop Loss: 0
Take Profit: 0
Position ticket: 0
Position by ticket: 0
Comment: NULL

Allow algo trading s enabled

 I have tried:

  1. MetaTrader demo account
  2. Fusion Markets Zero demo account
 
Suminda Dharmasena: When are times that trading get trade disabled in back testing. The order details are as follows: Allow algo trading s enabled. I have tried:

If this is in the Strategy Tester, then its probably referring to Trade Sessions as referenced in the Contract Specifications:


You can use the following function to find out the session times:

SymbolInfoSessionTrade

Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week.

Documentation on MQL5: Market Info / SymbolInfoSessionTrade
Documentation on MQL5: Market Info / SymbolInfoSessionTrade
  • www.mql5.com
SymbolInfoSessionTrade - Market Info - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Fernando Carreiro #:

If this is in the Strategy Tester, then its probably referring to Trade Sessions as referenced in the Contract Specifications:


You can use the following function to find out the session times:

SymbolInfoSessionTrade

Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week.

I am doing back testing. Hence doesn't the strategy tester skip these times.

 
Suminda Dharmasena #: I am doing back testing. Hence doesn't the strategy tester skip these times.
No! MetaTrader 5 Strategy Tester simulates the sessions so you have to check them in your code and not trade during those times.
 
Fernando Carreiro #:
No! MetaTrader 5 Strategy Tester simulates the sessions so you have to check them in your code and not trade during those times.

SymbolInfoSessionTrade returns:

From: 1970.01.01 00:00:00,

To: 1970.01.02 00:00:00

through out back testing in strategy tester. Please note the day is different 01 vs 02.


Also above error is raised when TimeCurrent returns a time within market hours e.g. 2022.08.04 11:12:25 .

Currency pair I am testing on is EURUSD and I am using Fusion Markets Zero demo account and MetaTrader demo account. Also I am only using 1 month of back testing so dates cannot go to 1970.



 
Complete reinstallation solved the 4756 - ERR_TRADE_SEND_FAILED and 10017 - TRADE_RETCODE_TRADE_DISABLED errors.
Reason: