Congratulations Lucem ! 4.003 now works correctly.
Your EA is fast to react to TradingView signals, the only drawbacks I now see are the following :
Your EA feeds the comment field with the string “TradingViewToMT5” of the MQL5 MqlTradeRequest structure + the ulong magic number “884” and you send this information with each order to the broker without customer agreement.
The magic number can be removed with “m=0” but the comment “TradingViewToMT5” can’t.
These days, unfortunately, some brokers are dishonest.
I regularly advise profitable traders NOT to give the broker any clues about the strategy they use, the tool they use, whether or not they trade manually, when… or about the tool they use, whether or not they trade manually, when…
If the strategy is highly profitable, even banks are capable of putting money on the table to bribe people to get the strategy’s source code.
In addition, telling the broker what tool his client uses can help him anticipate his orders to trigger his stop losses, as many brokers trade against their clients’ positions because 90% of them lose money.
It would be an improvement if this comment be optional or a customized string field…
Thanks
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
};