Stop thinking about loops. There is no loop. You must return after the first order is opened.
When the first order is closed, then, worry about the second. etc.![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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 one part of the expert i'm working on has this loop that i have problem making it
the loop goes like this : it opens 10 orders and when all the ten orders are opened it terminates
conditions:1- before the loop begins to work the expert opens a buy order if that buy order hits tp the first order of the loop is a buy if it hits sl the first order of the loop is a sell
2-if the first order of the loop hits tp it opens the second order of the loop with the same order type but if it hits sl the loop goes to the top and opens the first order with the opposite order type .
for example if the first order is a buy and all the begining five orders hit tp but the 6 th order hits sl the loop goes to the top and opens the first sell order.
im a little confused about how to make this loop i would be glad if you could help me