I'm trying to get values after High(low) is equal to currentHigh(low). I thought to use bool variable to set the condition. condition is true when High(low) is equal to currentHigh(low) and turn false when price from currentdaylow reaches generate a new CDH or when price from CDH generate a new CDL.
i tried the code below but after the first candle of the day close the iteration.I would like the indicator repeats the iteration for all day not just 1 time. could some good soul give some illuminations please?
{if(CurrentBar<1)
return;
// if (Time[0].TimeOfDay < new TimeSpan(9, 0, 0))
// return;
else if(CurrentBar>0)
low = false;
if(Low[0] == CurrentDayOHL1.CurrentLow[0])
{
low = true;
i=0;
while(true)
{ i++;
if(High[0]==CurrentDayOHL1.CurrentHigh[0])
Print(Close[0].ToString()+" HIGH "+Time[0].ToString());
break;
}
}
low = false;
if(High[0] == CurrentDayOHL1.CurrentHigh[0])
{
high = true;
j = 0;
while(true)
{
j++;
if(Low[0] == CurrentDayOHL1.CurrentLow[0])
Print(Close[0].ToString()+" LOW "+Time[0].ToString());
break;
}
}
high = false;
return;
}
}
Comment