If your NinjaTrader chart freezes and no more data is coming in (especially with Tradovate), optimizing the Windows network settings can help. This guide is also suitable for beginners.
Important: These changes are safe and can be undone at any time.
PowerShellC:\Windows\system32> or similar![PowerShell as Admin]
Windows normally only checks every 2 hours to see if a connection is still alive. That’s way too long! We’re changing that to 30 seconds.
Command 1: Copy this text and paste it into PowerShell, then press Enter:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "KeepAliveTime" -Value 30000 -PropertyType DWord -Force
Command 2: Copy this text and paste it into PowerShell, then press Enter:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "KeepAliveInterval" -Value 1000 -PropertyType DWord -Force
After each command, an output should appear that looks something like this:
KeepAliveTime : 30000
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\...
No error message = All good!
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" | Select-Object KeepAliveTime, KeepAliveInterval
KeepAliveTime KeepAliveInterval
------------- -----------------
30000 1000
If you see these numbers, everything worked! ✅
Option A: Via PowerShell (fast)
Copy and paste:
Restart-Computer
Option B: Via Windows (normal)
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" | Select-Object KeepAliveTime, KeepAliveInterval
KeepAliveTime KeepAliveInterval
------------- -----------------
30000 1000
Done! 🎉
These steps are optional and can help additionally:
Copy and paste into PowerShell:
netsh int tcp set global autotuninglevel=normal
Expected output: OK.
Copy and paste into PowerShell:
netsh int tcp set global timestamps=enabled
Expected output: OK.
netsh int tcp show global
You should see:
Autom. Abstimmungsgrad für Empfangsfenster: normalTCP-Zeitstempel: enabledSolution: You did not open PowerShell as administrator. Go back to step 1.
That’s OK! The value already exists. You can run the command again with -Force at the end (is already included in the commands above).
Solution: Run the commands again. Sometimes antivirus software blocks registry changes.
This optimization helps in about 30% of cases. If the problem persists:
If you want to undo the changes:
Open PowerShell as administrator, then:
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "KeepAliveTime" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "KeepAliveInterval" -ErrorAction SilentlyContinue
Then restart.
For advanced users – all commands for quick copying:
# TCP KeepAlive auf 30 Sekunden
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "KeepAliveTime" -Value 30000 -PropertyType DWord -Force
# KeepAlive Retry-Intervall auf 1 Sekunde
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "KeepAliveInterval" -Value 1000 -PropertyType DWord -Force
# Optional: TCP Optimierungen
netsh int tcp set global autotuninglevel=normal
netsh int tcp set global timestamps=enabled
# Überprüfen
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" | Select-Object KeepAliveTime, KeepAliveInterval
netsh int tcp show global
# Neustart erforderlich!
Restart-Computer
| Setting | Before (Default) | After | Effect |
|---|---|---|---|
| KeepAliveTime | 2 hours | 30 seconds | Faster detection of dead connections |
| KeepAliveInterval | 1 second | 1 second | Fast repetitions in case of problems |
| TCP Timestamps | Off | On | Better connection tracking |
| Auto-Tuning | Normal | Normal | Optimal packet sizes |
This guide was created as part of the NinjaTrader VPS connection problem analysis.
Important note: This optimization helps with about 30% of Tradovate connection problems. The most stable solution is to switch to a Rithmic-based data feed.
As of January 2026
Copyright © 2025 Twinpeaks