I have a strategy that I'm migrating over from NT7 that works. I use the CountIf function 3 times in the code, when I take these instances out, I have no issues. Is there something wrong with the function call? I've included the code and the error response below.
Thanks!
int countCross3 = CountIf(() => CrossAbove(Close, EMA(44),1),55);
int countCross4 = CountIf(() => CrossAbove(Close, EMA(44),1),55);
CountIf(() => Close[0]-Low[0] >= .75, 8) >=4
Strategy 'MomentumUpTrade': Error on calling 'OnBarUpdate' method on bar 50: condition
Parameter name: 'CountIf' on bar 0 threw exception: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Comment