I'm trying to code an indicator which checks all 11 previous bars for every new bar printed to see whether the condition is true. Unfortunately, I'm not getting the desired result. My code is as follows:-
if(CurrentBar < 13) return;
if(Close[1] < Close[5])
{
for( int x = 1; x <= 11; x++)
{
if( Close[0] > High[x])
{
Draw.TriangleUp(this,"lvup"+CurrentBar, true, 0, (Low[0]-SMA(Range(),9)[0]*0.15), Brushes.Green);
}
}
}
Could you please point me in the right direction?
Regards
Kay Wai

Comment