I wrote the following "for" loop in an indicator and if I set the loop limit to 5, the indicator will not output anything. If I set the loop limit to 4 then it will work.
limit = 5;
dHigh = High[0];
for (int i = 1; i<limit; i++)
{
if (High[i] > dHigh)
dHigh = High[i];
}
Why won't this loop work? I can't see any reason why this won't work.
Please advise....
Comment