Hi dirk_r1 and thanks for answering my question.
I have been trying to use your sample, but so far nothing seems to work. I will attach first my strategy, in which I want it to open a buy or sell position depending on candle (whether is bearish or bullish). After that, I want to set current candle close (the one in which I just opened the position as TP or SL (depending on if it is a bearish or bullish candle).
Here is an image so you can see what seems to be the problem:
