Hi all.
I am trying to build a function where I set a STOP order's request details, then I check if another exists on same pair, if it doesn't I create it, if it does I want to edit the parameters.
I can create it, but it does not change the parameters when found.
Can it be done?
I tried using both OrderSend with both Trade Action pending, trade action deal, and also tried with m_trade.OrderModify and still doesn't working.
Can someone point me in the right direction?
EIDT: Found the error. The if(OrderSend) needs to be inside { } for the "else if" to be applied to the if(ContaPos)
There is a pretty good example in the documentation - copy that and adjust as needed
https://www.mql5.com/en/docs/constants/tradingconstants/enum_trade_request_actions#trade_action_modify
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all.
I am trying to build a function where I set a STOP order's request details, then I check if another exists on same pair, if it doesn't I create it, if it does I want to edit the parameters.
I can create it, but it does not change the parameters when found.
Can it be done?
I tried using both OrderSend with both Trade Action pending, trade action deal, and also tried with m_trade.OrderModify and still doesn't working.
Can someone point me in the right direction?
EIDT: Found the error. The if(OrderSend) needs to be inside { } for the "else if" to be applied to the if(ContaPos)