NinjaTrader automation protection

7 min read

NinjaTrader automated strategy recovery: pre-session and simulation checks

Check the intended recovery target and expected session state before trading, then use a simulation record to distinguish a recovery attempt from a verified result.

Illustration of a continuous recovery loop joining a computer, network connection, and automation gear.

Quick answer

Recover NinjaTrader automation in sequence: Windows sign-in, platform launch, account connections, current data and the intended strategy state. Task Scheduler can launch the application; native connection-loss settings govern strategy behavior after reconnect. Verify the whole sequence in simulation, because a running process or connected indicator alone does not establish strategy recovery.

What Windows Task Scheduler can recover

Task Scheduler runs a configured action when its trigger occurs. Startup and Windows logon are separate triggers. A task using an interactive token requires that Windows account to be logged in; the startup trigger alone does not create that desktop.

If the task only launches NinjaTrader, it does not also verify provider connections, fresh prices or enabled strategies. Check its trigger, run-as account and logon type. Evaluate any added recovery script separately from the scheduler.

What NinjaTrader’s native restart settings mean

NinjaScript On connection loss settings govern strategy behavior when connectivity changes. Number of restart attempts and Restarts within x minutes limit strategy restarts on a reestablished connection; they do not launch a closed platform or recover Windows.

Once the restart threshold is reached, NinjaTrader halts further attempts. A full platform restart has a separate persistence issue: a strategy retained on an open chart returns with Enabled set to false. Saved parameters alone do not establish that it resumed.

Handling modeDocumented behavior
Keep RunningKeeps the strategy running through the disconnect and resumes when the connection returns.
RecalculateIf a documented feed-loss condition stopped the strategy, recalculation is attempted after reconnection remains stable for more than 10 seconds.
Stop StrategyStops after the configured disconnect delay and takes no action when connectivity returns.

What Ninja Watchdog restores

Ninja Watchdog’s Windows app installs the NinjaWatchdogBridge add-on, which NinjaTrader asks you to allow. It uses recorded session state to attempt platform relaunch, login, account reconnect and restoration of previously active strategies. Usable saved state, configured login and a ready account are required; closed market sessions can delay restoration.

Recovery reports use email today; SMS and WhatsApp alerts are coming soon. Watchdog does not directly place, modify or cancel orders. Re-enabling a strategy can still affect orders through that strategy and its Start Behavior.

Check the recovery target before the session

Before relying on a prior recovery test, compare its exact account, instrument and strategy instance with the setup you intend to run today. A different contract, instance or connection changes what that earlier result tells you.

CheckEvidence to inspectWhat a mismatch means
Recovery targetThe intended connection and previously active strategy in saved recovery state; current NinjaTrader account, strategy instance and instrument expiry.A saved template or similarly named instance does not establish that the intended instance is armed for recovery.
Trading sessionThe instance’s Trading Hours template, template time zone and holiday override; whether the instrument should be producing current data now.A closed session can explain a wait. During an active session, investigate stale prices before treating the setup as ready.
Strategy stateEnabled value, green running/orange waiting/black disabled state, account position and working orders.A connected account is not proof of a running strategy. An orange state needs Start Behavior interpretation rather than repeated enabling.
Recovery alertsThe signed-in Ninja Watchdog account email, verified email status, Email delivery and Connection needs attention/Strategy needs attention preferences.These attention preferences concern recovery that could not finish. Their presence is not an inbox receipt or proof of successful recovery.
Last observed resultThe dated log or recovery event, actual outcome and any configuration change since the last simulation exercise.An attempted action is not a completed result. Retest a changed setup in simulation instead of carrying its old result forward.

Prepare one identifiable simulation strategy

Use a dedicated simulation setup with no live strategies or trade-copier routes attached. Select Sim101 on the test strategy itself and confirm its account, instrument and contract before enabling it. Sim101 is NinjaTrader’s default simulated account.

Tools > Global Simulation Mode restricts order-entry interfaces to simulation accounts. Treat that as an additional safeguard, not evidence that every restored instance or external integration has the intended routing. Recheck the exact strategy account after recovery.

Record the strategy parameters, Start Behavior, connection-loss mode, disconnect delay and restart limits before the test. Preserve its simulated position, working orders and history for comparison; resetting Sim101 between observations would remove part of that evidence.

Match the test to the interruption

Run one interruption at a time and return to the same known starting state before the next. The following are proposed tests, not results from a test we performed.

CaseWhat to exercise and distinguish
Windows restartOn the simulation computer, use Windows’ normal Restart action. Record the return of the intended desktop, NinjaTrader and the test strategy separately. This checks reboot recovery, not an application crash.
Unexpected network lossUse a brief, controlled network interruption on the simulation computer, then restore connectivity. Observe the actual price/order connection states and strategy handling. Do not disable the network through your only remote-access path.
Manual Disconnect controlDeliberately disconnect the test connection through NinjaTrader. In Ninja Watchdog, a detected manual disconnect suppresses automatic reconnect and pending strategy recovery for that connection until it connects again. Reconnect it deliberately before the next test.

Record what actually returned

Keep dates and time zones with these observations. An attempt message and a successful outcome are separate events; leave an unobserved result unknown. A normal close and reopen checks saved state, but does not reproduce an unexpected crash.

The Strategies tab uses green for running, orange for waiting until flat and black for disabled. Check account and active-only filters if an instance appears missing. Export the Strategies and Log grids to CSV or Excel to retain the observed state; the Log tab shows current-day events, so preserve both days if the test crosses midnight.

Fields for your simulation record; no recovery times or results are assumed.

ObservationRecord from the same test
Starting stateNinjaTrader/Watchdog versions, workspace, exact strategy instance, Sim101 account, instrument/expiry and relevant settings.
Interruption and attemptWhat you changed, when it happened, the affected connection and any recovery-attempt message.
Desktop and platformWhen the intended Windows session became available and Control Center responded.
Connection and dataAffected provider status and the first current instrument update observed after the interruption, during an active trading session.
Account and strategySimulated position, working orders, exact instance/account, Enabled value and running, waiting or disabled state.
NotificationEvent time reported in the recovery email and inbox receipt time, recorded separately.

Use a partial result to find the missing step

If the desktop returns but NinjaTrader stays closed, investigate startup and login. If the provider reconnects but prices remain stale, check data access, the contract and session hours. If the instance remains orange, inspect Start Behavior before calling it a failed restart. Stop Strategy deliberately remaining halted after reconnect is consistent with that handling mode.

Compare account position and orders with the strategy’s calculated position before resuming. NinjaTrader’s startup synchronization can submit orders and does not guarantee continued alignment. A successful Sim101 exercise verifies only the configuration and interruption you observed; it does not prove broker-side order handling or recovery from a different crash.

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