Guides Updated
StopWarden is not open yet. This guide is general information about NinjaTrader 8 and does not depend on StopWarden. Get one email when it opens.
How to run a NinjaTrader strategy overnight safely: a checklist
Short answer: most unattended losses do not come from the strategy's logic. They come from the machine around it: a restart, a dropped connection, a stop that was never working at the broker, an order left over from yesterday. This checklist covers those. Work through it once in full, then use the short version every night.
Nothing here makes an unattended strategy safe. It lowers the number of ways it can go wrong while you are away.
1. The machine
- ☐ Windows restarts. Set Windows Update active hours around your trading hours, and check that no update is pending before you leave. A forced restart closes NinjaTrader with whatever is open.
- ☐ Sleep and power. The PC must never sleep or hibernate while a strategy runs. A laptop should be plugged in.
- ☐ Power cuts. A small UPS keeps a desktop running through a short outage.
- ☐ Or host it. A Windows VPS in a data center removes home power and internet from the list, but it is still a Windows machine that needs the same settings.
- ☐ One trading session per machine. Heavy charting on the same NinjaTrader instance can slow it down; many traders keep the trading instance lean.
2. The connection
- ☐ Wired, not Wi-Fi, on a home PC.
- ☐ On connection loss set on purpose: Control Center > Tools > Settings > Strategies > On connection loss (Options in older builds). Know whether you chose Keep running, Recalculate or Stop strategy, and what the Disconnect delay seconds value is. [1] Details in what happens when the internet disconnects.
- ☐ Your broker's trade desk number saved on your phone, so you can have a position flattened if your platform is down.
3. The strategy settings
- ☐ Cancel entry orders / Cancel exit orders when a strategy is disabled: decided on purpose before you add the strategy row (the row keeps the values it was added with), with a plan for an open position at disable time. [1] See the settings guide.
- ☐ Start behavior understood. NinjaTrader's help guide says the default, Wait until flat, "assumes your Account Position is in a flat state" and, when the strategy starts, "will check for any active orders previously generated by the strategy on your account and cancel those first". [2] That means an old stop can be cancelled at a restart: after an overnight restart with a position open, check that the position still has a working stop.
- ☐ Error handling at the default
StopCancelCloseunless your code handles rejected orders itself. [3] - ☐ Exit on session close checked against your plan. It is on by default and exits 30 seconds before the session end in the strategy's Trading Hours template. [4][5] If you mean to hold through a session break, know exactly which template the strategy uses.
- ☐ Your prop firm's rules for automation, monitoring and end-of-day flat times, read today. See prop firm rules for unattended strategies.
4. The stops
- ☐ Stops work at the broker. In the Orders tab a stop should show Working or Accepted; TriggerPending means it is held on your PC. [6]
- ☐ No simulated stops for unattended trading: they are held on your PC and "subject to issues such as loss of internet connection and computer crashes". [7]
- ☐ The stop is sent from the fill, not from the next bar close, and
SetStopLoss()is called before the entry. [8] See why a position ends up without a stop loss.
5. Before you leave
- ☐ Positions tab: the account is flat, or holds exactly what you expect.
- ☐ Orders tab: no orders you cannot explain.
- ☐ Strategies tab: one instance per strategy and account, enabled, on the right account and contract.
- ☐ Your alerts reach you where you will be tonight: send yourself a test.
6. The morning check
- ☐ Log tab: connection lost or restored, rejected orders, strategies disabled.
- ☐ Positions and Orders tabs match your broker's own web platform.
- ☐ Anything you do not understand gets answered before the strategy trades again.
Test it before you trust it
On a simulation account, run the strategy through a full session and deliberately break things: disable it with a position open, restart NinjaTrader mid-trade, pull the network cable for 30 seconds. Write down what happens to the position and the orders each time. That list is your real risk sheet.
Sources
- NinjaTrader 8 help guide, Settings > Strategies
- NinjaTrader 8 help guide, Syncing Account Positions (Start behavior)
- NinjaTrader 8 help guide, RealtimeErrorHandling
- NinjaTrader 8 help guide, IsExitOnSessionCloseStrategy
- NinjaTrader 8 help guide, ExitOnSessionCloseSeconds
- NinjaTrader 8 help guide, Where do your orders reside?
- NinjaTrader 8 help guide, Simulated Stop Orders
- NinjaTrader 8 help guide, SetStopLoss()
General information about NinjaTrader 8 settings, checked against NinjaTrader’s help guide on the date above. Not financial advice. NinjaTrader changes between versions; confirm each setting on your own install.