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) );