Closing one (only) of multiple open trades when specific event occurs for that one trade
-
Hi all,
I'm very new to this and was hoping someone could help me with which blocks I should use to achieve the following:- I have no issues with how I get into my trades.
- My strategy means I might have multiple trades open on the same chart at any one time.
- If the moving average is 'equal to / or greater than' the open price of a trade, then close that trade only.
Any help would be much appreciated.
(please remember I'm a rooky with no coding experience but can think logically).Cheers

-
Is the trade to close the only trade above/below a moving average value?
-
Hi, yes I think that's what I'm after. If MA > 'trade entry price' then close that trade only.
I wonder if it should be something like the below?- With "for each trade' set from oldest to newest.
- and condition set to MA => Trade entry price (it this bit im really not sure about)
- close
So in my mind this would check each trade one by one and if the criteria is met, it would close only the trade that meets that criteria.
Am I close? or is there a better way?
Much appreciated

-
I should possibly mention that in my example sketched above they would be sell trades? (Whether that makes a difference I'm not sure)
-
Maybe?

-
Yes, that would do it, but above the loop you need a reason to start the loop, the condition needs to look at the in loop value. Add a shared link rather than pictures, block internals can then be looked at
-
@lew-sarten Quizas si compartieras un hilo del proyecto seria mas facil para los demas irte siguiendo y darte mas ideas
-
@lew-sarten Purple options should be connected below a purple block only to make it work correctly.