Is there a more efficient method of coding conditions 1 and 2?
And how would you paint only the current bar and reset previous bars to standard colors?
I would appreciate any assistance.
Thanks.
Bruno
Code: Select all
Condition1 = High > High[1] and High > High[2] and High > High[3] and High > High[4]
and High > High[5] and High > High[6] and High > High[7] and High > High[8]
and High > High[9] and High > High[10] and High > High[11] and High > High[12]
and High > High[13] and High > High[14] and High > High[15] and High > High[16]
and High > High[17] and High > High[18] and High > High[19] and High > High[20];
Condition2 = Low < Low[1] and Low < Low[2] and Low < Low[3] and Low < Low[4]
and Low < Low[5] and Low < Low[6] and Low < Low[7] and Low < Low[8]
and Low < Low[9] and Low < Low[10] and Low < Low[11] and Low < Low[12]
and Low < Low[13] and Low < Low[14] and Low < Low[15] and Low < Low[16]
and Low < Low[17] and Low < Low[18] and Low < Low[19]
and Low < Low[20];
If Condition1 then
BEGIN
PlotPaintBar(High,Low,Open,Close,"",blue);
END
else
If Condition2 then
BEGIN
PlotPaintBar(High,Low,Open,Close,"",red);
END