NinjaTrader 8 slow or with frozen candles: why it happens, what it costs you and how to fix it
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 access | Several 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 transaction | Feed drops, reconnections, forced closes |
| Backup during an active transaction | Tools that copy the folder with NinjaTrader open |
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 candles stay still even though the price in the DOM does move.
- Opening a chart or switching instrument takes far longer than before.
- NinjaTrader consumes more and more memory and runs in fits and starts.
- Unexpected closes, especially at startup or when loading data.
The causal chain: from the file to the loss
The damage follows a mechanical, reproducible sequence:
| # | Link | What happens |
|---|---|---|
| 1 | Corrupt or huge DB | Data errors (duplicate IDs) or a damaged file; slow reads |
| 2 | The platform reloads the DB on the UI thread | When the feed reconnects, the chart tries to reload the executions from the DB |
| 3 | Freeze | The UI thread blocks; the candles stop, trading keeps running on another thread |
| 4 | Damaged execution | Late, duplicated or impossible orders; unmanaged position |
| 5 | Financial loss | Slippage, 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.
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].
How it translates into your P&L
| Damage | Effect on your account |
|---|---|
| Slippage from a freeze | Worse entry/exit price on each affected trade |
| Trapped position | Loss on the adverse side while you can't close |
| Duplicate / ghost orders | Unwanted exposure, reversed position |
| Corrupt historical data | Miscalculated backtests and statistics → wrong decisions |
| Erroneous records | Disputes with prop firms, tax/accounting errors |
Manual fixes (and why they aren't enough)
- Reduce the history you keep (fewer days of data by hand).
- Back up your NinjaTrader folder before touching anything.
- Compact or rebuild the database following the official documentation[5].
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:
- Detects corruption and bloat continuously.
- Backs up with a verified copy before acting.
- Repairs when needed and waits for the market to close so it doesn't disturb your trading.
- Leaves a signed audit report of every intervention.
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.
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
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
- SQLite. How To Corrupt An SQLite Database File. sqlite.org/howtocorrupt.html
- Moallemi, C. C., & Saglam, M. (2013). The Cost of Latency in High-Frequency Trading. Operations Research, 61(5).
- Retail trader sophistication and stock market quality: Evidence from brokerage outages. Journal of Financial Economics (2022).
- NinjaTrader Support Forum. Issue with Order Flow Market Depth Map Freezing Platform — significant loss incurred.
- NinjaTrader Help Guide. Operations > Database Operations (Reset DB / Repair DB).