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.
What happens to a NinjaTrader strategy if your internet disconnects
Short answer: it depends on three things: where each of your orders lives (at the broker or on your PC), what the strategy's On connection loss setting says, and how long the outage lasts. Orders already working at the broker keep working while you are offline. Anything NinjaTrader computes on your PC stops until the connection and data come back.
1. Orders at the broker keep working. Orders on your PC do not.
NinjaTrader's help guide splits orders by state. Orders in the "Accepted" or "Working" state reside at the brokerage, exchange or provider servers. Orders in "TriggerPending" or "Initialized" are typically held locally on your PC. [1]
What that means during an outage:
- A plain stop order that was Working before the drop is still at the broker and can still fill.
- A simulated stop is "held and simulated locally on your PC" and is subject to "loss of internet connection and computer crashes". [2] While you are offline it cannot trigger.
- "MIT orders and Simulated Orders, which are in TriggerPending state, could not be recovered by NinjaTrader, if the provider does not provide native support." [1]
- OCO links. For the NinjaTrader connection the help guide says "Most OCO (One Cancels Other) functionality is simulated on your local PC", and for Rithmic that OCO functionality is simulated on your local PC. [1] So if your stop fills while you are offline, cancelling the matching target may depend on your PC reconnecting. Until then the target can still be working with no position behind it.
- Moving a stop (a trailing stop, a breakeven move, your code changing the price) is an order change that has to travel over the connection. While you are disconnected the stop stays where it last was.
2. What the strategy itself does: On connection loss
The setting lives in Control Center > Tools > Settings > Strategies (called Options in older 8.x builds), under On connection loss. [3][4]
| Setting | What NinjaTrader's help guide says |
|---|---|
| Handling: Keep running | Keeps the strategy running; when the connection is re-established it resumes as if no disconnect occurred. |
| Handling: Recalculate | Attempts to recalculate the strategy position when the connection is re-established. Recalculation only happens if the strategy was stopped by the disconnect. |
| Handling: Stop strategy | Stops the strategy when disconnected for longer than the delay; no action is taken on reconnect. |
| Disconnect delay seconds | How long a disconnect must last before the handling acts. The NinjaScript default is 10 seconds. |
| Number of restart attempts / Restarts within x minutes | How many times NinjaTrader tries to restart a strategy within that window. |
In code, the same choice is the ConnectionLossHandling property; its default is Recalculate. [5][6]
Things to know:
- Stop strategy plus Cancel exit orders when a strategy is disabled can cancel your stop once the connection is back, while your position is still open. See the cancel-on-disable guide.
- Keep running means the strategy acts on whatever it sees when data returns. If a fill happened while you were offline, check that the strategy's position and the account's position still agree.
- A setting that reacts to disconnect events may not react to a data feed that goes quiet while the connection still shows as connected.
3. What to check when you reconnect
- Positions tab: is the account position what you expect? [7]
- Orders tab: is there a working stop for the full quantity? Are there leftover orders with no position behind them? [8]
- Strategies tab: is the strategy still enabled, and does its position match the account?
- Log tab: look for connection lost and restored lines, rejected orders and strategy disabled messages.
- If NinjaTrader's view looks wrong, check your broker's own web platform, which shows what the broker holds.
4. Reducing the exposure
- Use stop orders that work at the broker, not simulated stops, for anything unattended. [2]
- Use a wired connection, or a hosted Windows server (VPS) close to your broker's servers.
- Save your broker's trade desk phone number where you can reach it without your trading PC.
- Test it: on a simulation account, open a position and pull the network cable, then write down what your strategy and your orders do.
Sources
- NinjaTrader 8 help guide, Where do your orders reside?
- NinjaTrader 8 help guide, Simulated Stop Orders
- NinjaTrader 8 help guide, Settings > Strategies
- NinjaTrader 8 help guide, Settings
- NinjaTrader 8 help guide, ConnectionLossHandling
- NinjaTrader 8 help guide, DisconnectDelaySeconds
- NinjaTrader 8 help guide, Control Center > Positions Tab
- NinjaTrader 8 help guide, Control Center > Orders Tab
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.