-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor -
for(int i=1; i>=OrdersTotal(); i++) // Loop through orders
Infinite loop. - Give your order a take profit, and it will close itself.
-
if (Bid>=Openprice+Tp*Point); bool Ans=OrderClose(Ticket,Lot,Bid,2);
The if statement does nothing; the close is always called. - Both assume a buy order.
Is there any way to close order when price reaches to certain level. i don't want to mention take profit in the Ordersend.
Your question has already been answered. Fix your broken code.
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
Need to close order when price reaches to certain level. its simple but I couldn't make it. I am a newbie, appreciate your help.
example below.
double Ticket, Openprice, Lot, Tp=150;