Thanks for your reply.
That’s unfortunate that this is not working. The goal was that I wanted to have one setup once triggered lets the trade run as long as possible until stopped out with a predefined trailing stop loss. And a second setup that exits with a fixed profit target, and having both setups in one automated trading system.
However, it seems that the solution is only to have two separate trading systems. One with a trailing stop loss and the other with a fixed profit target. The annoying thing is that if I want to run this system on 8 currency pairs, then I have to have 16 systems instead.
I mentioned before that I had the impression that once a profit target is defined (like it is Setup 2 in the example code) it is applied to any open trade. How is that technically possible?
If only the conditions for Setup 1 are me (which has no profit target) and the conditions for Setup 2 are not met, how can the profit target be even triggered as it is only within the if-clause of Setup 2?