[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Calculating Last Intraday bar



PureBytes Links

Trading Reference Links

> This is somewhat helpful, but the problem is that Session1endTime is
> constant. It doesn't account for shortened days (half sessions) or
> when session ending times change (as did after 9/11 for KC, NG, and
> CL). 

The only way to handle that is to refer to the next bar, e.g.:

  if Date of next bar > Date then ((this is today's last bar));

This limits the things you can do in your system, because TS 
wants to protect you from doing foolish/impossible things in your 
backtest.

And, obviously, it won't work in realtime!
Gary