I'm trying to use CrossAbove() within the CountIf function.
This is the example from the help files for CountIf:
// If in the last 10 bars we have had 8 up bars then go long
if (CountIf(() => Close[0] > Open[0], 10) > 8)
EnterLong();
I'm trying to do this:
if (CountIf(() => CrossAbove(Close, SMA(20), 1), 10) > 2)
{
Value[0] = 1;
Draw.Text(this, "ClusterYes" + CurrentBar, @"inflectionPoint", 0, (Low[0] + (-50 * TickSize)) );
}
it compiles, but I don't get any results
Any reason you can point to?
thanks,
David
Comment