Trading Day Bar Datenum


How can I obtain the next trading bar datenum that hasn't happened yet?

I tried these, but it is not giving the correct date.

bi = BarIndex();
dn = DateNum();

futbar = Ref(bi, 1);
futbardn = ValueWhen(futbar, dn);

futbar1 = LastValue(bi)+1;
futbardn1 = ValueWhen(futbar1, dn);

I can not simply add date because this weekened end with 2021-04-30, if I add 1 day, it becomes 2021-05-01, but the next trading day is 2021-05-03.

Thanks in advance.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.