Print("Next Trend before if" + NextTrend[0]);
if (NextTrend[0] == 0)
{
HighMin = Math.Min(HighMin, HighestHigh);
if (Close[0] > High[1])
{
Print("Next Trend before" + NextTrend[0]);
Trend[0] = 0;
//the Nextrend[0] is reset to zero for somereason on next barupdate
NextTrend[0] = 1;
Print("Next Trend after" + NextTrend[0]);
LowMax = LowestLow;
}
}
In the beginning of BarUpdate NextTrend[0] is "0" which is good and it goes inside the if condition and NextTrend[0] is assigned "1", however in the next barupdate call, NextTrend[0] is reset to "0". i confirmed it with print statetments as above..
This line is always zero "Print("Next Trend before if" + NextTrend[0]);"
Thanks for the help in advance

Comment