for each position loop not ending
-
IN MT5 I use for each position and I set n=1 but ea work nested loop always not end loop and don't doing yellow spot in for each position function
so if i don't add once per order it's will open pending sell nonstop
in picture you can understand easier

-
@hunters5882 If you put a shared link on here then what each block is doing can be checked, I would create a sell/buy tree with a no position block at top, the pink blocks I would have in a separate tree. for the pink blocks to work a trade/order needs to be running.
-
https://fxdreema.com/shared/R9gukbByc
@jstap this i cut only main function
and pending order i use for check loop error only, in real use it's end at modify variable
thank you for any help
-
@hunters5882 The trades are being placed by the blocks on the left.

-
you cant have pink blocks below blue blocks if i remember right. just remove the if position on the right side and relocate your modify variable thatll be a good place to start
-
i must admit though, i often have the same problem too when i try to use pink loop for each position. But I think the alternative is to do once per position, and then you can select "parent trade only" or something to that affect?
-
@tipsywisdom You can have blue blocks above pink, generally it is better not to but if being used as a switch you can.