I have tested it on two brokers where I can manually open a new trade as "Market Execution" with "Stop Loss" and "Take Profit" options disabled. That's expected, but in fact, when I create an EA, OrderSend() function works when SL and TP parameters are used. It just opens trades as in non-ECN broker, there is no error 130 anymore.
My question is: Is MT4 now able to deal with ECN brokers officially when EA is used, without the need to first open the trade with no stops, and then add them with OrderModify()? If yes, since when is that fact? What about MT5?
Of course I searched for an answer, but I could not find exact one. Here https://book.mql4.com/trading/ordersend everything is written as this issue never existed.
My question is: Is MT4 now able to deal with ECN brokers officially when EA is used, without the need to first open the trade with no stops, and then add them with OrderModify()?
Here is a screenshot. It's visible that it is "Market Execution" with disabled stops, but there is a trade created from the EA successfully with stops, no OrderModify() is used.
The situation with MT5 is even more strange. It says "Market Execution", but stops fields are not disabled, and again - the EA creates a position with stops attached to it, no need of OrderModify().
Yep, confirmed it works with my ECN broker (MT4 in demo). Used this script
Opened with SL and TP and the order closed when it hit the SL. Thanks for the headsup!
Terminal: Added ability to set Stop Loss and Take Profit levels in
market order placing dialog for symbols having Market and Exchange
I think you are mistaken . . .
https://www.mql5.com/en/docs/constants/structures/mqltraderequest the documentation disagrees
This is a trade order to open a position in the Market Execution mode. It requires to specify the following 5 fields:
Also it is possible to specify the "magic" and "comment" field values.
This is a trade order to open a position in the Exchange Execution mode. It requires to specify the following 5 fields:
No I am not mistaken, it's the documentation who is mistaken
I am currently reporting these errors to Service Desk, but I have to prove them they are wrong
From the same link:
32.MetaTester: Added permission for placing SL and TP from MQL5 applications in Exchange and Market Execution modes during testing and optimization.
For MT4 it's this one (https://www.mql5.com/en/forum/144834)
Terminal: Removed check for the absence of SL and TP when opening positions for trading symbols of Market Execution type when trading from MQL4 applications.
Confirmed. I'm so happy :)
In MQL4 I don't know. There is nothing found when seaching the documentation for "market execution", "instant" or "exchange".
I also wonder why there is no single word about this topic in documentation, because there was big attention when OrderSend() started to return error 130 and there was so many questions about this everywhere. But MetaQuotes normally don't listen to what is going on, they prefer to try harder to prove their MQL5 as a better language, which is... not really possible :)