If BOP(14) is below zero for at least 11 of the past 13 bars
&&
If SMA(14) crosses below SMA(50)
then Enter Short
Seems like we can't really use the BOP indicator within a CountIf statement because it produces compile errors. So we have to make a DataSeries before we can use BOP in the statement.
1] Declare a DataSeries for BOP by doing something like this . . .
BPower.set = BOP(14)
2] Then use the created DataSeries (BPower) in the statement like this . . .
if (CountIf(delegate {return BPower[0] < 0;}, 13) => 11
3] The next step is to add another "if" statement to look for the SMA cross over. That I can do.
4] Finally, use the command to "Enter Short", which I can also do.
Not sure if my problems are syntax related or if I'm just approaching this from the wrong angle. But from all I've read it seems like I'm heading down the right path, just can't get what I need.

Comment