You're submitting orders with a SL and TP of 0.0000, because the code logic is incorrect (or for some other reason).
In your case it does not look like a broker issue, or slippage (ala: https://www.mql5.com/en/forum/4480)
- www.mql5.com
If I were you I'll use CTrade Class to get broker comments. I have example and attachment here however it does not involving order modify :( .
BTW you should execute ...
ClearStructures(); the correct one is : zero memory operation. :)
... before running modify. There's example in Include\Trade\Trade.mqh under ...
bool CTrade::PositionModify(const string symbol,double sl,double tp)
Have fun.
:)
onewithzachy: i will try to implement this, ty
Just got one tip to put sleep for few seconds before order modify and it works somehow.
However the code need to be reworked, i think this is not way to do it with the time delay altought it is working.
Regards
John
glad it helped you, ive found this issue with delay if i was modifying mt4 ea for ecn, but like you said, mt4 doesnt really need delay between modify..
im just wondering if it is safe enough to go live with this modify lately, just thinking about retry for modify if modify fails - for safe..
i will look on it when i have more time, however im not coder so i will check your codes for inspiration
Regards
John

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use