OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),takeprofit,0,Red);

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am testing various aspects of my EA. What I would like to achieve is:
1. Set a fixed Stop Loss without setting a Take Profit level when I open a trade position, i.e:
Result=OrderSend(Symbol(),OP_BUY,Lots,Ask,slippage,stoploss,0,"",MAGICNUMBER,0,Red);
This part works well in my code.
2. For the open position, I would like the Stop Loss to remain constant (i.e. same value as when order was opened),
but vary takeprofit (i.e. have a trailing takeprofit or so to speak). I have tried using OrderModify() for this:
OrderModify(OrderTicket(),OrderOpenPrice(),NULL,takeprofit,0,Red);
Although it allows me to modify the takeprofit as I wish, IT ALSO MODIFIES THE ORIGINAL SL THAT I WANT TO KEEP.
Can anyoune help me resolve this issue?
Thanx in advance.