- EA fails to remove trade
- OrderSend() - not working out for real-time orders (4756 error code)
- Objectget and objectgetvaluebyshift question
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
- Did you look up the meaning of error 4756?
- Did you follow up and see which return code is reported in the trade result?
- Did you lookup the meaning of that return code?
Your code alone does not help. Also show the log output.
Also have a look at the following and implement it in your EA. It is important that you carry out these checks even if your EA is not meant for the Market.
The checks a trading robot must pass before publication in the Market
MetaQuotes, 2016.08.01 09:30
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
- Did you look up the meaning of error 4756?
- Did you follow up and see which return code is reported in the trade result?
- Did you lookup the meaning of that return code?
2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Symbol: XAUUSD 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Digits: 2 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) SL: 2740.0 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) TP: 2710.0 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Lot: 1.0 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Min Lot: 0.01 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) TYPE: 1 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Current Ask: 2737.41 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Current Bid: 2737.19 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Error opening trade: 4756 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) Error: 10011 2024.11.05 23:18:41.130 ICTFollow (XAUUSD,H1) retcode=10030 deal=0 order=0
So, I ask again ...
- Did you look up the meaning of 4756?
- Did you look up the meaning of 10011?
- Did you look up the meaning of 10030?
ERR_TRADE_SEND_FAILED
4756
Trade request sending failed
10011
TRADE_RETCODE_ERROR
Request processing error
10030
TRADE_RETCODE_INVALID_FILL
Invalid order filling type
Based on the final return code about the filling type, what do you think may be the problem?
Read the following too ...
Filly Policy - Basic Principles - Trading Operations - MetaTrader 5 Help
struct MqlTradeRequest { ENUM_TRADE_REQUEST_ACTIONS action; // Trade operation type ulong magic; // Expert Advisor ID (magic number) ulong order; // Order ticket string symbol; // Trade symbol double volume; // Requested volume for a deal in lots double price; // Price double stoplimit; // StopLimit level of the order double sl; // Stop Loss level of the order double tp; // Take Profit level of the order ulong deviation; // Maximal possible deviation from the requested price ENUM_ORDER_TYPE type; // Order type ENUM_ORDER_TYPE_FILLING type_filling; // Order execution type ENUM_ORDER_TYPE_TIME type_time; // Order expiration type datetime expiration; // Order expiration time (for the orders of ORDER_TIME_SPECIFIED type) string comment; // Order comment ulong position; // Position ticket ulong position_by; // The ticket of an opposite position };
type_filling
Order execution type. Can be one of the enumeration ENUM_ORDER_TYPE_FILLING values.
Documentation on MQL5: Constants, Enumerations and Structures / Data Structures / Trade Request Structure
type_filling
Order execution type. Can be one of the enumeration ENUM_ORDER_TYPE_FILLING values.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use