If you leave NinjaTrader strategies running overnight, the strange thing is not that they stop: it's that they don't. In our lab, four different things left them idle without warning, and one duplicated them.
The four culprits we saw
1. Windows Update restarts even with "active hours"
We had active hours set to cover the night. Even so, Windows installed an update and restarted the PC at 3:29 AM. NinjaTrader stayed closed until someone opened it in the morning. Had there been an open position at that moment, it would have been left unmanaged.
2. A 13-second disconnection
A data feed disconnection of just 13 seconds stopped all our test strategies. The worst came after: in the next session, NinjaTrader re-enabled the original strategies when our watchdog had already recreated them, and they ended up duplicated. Two copies of the same strategy trading the same account is the fastest way to double your risk without noticing.
3. Flattening all positions disables the strategies
Many prop firm traders use a forced close at a set time so they don't hold positions overnight. When that close flattens an account, NinjaTrader disables the strategies on that account. The next day they don't start on their own.
4. Restarting NinjaTrader doesn't re-enable them
After closing and reopening NinjaTrader, the strategies that were running show up disabled until someone enables them again. If the restart happened at three in the morning, nobody does it until you wake up.
How we solved it
- Automatic start. A Windows scheduled task opens NinjaTrader at logon and signs in with a credential stored encrypted on the PC itself. If the login window asks for a captcha, it stops and alerts: it never tries to get around it.
- Automatic reconnection of the accounts as soon as NinjaTrader starts.
- A watchdog inside NinjaTrader that, after a restart or a disconnection, recreates and enables the strategies registered on simulation accounts, with brakes so it doesn't duplicate them. On live accounts it only alerts: a program re-enabling strategies with real money while you're not looking is more dangerous than leaving them stopped.
- Resolving duplicates automatically in simulation: one instance of each strategy is kept, and only copies that are flat with no working orders are removed.
Checklist before leaving bots running overnight
- Can the PC restart? If so, does NinjaTrader start and connect on its own? Test it by restarting it yourself one afternoon.
- What does each strategy do if the connection drops? Check its properties in NinjaTrader and decide whether it should keep going, recalculate or stop.
- How will you find out something has stopped? Without an alert (to your phone or by email), you'll find out late.
- Can a strategy end up duplicated? Check after every restart and every disconnection.
- Does your prop firm allow bots and overnight positions? APEX prohibits automation, and both APEX and Lucid require you to be flat at the end of each session (check their current rules in the rules table).
- Do you have a plan if everything fails with an open position? A stop order sitting on the broker's server protects you even if the PC shuts down (check it's not a locally simulated stop); a bot's "mental" stop doesn't.
Educational content based on our own experience. Not investment advice. Firm rules change: check them on each firm's website. This article contains no affiliate links.