For Each Trade / Check Trade Counts problem
-
Good evening, I would like to solve the following problem. How can you "order" the execution of these blocks?
Let me explain better: After opening a trade (buy or sell), in the event of a loss I would like the bot to open other trades in the same direction with distances that can be configured via constant but which are calculated each time from the price of the last open trade. The problem is that I have noticed that these chains can "work" even several times if the price returns to the same distance as "no trade nearby", there is no real order. I tried to solve via the "check trades count" block but it doesn't work, it isn't respected.
The idea was to read the number of open trades to make ONLY that chain work, example check open trades = 2 -> ONLY the second chain is activated which opens a trade at a distance of X pips (written in the constant) FROM THE LAST open trade on the specific graph.
Or open check trades = 3 -> ONLY the third chain is activated which opens a trade at a distance of Y pips (always decided via constant) FROM THE LAST trade opened on the specific chart.
I would like it to work like this:
Conditions OK -> I open buy or sell
I have 3 or more constants (30/70/120 etc pips, it's just an example)
When the open trade reaches a negative 30 pips (first constant) another trade will open in the same direction. If this last trade goes negative by 70 pips (second constant) another trade will open in the same direction. And if this last trade also goes negative by 120 pips (always set in the constant) a further trade will open in the same direction...I hope you can help me, thanks

-
I'm trying this way, for each new trade (starting from the first) the variable for the size and entry price is assigned. At this point using "If trade" I check that there is an open buy trade (also valid for the sell), then I filter the number of trades using "check trade count" so as to use a specific chain (with a trade opening distance via formula) rather than another. The condition ensures that the current price is lower for the buy or higher for the sell than the price of the last open trade (variable). Since there are no pink blocks but only blue blocks they should work fine...

-
If anyone has any suggestions please write them
-
You need to use groups. Each new distance should open a new trade belonging to a different group. That way you can control different opening distances for each group.
-
@l-andorrà It may be a good solution, but it wouldn't make sense. What else are the "Check trades count" blocks for? To filter the open trades...so if I set Check trade count = 3 to a chain and check trade 4, check 5 etc to the subsequent chains, based on the number of trades opened on a specific chart only one chain MUST work, not the others...
-
i would do it like this

-
@Crisfx Then you should use a 'For each trade' block selecting how many trades should be skipped per segment instead.