The Last, High, Low, Close come from the "Chart" - that is, current chart. Not from current-chart-up-to-the-candle-being-processed...
Prev Close, Prev Open etc. also come from the chart but they obviously don't change as new data gets added.
If you wanted to use High/Low for current timestamp, you'd keep track of it yourself. It is easy enough, you just have to define the DayHigh/DayLow and DayNum outside the function, zero it out when the DayNum is not equal to TradingDay.DayNumber, adjust the DayHigh and DayLow to the new candle's high and low, and set the DayNum to TradingDay.DayNumber.
.fctbNone{ color:#000000; }
.fctbStyle5{ color:#0000ff; }
.fctbStyle7{ color:#000000; }double DayHigh = 0;
double DayLow = 0;
int DayNum = -1;
public void MainCalculation()
{
if (DayNum != TradingDay.DayNumber)
{
DayNum = TradingDay.DayNumber;
DayHigh = High; DayLow = Low;
}
DayHigh = Math.Max(DayHigh, High);
DayLow = Math.Max(DayLow, Low);
}
If you want to restrict it to only regular session, you'd have to also condition it on other TradingDay. properties. Like TradingDay.IsPreMarket or something.