Windows network optimization for NinjaTrader

Why this guide?

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.


What you need

  • Windows 10 or Windows Server
  • Administrator rights on the computer/VPS
  • 5-10 minutes of time
  • A restart is required at the end!

Step 1: Open PowerShell as administrator

Here’s how:

  1. Press the Windows key on your keyboard
  2. Type PowerShell
  3. Right-click on “Windows PowerShell”
  4. Select “Run as administrator”
  5. Click “Yes” when Windows asks

How to recognize that it worked:

  • The window shows “Administrator: Windows PowerShell” at the top
  • The path starts with C:\Windows\system32> or similar

![PowerShell as Admin]


Step 2: Enable TCP KeepAlive

What does that do?

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.

Commands (copy and paste individually):

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

How to recognize that it worked:

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!


Step 3: Check if the values are set

Command (copy and paste):

Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" | Select-Object KeepAliveTime, KeepAliveInterval

This is what the output should look like:

KeepAliveTime KeepAliveInterval
------------- -----------------
        30000              1000

If you see these numbers, everything worked!


Step 4: Restart

Important: The changes will only take effect after a restart!

Option A: Via PowerShell (fast)

Copy and paste:

Restart-Computer

Option B: Via Windows (normal)

  1. Click on the Windows icon in the lower left corner
  2. Click on the Power icon
  3. Select “Restart”

Step 5: Check after the restart

  1. Open PowerShell as administrator again (see step 1)
  2. Run the check command:
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" | Select-Object KeepAliveTime, KeepAliveInterval
  1. The output should show again:
KeepAliveTime KeepAliveInterval
------------- -----------------
        30000              1000

Done! 🎉


Optional: Further optimizations

These steps are optional and can help additionally:

Optimization A: TCP Auto-Tuning

Copy and paste into PowerShell:

netsh int tcp set global autotuninglevel=normal

Expected output: OK.

Optimization B: Enable TCP Timestamps

Copy and paste into PowerShell:

netsh int tcp set global timestamps=enabled

Expected output: OK.

Checking the optional settings:

netsh int tcp show global

You should see:

  • Autom. Abstimmungsgrad für Empfangsfenster: normal
  • TCP-Zeitstempel: enabled

Troubleshooting

Problem: “Access denied”

Solution: You did not open PowerShell as administrator. Go back to step 1.

Problem: Red error message with “Property already exists”

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).

Problem: After restart, the values are gone

Solution: Run the commands again. Sometimes antivirus software blocks registry changes.

Problem: NinjaTrader still freezes

This optimization helps in about 30% of cases. If the problem persists:

  1. Document when exactly the freezes occur
  2. Check if Rithmic is possible as an alternative
  3. Contact your Prop-Firm Support

Reversing the changes

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.


Summary: All commands at a glance

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

What these changes do

SettingBefore (Default)AfterEffect
KeepAliveTime2 hours30 secondsFaster detection of dead connections
KeepAliveInterval1 second1 secondFast repetitions in case of problems
TCP TimestampsOffOnBetter connection tracking
Auto-TuningNormalNormalOptimal packet sizes

Questions?

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