COVER signals differentiation

Hello guys,
I have a problem with backtesting, and to be more specific, with defining a cover signal.

Case is, that I would like to differentiate cover signal depending on how many candles last from short signal. If C > O in the same day when th short been opened, I want to cover. But if there is 1 or more candles since the short, the cover signal is C of the day mut be bigger then C of the day before.

Here is the code: but apparently it does not work, and I am wondering if I can use IIF here.

Short = Ref(BVG, -1);

Cover = IIf(BarsSince(Short)==0, C > O , C > O AND C > Ref(C , 1) );

Wondering if you could halp me with that?

Thanks in advance.

Regards
Jakub

I can see a mistake: The day before is expressed as:

Ref(C, -1)

You need to put the minus sign ...

Regards

tried that before, but it still does not work correctly.

You are not giving enough information to make other suggestions:

You can also see:

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.