Use OrderModify if you want to change the takeprofit price or stoploss price.
bool OrderModify( int ticket, // ticket double price, // price double stoploss, // stop loss double takeprofit, // take profit datetime expiration, // expiration color arrow_color // color );
EDIT: since you're calculating your own takeprofit / stoploss, you must normalize the price before entering it as a parameter in OrderModify. You're already doing that with NormalizeDouble, but it's better to use a custom function.
Read #1 in this link: https://www.mql5.com/en/forum/137301#comment_3474196
- docs.mql4.com
Use OrderModify if you want to change the takeprofit price or stoploss price.
EDIT: since you're calculating your own takeprofit / stoploss, you must normalize the price before entering it as a parameter in OrderModify. You're already doing that with NormalizeDouble, but it's better to use a custom function.
Read #1 in this link: https://www.mql5.com/en/forum/137301#comment_3474196
thanks!
OrderClose(getFirstOpenTicketId(),OrderLots(),ClosePrice,Slippage,Red);
We should close at Bid or Ask, depending on the direction right? Or if you use OrderSelect() when closing your orders, can use OrderClosePrice().
- 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,
when use OrderClose, always close also if not reach specific price. So must close when reach -/+100 points depends of direction.
My code: