Bucket of trades/ setting global SL for opened trades
-
Hey!
I have one problem that I can not solve. The idea of my EA is to set mutual SL for opened trades if the ammount of trades is equal or larger than 3. I wanted to take SL value from bucket of trades (average open price - then it is BE for 3 open trades in equal fraction).
The main problem is that EA change SL for only the oldest trade. Do you have some ideas?
Custom TP changes to each opened trade. So the list of changes seems like this:
Trade 1. SL: SL taken from bucket of list, TP: value I provided
2. SL:0. TP: value I provided
3. SL:0. TP: value I provided
4. SL:0. TP: value I provided
.
.
.
Kind regards, TOMHere is my project shared/15JDHi92d
And here is screen from the platform:

The
-
This "modify stops" block is specific, you can see that it is pink color, similar to "For each Trade", which means that these blocks work together. "For each Trade" would cause "modify stops" to run 3 times in a row (for each trade that exists).
After that "Bucket of Trades" runs "modify stops" again, but this is not right in the case.
Try this - put "Bucket of Trades" above "For each Trade". I didn't tried it, but I think this is how it will work.
-
It still doesn't work and change SL only for the oldest trade. Do you have some other idea how can I solve it?