Desktop
Check whether the expected NinjaTrader process exists on the Windows host.

Save both files in the same folder. The first reads the Desktop process and optional recorder heartbeat. The second calls that check and writes a local log for supervised troubleshooting.
Open PowerShell in the folder where you saved the files. Run .\Check-NinjaTrader.ps1 for one observation. For the logger, run .\Log-NinjaTraderHealth.ps1 -LogDirectory "D:/NinjaTraderHealth" with a folder you can write to. Read the log format and scheduling steps.
If PowerShell reports that a downloaded file is unsigned, review the source and check the active policy with Get-ExecutionPolicy. With RemoteSigned, Windows file Properties lets you choose Unblock on each reviewed file. If your organization requires signed scripts, follow its approval process. Microsoft's guide to running reviewed scripts.
If your recorder or strategy writes a JSON heartbeat, pass its file with -HeartbeatPath. Use process_id and an ISO 8601 at_utc ending in Z or an explicit offset like -06:00. A timestamp with no offset is reported as unreadable. Publish more frequently than the two-minute freshness threshold.
To log when your recorder stops seeing market events for one contract, add an instrument and the last event time to the heartbeat.
param(
[string]$HeartbeatPath,
[string]$ExpectedInstrument,
[ValidateRange(1, 86400)]
[int]$MaxMarketDataAgeSeconds = 60
)
function Read-Timestamp([string]$Text) {
if ($Text -cnotmatch '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$') {
throw 'Timestamp must include Z or an explicit numeric offset.'
}
[DateTimeOffset]::Parse($Text, [Globalization.CultureInfo]::InvariantCulture)
}
$desktop = @(Get-Process -Name NinjaTrader -ErrorAction SilentlyContinue)
$observedAt = [DateTimeOffset]::UtcNow
$heartbeatState = 'Not configured'
$marketDataState = 'Heartbeat unavailable'
$recordedInstrument = $null
$marketTimestamp = $null
$marketAge = $null
if ($HeartbeatPath) {
try {
$payload = Get-Content -LiteralPath $HeartbeatPath -Raw -ErrorAction Stop
if ($PSVersionTable.PSVersion.Major -ge 7) {
# Preserve the original timestamp text before PowerShell can coerce it to a date.
$document = [System.Text.Json.JsonDocument]::Parse($payload)
try {
$root = $document.RootElement
$recordedProcessId = [int]$root.GetProperty('process_id').ToString()
$timestamp = $root.GetProperty('at_utc').GetString()
if ($ExpectedInstrument) {
$field = [System.Text.Json.JsonElement]::new()
if ($root.TryGetProperty('instrument', [ref]$field)) { $recordedInstrument = $field.ToString() }
if ($root.TryGetProperty('last_market_event_utc', [ref]$field)) { $marketTimestamp = $field.ToString() }
}
} finally {
$document.Dispose()
}
} else {
$beat = ConvertFrom-Json -InputObject $payload -ErrorAction Stop
$recordedProcessId = [int]$beat.process_id
$timestamp = [string]$beat.at_utc
$recordedInstrument = [string]$beat.instrument
$marketTimestamp = [string]$beat.last_market_event_utc
}
$checkedTime = Read-Timestamp $timestamp
$observedAt = [DateTimeOffset]::UtcNow
$age = ($observedAt - $checkedTime).TotalSeconds
if ($desktop.Count -ne 1 -or $desktop[0].Id -ne $recordedProcessId) {
$heartbeatState = 'Process mismatch'
} elseif ($age -lt 0 -or $age -gt 120) {
$heartbeatState = 'Timestamp outside expected range'
} else {
$heartbeatState = 'Fresh for this process'
}
} catch {
$heartbeatState = 'Missing or unreadable'
}
}
$report = [ordered]@{
CheckedUtc = $observedAt.ToString('o')
DesktopInstances = $desktop.Count
Heartbeat = $heartbeatState
}
if ($ExpectedInstrument) {
if ($heartbeatState -eq 'Fresh for this process') {
if (-not $recordedInstrument -or -not $marketTimestamp) {
$marketDataState = 'Instrument or event timestamp missing'
} elseif ($recordedInstrument -ne $ExpectedInstrument) {
$marketDataState = 'Instrument mismatch'
} else {
try {
$eventTime = Read-Timestamp $marketTimestamp
if ($eventTime -gt $checkedTime) { throw 'Event follows its heartbeat.' }
$eventAge = ($observedAt - $eventTime).TotalSeconds
$marketAge = [math]::Round($eventAge, 1)
if ($eventAge -gt $MaxMarketDataAgeSeconds) {
$marketDataState = 'No recent recorded event'
} else {
$marketDataState = 'Recent recorded event'
}
} catch {
$marketDataState = 'Event timestamp unreadable or out of order'
}
}
}
$report.MarketData = $marketDataState
$report.MarketDataAgeSeconds = $marketAge
}
[pscustomobject]$report | ConvertTo-Json -CompressCheck whether the expected NinjaTrader process exists on the Windows host.
Check the configured data provider and account in Control Center.
Check whether prices and timestamps advance for an active instrument during its session.
First connect manually and confirm the data provider, account, and environment. If your connection exposes Connect on start up, enable it only after a successful manual connection. Check that Windows stays awake during the session and that the connection is restored after a planned maintenance restart.
Choose a dated contract that is active in the current session. Compare its bid, ask, and trade timestamps, then check the chart’s session template and data entitlement if the chart looks delayed. For an evaluation, ask your firm to confirm market-data access.
Check the exchange calendar for maintenance windows, holidays, and early closes. Quiet or missing quotes during a closed session are expected.
A lock screen or a dark monitor can leave the computer running. Sleep, hibernation and Modern Standby affect what the host can run. In Windows 11, open Settings → System → Power & battery → Screen, sleep, & hibernate timeouts. Check the system sleep timer separately from the display timer. On a laptop, also check the power source and lid action. The screen can turn off while a supervised session continues.
Run the read-only PowerShell query below on the Windows host that runs NinjaTrader. It reads the previous 12 hours of System log entries and prints UTC times. Kernel-Power 42 and 107 can mark entry into and resume from sleep. IDs 506 and 507 can mark Modern Standby transitions. Power-Troubleshooter 1 can record a return from a low-power state. The events available depend on the Windows host and its sleep mode. If the query finds nothing, check the time range and task logs before drawing a conclusion.
Suppose a one-minute watchdog records samples through 15:41 UTC, goes silent as Windows logs sleep at 15:42, and resumes at 15:54 with a matching wake event. That overlap supports a host interruption. If the watchdog kept running every minute and only the last quote time stopped at 15:41:12, check the active contract and the provider’s price-server status instead. A task history gap by itself can also come from task conditions or an error.
After wake or reconnect, verify the current provider and dated contract in Time & Sales. Check broker-reported positions and working orders before making recovery changes. Seeing the same Desktop window after wake does not tell you whether its feed or strategy resumed.
$since = (Get-Date).AddHours(-12)
$powerEvents = @(
@{ LogName = 'System'; ProviderName = 'Microsoft-Windows-Kernel-Power'
Id = 42, 107, 506, 507; StartTime = $since }
@{ LogName = 'System'; ProviderName = 'Microsoft-Windows-Power-Troubleshooter'
Id = 1; StartTime = $since }
)
try {
Get-WinEvent -FilterHashtable $powerEvents -ErrorAction Stop |
Sort-Object TimeCreated |
Select-Object @{ Name = 'TimeUtc'; Expression = {
$_.TimeCreated.ToUniversalTime().ToString('o')
}}, ProviderName, Id
} catch {
if ($_.FullyQualifiedErrorId -notlike 'NoMatchingEventsFound*') { throw }
Write-Output 'No matching system power events in the selected period.'
}In Control Center, open New → T & S to bring up Time & Sales. Select the same dated contract as the chart and check that Last prices are visible and the size filter is clear. During an active session, watch whether new trades arrive. Advancing rows show that data is arriving. If both windows stay quiet, compare with another normally active contract on the same feed, then check the connection, exchange session, and the provider’s real-time entitlement.
If Time & Sales is current but the chart stays still, right-click the chart and open Data Series. Check the contract month, Trading Hours, bar type, and loaded date range. For example, if trades are arriving before the cash open but an ES chart uses an RTH template, open a separate chart with the corresponding ETH template to see whether overnight bars appear. Compare both windows in the same time zone.
If current bars are forming but there is a gap after an earlier disconnect, check that the historical provider covers the affected interval and bar type. On a chart without a running strategy, right-click and choose Reload All Historical Data when it is safe to refresh. NinjaTrader reloads the base interval for other charts of the same instrument and replaces locally stored data for that reload. Save any locally recorded data you need before using it. Recheck the exact gap afterward. If it remains, give the provider the dated symbol, interval, time zone, and missing time range.
Check the chart for a delayed-data message, then confirm real-time access for the exchange and dated contract with the provider supplying the Futures feed. A data subscription on a different login or connection does not establish access on the one NinjaTrader is using.
Compare several consecutive Last trades with a trusted real-time source for the same contract. Use the same time zone and note the order in which the prints appear. For example, if a sequence arrives at 10:14 ET on the reference feed and a matching sequence arrives around 10:24 ET in NinjaTrader, the repeated lag supports a delayed-feed diagnosis. If the reference keeps printing and NinjaTrader’s last row stays fixed after you clear its filters, check the price-server connection, contract and session instead. Feed filtering can differ, so a single unmatched trade proves little.
Look up the active connection in NinjaTrader’s Data by Provider table. Under Real-time timestamp, Native means the source supplies the timestamp. If the source supplies none, NinjaTrader stamps incoming ticks using the local PC clock. In that case, timestamps close to the current time tell you when data arrived, and the delayed-data message, entitlement and comparison feed are better evidence of when the trades actually occurred.
During an active session, put the affected chart at its latest bar. Open a second, plain Minute chart for the same dated contract, using Last prices and a Trading Hours template that includes the current session. Keep the comparison chart free of indicators and strategies. Watch both charts alongside unfiltered Last trades in Time & Sales. Compare the latest trade prices across several updates. A single difference between Last and the bid or ask can occur during normal trading.
In a fictional example, Time & Sales prints 6,001.25 at 10:04:10 ET and 6,002.00 at 10:04:22 ET. The plain chart follows both prices. The affected chart still shows 6,000.00 after the second update. That points to the affected chart or its workspace. If the active bars on both charts follow the trades and only an indicator stays still, check its Calculate setting. On Bar Close can explain why the plot waits for the bar to finish.
To investigate rendering lag, open Control Center → New → NinjaScript Output. Right-click inside the output window and select NinjaScript Utilization Monitor. Let it collect several minutes of activity while the problem is happening. Scripts near the top are candidates to test in a separate chart or workspace. Add one indicator at a time and repeat the comparison, keeping active trading strategies out of the test. If neither chart follows Time & Sales, recheck the instrument, session template and whether each chart is displaying its latest bar.
In Control Center, open Connections and check the status next to each provider. With more than one provider connected, hover over the combined status indicator to see individual states. An orange indicator means the price-server connection was lost. A red indicator means the order-server connection was lost. Check the specific provider you expect to supply the data.
In Control Center, open Tools → Settings → Market data. Expand Preferred connections – real-time and Preferred connections – historical. Check which connection is assigned to Futures in each list. Record the current choices and which providers were connected when the problem started.
With no preference set, NinjaTrader starts with the first connected provider that supports the requested instrument type. Suppose Provider A was connected first and supports futures but lacks access to your dated MES contract. Provider B may have access, yet NinjaTrader does not automatically switch to B to fix the missing entitlement. This can leave a chart with stored candles but no new trades.
When it is safe to make connection changes, choose the provider that has live access under Preferred connections – real-time for Futures. Review the historical preference separately if your backfill comes from another provider. Verify with Time & Sales for the same dated contract during an active session. If trades arrive after the change, also check that the chart builds the expected current bars.
Start with the connection that supplies your live prices. For NinjaTrader’s live service, check Market Data Live and the incident history on NinjaTrader Live Status. Check the order-flow and routing components separately if the problem involves orders. For a Tradovate connection, check Live Market Data or Demo Market Data for your environment on Tradovate’s status page. If you use another provider, use its service status instead.
Suppose during an active session your watchdog records a fresh NinjaTrader heartbeat at 14:32 UTC, but Last prices freeze for both dated MES and MNQ contracts on the same provider. If that provider reports a market-data incident covering 14:32 UTC and your feed resumes around its recovery update, the timing supports a provider-side explanation. Save the time of the last trade before the freeze, when you first noticed it, and the first new trade after recovery. Keep the incident link or timestamp. After prices resume, compare consecutive trades in Time & Sales and verify current bars on your chart.
An operational status page may not reflect a problem affecting one account, connection, or contract. If only MNQ freezes while MES keeps printing, start with the exact MNQ expiry, session, entitlement, and connection before treating it as a wider outage. If prices recover and an order status is still unclear, verify the order, fills, and position in the broker’s own interface before retrying.
Our PowerShell monitoring checks that the process is present and compares a heartbeat’s process ID with the current NinjaTrader process. A recorder or strategy can then report its own health. A fresh process heartbeat alone cannot tell you whether the intended symbol is receiving quotes.
Run the sample manually first. In Task Scheduler, create a task under your normal Windows account. Use a repeating trigger, such as every minute, and set the program to powershell.exe. In Arguments, enter -NoProfile -File followed by the quoted full path to your saved Check-NinjaTrader.ps1. Set the task to skip overlapping instances.
To retain a history, schedule the logging wrapper in the next section. After your first scheduled run, check Last Run Result in Task Scheduler and open the daily observation file.
For a feed check, use the last quote timestamp from your recorder or adapter for the expected contract and session. Compare consecutive samples before escalating. Keep process absence, stale application heartbeat, and stale market data as separate results.
If your NinjaScript recorder already receives market data, add the exact dated instrument and the UTC time it received the latest event to its JSON heartbeat. For an OnMarketData recorder, count events from the live connection for that contract. Keep Playback and Tick Replay observations out of a live check. If you monitor Last trades, another trade at the same price is still a new event. Keep publishing the heartbeat on its own schedule with the last market event unchanged until another one arrives.
In the sample below, a recorder publishes its heartbeat at 15:42:30 UTC. The most recent market event arrived 78 seconds earlier. On an observation at 15:42:30, the process can have a fresh heartbeat while MarketData says No recent recorded event under the 60-second threshold. A different expiry gives Instrument mismatch. The sample IDs and times illustrate the file format.
Use the same market event definition and threshold when comparing runs. During a maintenance break or in a thin contract, there may be no recent event. A delayed feed can also keep delivering events. Use recent receipt as one check alongside session hours, real-time entitlement, Time & Sales, and provider status.
{
"process_id": 1234,
"at_utc": "2026-11-20T15:42:30Z",
"instrument": "MES 12-26",
"last_market_event_utc": "2026-11-20T15:41:12Z"
}Add these arguments to the check or logging script. Replace the path, dated symbol, and age threshold for your session.
-HeartbeatPath "D:/NinjaTraderHealth/heartbeat.json" -ExpectedInstrument "MES 12-26" -MaxMarketDataAgeSeconds 60Download or save Log-NinjaTraderHealth.ps1 in the same folder as Check-NinjaTrader.ps1. Try it twice in PowerShell before scheduling it. Pass an absolute local folder that the task account can write to, for example -LogDirectory "D:/NinjaTraderHealth". If your recorder publishes a heartbeat, pass its full file path with -HeartbeatPath.
Point the task’s -File argument to the logging script. Include -LogDirectory and any -HeartbeatPath after the script path and quote paths that contain spaces. Keep the setting that skips overlapping runs. The wrapper appends one JSON record per run to a file named by the UTC date and stops on errors, such as an unwritable folder.
After two runs, open the current health-YYYY-MM-DD.jsonl file or use Get-Content with -Tail 10. Compare CheckedUtc, DesktopInstances and Heartbeat across the samples. A zero process count is a recorded observation. A missing row is a reason to check Task Scheduler History, its Last Run Result and the Windows power events.
For an outage, compare the sample times with NinjaTrader’s Control Center → Log and Time & Sales. Put every timestamp in the same time zone. A fresh process heartbeat with stale trades shifts the next check to the active contract and the price-server connection. This wrapper writes observations and leaves recovery decisions to the operator.
param(
[Parameter(Mandatory = $true)]
[string]$LogDirectory,
[string]$HeartbeatPath,
[string]$ExpectedInstrument,
[ValidateRange(1, 86400)]
[int]$MaxMarketDataAgeSeconds = 60
)
$ErrorActionPreference = 'Stop'
if ($LogDirectory -notmatch '^[A-Za-z]:[\\/]') {
throw 'Use an absolute local log directory, such as D:/NinjaTraderHealth.'
}
$check = Join-Path $PSScriptRoot 'Check-NinjaTrader.ps1'
$sample = & $check -HeartbeatPath $HeartbeatPath -ExpectedInstrument $ExpectedInstrument -MaxMarketDataAgeSeconds $MaxMarketDataAgeSeconds
if ($sample -isnot [string]) { throw 'Expected one JSON health sample.' }
$report = ConvertFrom-Json -InputObject $sample
if (-not $report.CheckedUtc) { throw 'Health sample has no UTC timestamp.' }
$day = ([DateTimeOffset]$report.CheckedUtc).UtcDateTime.ToString('yyyy-MM-dd')
$directory = [System.IO.Directory]::CreateDirectory($LogDirectory).FullName
$log = Join-Path $directory "health-$day.jsonl"
[System.IO.File]::AppendAllText($log, $sample + [Environment]::NewLine)Replace the task name and folder below with the values from your task. Compare the task’s Last Run time and History with the newest log file and its final CheckedUtc value. Keep the log’s UTC date in mind. A run at 7:01 p.m. Central Daylight Time writes the next UTC day’s file.
If Last Run has stopped advancing, inspect the trigger, power conditions and task account. A task set to run only when the user is logged on needs that Windows session. If History shows the action started but the log did not grow, check the action arguments, quoting, script location and the task account’s access to the log folder. You can check task history for its completion or error event.
A successful scheduled run means the script completed. Open the actual sample to see whether it found a desktop process or a valid heartbeat. Check the last quote or trade timestamp for the active contract separately.
Get-ScheduledTaskInfo -TaskName 'NinjaTrader Health' |
Select-Object LastRunTime, LastTaskResult, NextRunTime
Get-ChildItem -LiteralPath 'D:/NinjaTraderHealth' -Filter 'health-*.jsonl' -File |
Sort-Object Name |
Select-Object -Last 2 Name, LastWriteTimeUtc, LengthCheck open positions and working orders through the broker’s own interface. Review whether your strategies, stop management, or order handling depend on Desktop. If positions or order state are unclear, stop automated recovery and investigate.
After a supervised reconnect, verify the expected account, connection, and quote timestamps again. If you use a recorder or strategy, confirm the exact instance resumes and publishes a new heartbeat. Keep one supervisor responsible for recovery so two tasks cannot restart the same desktop.
For NinjaScript strategies, open Control Center → Tools → Settings → Strategies and expand On connection loss. Check Handling, Disconnect delay seconds, and the restart-attempt settings. Keep running continues the strategy through the interruption. Recalculate can recalculate the strategy position after an eligible stop once the connection has held for more than ten seconds. Stop strategy stops after the configured delay and takes no action when the connection returns.
Under Recalculate, the price and order connections can lead to different outcomes. Suppose the disconnect delay is 15 seconds. A price-feed-only gap of eight seconds that clears before the strategy stops can leave it running without recalculation. With an order-feed-only gap, a strategy order action during the outage can stop it even if the price feed stays live. Recovering the price feed alone would leave that order-feed problem unresolved.
If Stop strategy is selected instead, a 25-second connection loss can stop the strategy even if no order was attempted. When it reconnects, check the relevant connection status and compare the Control Center Log timestamps with the row’s Enabled state in Strategies for the exact strategy, account, and dated contract. Under Recalculate, also check whether recent restart attempts already reached the configured limit for that time window. In that case Desktop can halt further restart attempts despite a restored connection.
Compare Position with Acct. position and check Sync. Position is what the strategy tracks. Acct. position includes activity outside that strategy. If a broker-side protective order filled during the outage, the account might be flat even though the strategy still shows a position. Confirm fills and working orders in the broker interface.
Review the strategy’s Start behavior before re-enabling. Some synchronization settings can submit orders to reconcile positions. Check which orders still exist and what the strategy will do on startup. If the positions disagree or you cannot verify the orders, leave the strategy disabled while you investigate. Rehearse the startup behavior in simulation before relying on it.
NinjaTrader® is a registered trademark of NinjaTrader Group, LLC. No NinjaTrader company has any affiliation with the owner, developer, or provider of the products or services described on this website, or any interest, ownership, or otherwise, in any such product or service, and no NinjaTrader company endorses, recommends, or approves any such product or service.
Platform details on this page were checked against these official resources.
Verify which provider supplies the requested instrument, interval, and dates.
Add the timer, check the chart series and verify the next close.
Verify where working exits and linked cancellation are managed for your connection.
Check the layout separately from the connection and market data.
Check exact dates, sessions, and interval before downloading or refreshing history.
Check the order, Log entry, execution, and position after connecting.
Identify the inside market, understand resting size, and check a missing Level II feed.
Check quote freshness, the alert condition and the Alerts Log before changing sound settings.
Verify whether the broker still shows a working sibling order after the other exit fills.
Verify the expiry and understand shifts in merged historical prices.
Check the downloaded contract and time range when a replay freezes.
See whether another signed-in device is using the session you need.
Verify the intended brokerage or evaluation connection.
Check the account and working exits in a simulated walkthrough.
It depends on its connection-loss settings and why it stopped. If Stop strategy applies, reconnecting takes no further action. Check Enabled, Position, Acct. position, and Sync in Control Center → Strategies, then review broker fills and working orders before deciding how to resume.
Check the price-server status for the specific provider in Control Center. With multiple connections, verify the preferred real-time Futures provider and its access to the exact contract, then watch Time & Sales during an active session. Historical candles can remain visible while live trades are missing.
Compare Time & Sales for the same dated contract during an active session. If fresh trades arrive there, check the chart’s Data Series, Trading Hours, and date range. If both windows are stale, check the configured provider and market-data access.
When the source provides no timestamp, Desktop stamps incoming ticks with the local PC clock. Check real-time entitlement and the chart’s delayed-data message, then compare the same dated contract with a verified real-time feed.
Confirm that the chart’s Trading Hours includes the missing interval and that your provider supplies that historical data. Reload All Historical Data can refill a gap after an interruption, and it replaces locally stored history for the affected instrument and base interval.
A process check only shows whether Desktop is running. A separate data observation from your recorder, add-on, or platform is needed to determine quote freshness.
A display timeout is separate from system sleep. Check the host’s power settings and compare System log timestamps with watchdog samples and the last quote time for an active contract.
Check the session and confirm the problem over consecutive samples. Verify open positions, working orders, and recovery safety before restarting.
Check Task Scheduler or use Get-ScheduledTaskInfo for the task you created. Review its local health output to understand what it observed.
Futures trading contains substantial risk and is not suitable for every investor. TradeReign is a trading-discipline and rule-enforcement application. It does not provide trading advice, trade signals, investment recommendations, or performance guarantees.
TradeReign is not a broker-dealer, futures commission merchant, or investment advisor.
Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Only risk capital - money that can be lost without jeopardizing financial security or lifestyle - should be used for trading. Past performance is not necessarily indicative of future results.