I've played around with the "Count" function but can't figure it out and I can't find any examples in the forum. It seems simple but I'm self taught in C# and haven't had to do anything like this in the past. My guess is I would set a variable and do a count of the number of times the conditions were true between the first instance of a color and the first instance of the next color. I just don't know the methods to use and where to start.
Below I've included the basic logic of where I'm starting. Thanks in advance for any help!
if (
(BKADS1 > BKADS1_1
||BKADS1 > MRange)
&&(BKADS2 > BKADS2_1
||BKADS2 > LRange)
&&BKADS1 > -MRange
&&BKADS2 > -LRange
&&BKADS3_20 > BKADS3_21
&&BKADS3_30 > BKADS3_31
&&BKADS3_40 > BKADS3_41
&&BKADS3_50 > BKADS3_51
&&(
BKADS3_20 > BKADS3_21
&&BKADS3_21 < BKADS3_22
||BKADS3_30 > BKADS3_31
&&BKADS3_31 < BKADS3_32
||BKADS3_40 > BKADS3_41
&&BKADS3_41 < BKADS3_42
||BKADS3_50 > BKADS3_51
&&BKADS3_51 < BKADS3_52
)
)
{
Draw.Dot(this,"Updot1"+CurrentBar,true,0,Close[0],Brushes.Blue);
}
else if (
(BKADS1 < BKADS1_1
||BKADS1 < -MRange)
&&(BKADS2 < BKADS2_1
||BKADS2 < -LRange)
&&BKADS1 < MRange
&&BKADS2 < LRange
&&BKADS3_20 < BKADS3_21
&&BKADS3_30 < BKADS3_31
&&BKADS3_40 < BKADS3_41
&&BKADS3_50 < BKADS3_51
&&(
BKADS3_20 < BKADS3_21
&&BKADS3_21 > BKADS3_22
||BKADS3_30 < BKADS3_31
&&BKADS3_31 > BKADS3_32
||BKADS3_40 < BKADS3_41
&&BKADS3_41 > BKADS3_42
||BKADS3_50 < BKADS3_51
&&BKADS3_51 > BKADS3_52
)
)
{
Draw.Dot(this,"Downdot1"+CurrentBar,true,0,Close[0],Brushes.Orange);
}

Comment