I'm printing some values from my indicator and I run into something I don't get:
In the code below, the Time print sometimes is not accurate, as it prints (in at least one occasion that I found) the time of the previous arrow that was actually removed by the script
I found that replacing " RebUpBarTime[a-1] " with " Time.GetValueAt(RebUpBar[a-1]) " gives me the right Time print, but I don't understand why is that?
if (i == Scan || ToTime(Time[0]) == endTime)
{
if (triggerUp)
Print (RebUpBarTime[a-1] + " | Rebound Up | " + RebUpBar[a-1] + " | " + upRange + " | " + upStop + " | " + (UpHeatRb.Count != 0 ? UpHeatRb.Min() : upLoss) + " | " + upLoss + " | " + i + " | " + c);
}
..............
if ((a == 0 ? true : CurrentBar != (RebUpBar[a-1] + 1)) && (Math.Min((Close[0] - Low[0]), (Open[0] - Low[0])) / (High[0] - Low[0])) * 100 >= WickPct
&& Low[0].ApproxCompare(MIN(Low, 5)[1]) < 0 && Close[0] > Low[1] + CloseOffset * TickSize)
{
RebUpBar.Add(CurrentBar);
RebUpBarTime.Add(Time[0]);
Draw.ArrowUp(this, "Rebound Up = " + RebUpBar[a], true, 0, Low[0] - 2 * TickSize, Brushes.Lime);
.............
a++;
}

Comment