Strategy restore

5 min read

NinjaTrader strategy disabled after disconnect: settings and order checks

Why a strategy stays disabled after reconnecting, which settings can cancel its orders, and how to check the actual order state before another start.

Illustration of a restored green network connection beside an automation gear still marked with an amber pause symbol.

Quick answer

Reconnecting an account does not necessarily re-enable a NinjaTrader strategy. Check its connection-loss mode, restart limits and first error. Then inspect its orders separately: disabling can cancel entry or exit orders according to your settings, and an order rejection can trigger additional handling.

Identify what actually stopped

Use this guide when a provider connection dropped while NinjaTrader remained open. In the Strategies tab, find the affected account, instrument and instance; check its Enabled value and the first log entry at the interruption.

Observed stateInspect next
Enabled is falseConnection-loss handling, restart limits and termination or order errors.
Enabled but waitingStart Behavior and the calculated strategy position.
Account is missing or cyclingProvider connection and account availability.
Strategy row is missingWorkspace loading and how that instance was added.

Keep Running, Recalculate and Stop Strategy

NinjaTrader groups these controls under Strategies > NinjaScript > On connection loss in its settings. Check the effective behavior of the specific strategy too: NinjaScript exposes ConnectionLossHandling to its developer.

Handling modeWhat happens when connectivity returns
Keep RunningKeeps the strategy running through the interruption and resumes as though it had not disconnected. It does not supply missing connectivity.
RecalculateAttempts to recalculate the strategy position after the connection has remained restored for more than 10 seconds, if the loss previously stopped the strategy.
Stop StrategyStops after the configured disconnect delay. Reconnection alone triggers no restart.

When Recalculate actually stops and restarts

Under Recalculate, the trigger depends on which feed failed:

  • Data feed: the outage lasts longer than Disconnect delay seconds.
  • Order feed: the strategy attempts an order action while disconnected.
  • Both feeds: the outage lasts longer than Disconnect delay seconds.

Why a stable connection can still leave it stopped

Number of restart attempts and Restarts within x minutes work together. NinjaTrader restarts only while attempts remain below the configured count in that time window; reaching the limit halts further attempts. Repeated connection drops can therefore exhaust native recovery even if the latest reconnect succeeds.

If the log shows a rejected strategy order, check RealtimeErrorHandling with the strategy developer. Its default StopCancelClose behavior stops the strategy, cancels remaining working orders and submits closing orders for positions managed by that strategy. Custom strategies can select different handling. A rejection and a connection-loss stop therefore need different diagnoses; increasing restart attempts does not explain or fix the rejected order.

Does disabling a strategy cancel its orders?

NinjaTrader exposes two separate controls under Strategies > NinjaScript. Inspect their current values; the Enabled checkbox alone does not describe what happened to the orders.

SettingEffect when selected
Cancel entry orders when a strategy is disabledAutomatically cancels that NinjaScript strategy’s entry orders when it is disabled.
Cancel exit orders when a strategy is disabledAutomatically cancels that NinjaScript strategy’s exit orders when it is disabled.

Check positions and orders before another start

In the Orders tab, filter to the affected account and check the instrument, Strategy, order ID, State, Filled and Remaining columns. Set Filter Orders to None when investigating a missing order; an active-only view can hide its completed outcome.

Cancel pending means a cancellation was submitted; Cancelled records confirmation. A partially filled order also needs its filled quantity and the account position checked. A disable event or cancellation request alone does not establish that the position is flat or the remaining orders are gone.

Before starting the instance again, compare the account position and working orders with the strategy’s calculated position. Start Behavior governs that next startup. Wait until flat does not automatically resolve an existing account position, and synchronization options can submit live orders. Startup synchronization does not guarantee continued alignment.

Where Ninja Watchdog recovery fits

With reconnect monitoring enabled, Ninja Watchdog can attempt to restore strategies affected by a dropped connection once account access returns. It respects deliberate stops and reports whether NinjaTrader confirms restoration.

Restoring a strategy does not reconcile positions and orders or establish fresh ticks for every instrument. The strategy’s startup behavior still matters. If it stops again, investigate the recorded cause; a submitted enable request is not proof of recovery.

Ninja Watchdog provides recovery email alerts today. SMS and WhatsApp alerts are coming soon.

Official sources

Protect your setup

Keep NinjaTrader recovery automatic

Monitor NinjaTrader, recover supported interruptions, and receive recovery alerts on your Windows computer or VPS.

Start protection