Blog › NinjaTrader maintenance
NinjaTrader 8 · Performance and risk

NinjaTrader 8 slow or with frozen candles: why it happens, what it costs you and how to fix it

By Trading Strategy Designer · 8 min read · Technical research with cited sources

If your NinjaTrader 8 has become slow, the candles stop updating mid-market or the platform closes on its own, the problem most likely isn't your connection or your computer: it's in NinjaTrader's internal database. And it's not a technical annoyance — it's a measurable financial risk.

In this guide we explain, with official documentation and peer-reviewed studies, why it happens, what it really costs you, what you can do yourself and how to stop it from happening again.

What NinjaTrader's database is and why it degrades

NinjaTrader 8 stores your orders, executions, positions and price history in a local SQLite database (the Documents\NinjaTrader 8\db folder). SQLite is reliable across billions of deployments, but its own documentation lists the exact conditions that corrupt it[1] — and several are common in an intensive trading environment.

Why NinjaTrader 8 is especially vulnerable

Condition (official SQLite)Present in real trading
Faulty file locking / concurrent accessSeveral instances or accounts share the same files at once
fsync failure (the disk “lies” about the write)High order volume: thousands of writes per session
Shutdown or crash in the middle of a transactionFeed drops, reconnections, forced closes
Backup during an active transactionTools that copy the folder with NinjaTrader open
SQLite's own guide warns that the higher the write volume, the greater the dependence on fsync() working correctly — exactly the profile of a multi-account copier that issues thousands of orders a day.

Symptoms: how to know if it's your database

The causal chain: from the file to the loss

The damage follows a mechanical, reproducible sequence:

#LinkWhat happens
1Corrupt or huge DBData errors (duplicate IDs) or a damaged file; slow reads
2The platform reloads the DB on the UI threadWhen the feed reconnects, the chart tries to reload the executions from the DB
3FreezeThe UI thread blocks; the candles stop, trading keeps running on another thread
4Damaged executionLate, duplicated or impossible orders; unmanaged position
5Financial lossSlippage, trapped position, risk without a stop

It's not a technical annoyance: it's measurable financial risk

A freeze is, at its core, extreme latency. And latency has a cost quantified by the academic literature.

Cost of the delay
≈14%
of the cost of immediacy was contributed by 500 ms of latency; it tripled from 5% in 1995[2]
Grows with
σ ↑
the asset's volatility: the more the price moves, the more expensive every millisecond lost becomes

If 500 ms already represent a substantial cost, a freeze of seconds or minutes turns that cost into a first-order loss. And it happens exactly when the market is most volatile — which is when the feed drops and the DB is stressed.

A Journal of Financial Economics study (2022) on brokerage outages further documents that, when your platform locks you out, you lose control of your risk at the worst moment; it's not an anecdote, it's an effect measured at market scale[3].

A real case, already documented by NinjaTrader[4]: a trader tried to close a position at a critical technical level; the platform froze and they couldn't get out. On recovery, the sell orders they had pressed repeatedly during the lock-up executed multiple times. Declared result: significant losses.

How it translates into your P&L

DamageEffect on your account
Slippage from a freezeWorse entry/exit price on each affected trade
Trapped positionLoss on the adverse side while you can't close
Duplicate / ghost ordersUnwanted exposure, reversed position
Corrupt historical dataMiscalculated backtests and statistics → wrong decisions
Erroneous recordsDisputes with prop firms, tax/accounting errors
Honesty: the underlying failure belongs to the platform (it reloads its database on the UI thread). The trader doesn't cause it; they suffer it. That's why the right defense is preventive and automatic, not relying on the user “learning to restart”.

Manual fixes (and why they aren't enough)

The problem is that this is manual, occasional and risky: you have to remember, choose the moment (market closed), and one wrong step can leave you without history. Most people only react once something has already broken.

The way to stop it happening again: automate the maintenance

Instead of putting out fires, the sustainable solution is for maintenance to happen on its own, in the background and at the right moment. That's why we created TSD DB Guardian, a program external to NinjaTrader that takes care of its database's health without you having to do anything:

It works on a schedule (weekly, every 15 or every 30 days) and includes a panic button to launch maintenance instantly. It's Windows software that lives alongside NinjaTrader 8; it's not an add-on that loads inside the platform.

Honesty: DB Guardian reduces freezes and keeps the database healthy, but it doesn't replace your own backups nor guarantee trading results. It's a maintenance and protection tool.

Stop fighting with NinjaTrader's database

Try TSD DB Guardian free for 14 days, with every feature and no card.

See TSD DB Guardian Try free for 14 days
Health check of NinjaTrader's candlestick chart with TSD DB Guardian
TSD DB Guardian watches the health of NinjaTrader's database in the background.

Frequently asked questions

Will I lose my data history when repairing the database?

No, if it's done with a prior backup. DB Guardian always backs up before acting; if you do it manually, make the copy yourself first.

Do I have to stop trading to do the maintenance?

No. DB Guardian waits for the market to close and works in the background. Manual maintenance, though, is best done with the platform closed.

Is this a NinjaTrader indicator?

No. It's a standalone Windows program that lives alongside NinjaTrader 8 and takes care of its database from the outside.

Why does it freeze right in the moments of most movement?

Because volatility brings more orders, more writes and more feed reconnections — the exact conditions that stress the SQLite database and trigger the reload on the UI thread.

References

  1. SQLite. How To Corrupt An SQLite Database File. sqlite.org/howtocorrupt.html
  2. Moallemi, C. C., & Saglam, M. (2013). The Cost of Latency in High-Frequency Trading. Operations Research, 61(5).
  3. Retail trader sophistication and stock market quality: Evidence from brokerage outages. Journal of Financial Economics (2022).
  4. NinjaTrader Support Forum. Issue with Order Flow Market Depth Map Freezing Platform — significant loss incurred.
  5. NinjaTrader Help Guide. Operations > Database Operations (Reset DB / Repair DB).

← Back to the blog