how is it possible that at one broker you can make deal with stop loss with one order,
and you cannot make that at other broker?
Is that a MT5 'feature'?
To clear up things, a little more explanation:
1) Same EA running on two different broker, both MT5 b7052) I tried both filling the structure and calling OrderSend and i tried using the CTrade class3) If i run the EA in debug mode on one broker, it opens a deal and places the SL after single OrderSend. The other broker doesnt.4) In strategy tester, SL is not put in neither case !!Edit!! -> incorrect. it works in strategy tester
So, first of all, it is iritating that you cannot put SL while opening a deal.
Second, how am i supposed to write EAs, if the behavior of methods is different at different brokers?
it looks like one of your brokers is ECN broker. They do not allow putting SL/TP along with the initial trade. You need to place order without SL and TP first. And then, you can modify existing position to add SL/TP.
I hope it helps.
it is so.
Is there a way that EA can recognize what type of a broker it is?
thanks for your kind reply. As they say, it is never too late to learn!
at that moment i was reading the documentation, it was not clear to me what the connection between TRADE_ACTION_DEAL and different execution types are.
IMO it would good if few extra lines explaining that would be included in documentation.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.