Hi there!
When tested in Strategy Analyzer, the second series stops to update. Bellow is the Output result:
Interval: 2026-01-01 - 2026-01-30
Primary BarsInProgress: 0 at 2026-01-02 1:05:00 (1Second bar: 2026-01-02 1:05:00)
Primary BarsInProgress: 0 at 2026-01-02 1:10:00 (1Second bar: 2026-01-02 1:09:59)
Primary BarsInProgress: 0 at 2026-01-02 1:15:00 (1Second bar: 2026-01-02 1:15:00)
…
Primary BarsInProgress: 0 at 2026-01-15 23:50:00 (1Second bar: 2026-01-15 23:50:00)
Primary BarsInProgress: 0 at 2026-01-15 23:55:00 (1Second bar: 2026-01-15 23:55:00) Primary BarsInProgress: 0 at 2026-01-16 0:00:00 (1Second bar: 2026-01-15 23:59:59) Primary BarsInProgress: 0 at 2026-01-16 1:05:00 (1Second bar: 2026-01-15 23:59:59) Primary BarsInProgress: 0 at 2026-01-16 1:10:00 (1Second bar: 2026-01-15 23:59:59) Primary BarsInProgress: 0 at 2026-01-16 1:15:00 (1Second bar: 2026-01-15 23:59:59) … Primary BarsInProgress: 0 at 2026-01-29 23:50:00 (1Second bar: 2026-01-15 23:59:59) Primary BarsInProgress: 0 at 2026-01-29 23:55:00 (1Second bar: 2026-01-15 23:59:59)
The code sample is very simple:
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 1 || CurrentBars[1] < 1)
{
return;
}
if (BarsInProgress != 0)
{
return;
}
Print($"Primary BarsInProgress: {BarsInProgress} at {Time[0]} (1Second bar: {Times[1][0]})");
}
NinjaTrader is impeccable when it comes to good manners, he does not want to tell the user that the user is so stupid that they are trying to run historical data that they have not downloaded, so it usually just does nothing.
Seems to me that is probably the case here, your 1 second series data is not downloaded beyond 15th Jan.
There are only 3 ‘types’ of data (real-time or historical).
The 3 types are Tick, Minute, and Day data.
(See ‘NinjaTrader 8\db’ folder.)
Any Bar series based on Seconds is built using Tick data.
Therefore, you may need to download more Tick data to satisfy your 1-Second bar. Really? Yes, but it depends. Normally, the Strategy Analyzer knows to automatically download all data for the backtest date range before running the backtest, but there are limitations:
You must be connected to an account with a Historical Data Server, otherwise NT cannot connect to the HDS and download any historical data.
Any historical data needed by any secondary data series will not be downloaded. That is, the SA doesn’t know about your calls to AddDataSeries and does not know to pre-download any needed historical data to make them work.
In effect, the SA only knows to download historical data for the primary data series for the date range specified, and that happens only if you are connected. The user is responsible for making sure all the historical data needed by any secondary data series is already available.
Actually the only role of the 2nd series is to take the ~ real-time DateTime of the market. I couldn’t find any other way as on SA the OnMarketData is called only on Tick Replay which is very very slow and I don’t want that. I’m not interested in the exact time.
Testing strategies on weekends may conflict with server maintenance, meaning you may not be able to connect to your account to have SA automatically perform any necessary historical data downloads.
What to do?
Best practice is to use Tools → Historical Data → Download and manually download everything you might need after market close on a Friday.