Check help in MetaEditor - it's all there.
When you open order:
OrderSend(Symbol(), OP_BUYSTOP, Lots,
Ask+Point*BuyStop_Diff, Slippage, Ask+Point*BuyStop_Diff-BuyStop_SL*Point,
0, NULL, MyMagicNumber, c_time+60*Expiration, Red);[/CODE]
You should put your take profit instead of 0. Remember to check if it is higher than open price when you buy and lower when you sell.
When you modify existing order:
[CODE]OrderModify(OrderTicket(), OrderOpenPrice(), Bid-Point*TrailingStop, 0, 0);This 0 should be replaced with your new take profit if you want to change it or OrderTakeProfit() if you want to keep take profit as it is. But it should not be 0 - 0 means no take profit.
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, I have a EA (attached) which i want to add a take profit function to I have tried to add one myself but it either doesnt work or wont compile, i think it may be more complex than i think as i still want the other functions to work.
can anyone assist with this?
Regards
console