suikka:
Of course, OrderModify() is needing a price for SL and TP, not a pip/point value (25).
Hi
Im coding EA and I want it to have feature to set SL to BE if x% of TP is reached. This is what I have so far.
EDIT: BE is global variable and it is 0.7.
Problem is in this line:
I tried to set SL to 25 point over/under OrderOpenPrice (I think this means open price of the trade?).
Now this code just removes SL and is not able to set up the new SL value.
Can someone help me with this one.. Thank you.
Alain Verleyen:
Of course, OrderModify() is waiting a price for SL and TP, not a pip/point value (25).
Thank you Alain for the fast reply.. What is the best way to add 25 pips to OrderOpenPrice ?Of course, OrderModify() is waiting a price for SL and TP, not a pip/point value (25).
Can I do it something like this ?
bool res=OrderModify(OrderTicket(),OrderOpenPrice(), OrderOpenPrice() + OrderCommission() + OrderSwap(),0 ,clrBlue);
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
Hi
Im coding EA and I want it to have feature to set SL to BE if x% of TP is reached. This is what I have so far.
EDIT: BE is global variable and it is 0.7.
Problem is in this line:
I tried to set SL to 25 point over/under OrderOpenPrice (I think this means open price of the trade?).
Now this code just removes SL and is not able to set up the new SL value.
Can someone help me with this one.. Thank you.