protected override void OnBarUpdate()
{
if (ChartBars != null)
{
DateTime now = DateTime.Now;
Print(now);
DateTime preOpen = new DateTime(now.Year, now.Month, now.Day, 18, 59, 0);
Print(preOpen);
int barNum = ChartBars.GetBarIdxByTime(ChartControl, preOpen);
Print(barNum);
}
}
And on 1 minute chart a get following results:
26.02.2019 23:31:21
26.02.2019 18:59:00
6416
this is bar number and simultaneously minutes from now.
But if we try to count 6416 minutes = ~107 hours! or 4,5 days!
And that number does not change during the time.
Comment