Set all candle ID fields in all operands of all condition blocks to 1.
Remove the 'close trade' blocks from its current position and create a separate tree structure for them headed by a 'For each trade' block. Then link the closin condition blocks below them and finally link the 'close trade' blocks.