Automation

NinjaTrader 8 Automated Trading: A Practical Setup Guide

NinjaTrader 8 automated trading runs through NinjaScript strategies that you enable on a chart or in the Strategies tab and research in the Strategy Analyzer. This guide covers the setup order and the settings that decide what happens when something breaks.

PraxAI Editorial TeamNov 7, 2026 · 8 min read
Automation
On this page
  1. 01What is a NinjaScript strategy?
  2. 02How do you start NinjaTrader 8 automated trading on a chart?
  3. 03Why run in simulation first?
  4. 04Strategy Analyzer versus live results: what is the difference?
  5. 05Which order handling and connection loss settings matter?
  6. 06Do you need a VPS to run NinjaTrader 8 strategies?
  7. 07Is automation allowed on a prop firm account?
  8. 08Frequently asked questions

The short answer

NinjaTrader 8 automated trading means running a NinjaScript strategy: C# code that places orders for you. Enable it from a chart or the Strategies tab, test on the Sim101 account first, and treat Strategy Analyzer results as historical estimates. Check start behavior and connection loss handling before going live, because the default start mode does not check your account position. Whether a prop account permits automation is the firm's decision.

Key takeaways

  • A NinjaScript strategy is C# code that submits and manages orders inside NinjaTrader 8, whether you write it, generate it in the Strategy Builder or import it.
  • The default start behavior, Wait until flat, does not check your account position, so start with the account flat or read the sync documentation first.
  • Strategy Analyzer fills are estimates from bar data, and NinjaTrader documents why real-time results can differ.
  • Connection loss handling and realtime error handling decide how a strategy reacts when something breaks, so find out what the author chose.
  • A VPS keeps the platform running, but whether automation is allowed on a prop account is a question only the firm can answer.

What is a NinjaScript strategy?

NinjaTrader 8 automated trading runs through NinjaScript strategies: C# code that lives inside the platform and submits, changes and cancels orders by its own rules. A strategy reads its data series and indicators, applies its logic and sends orders to the account you assign.

You can get one three ways: write it in the NinjaScript Editor, generate it with the Strategy Builder, or import an archive through Tools, Import, NinjaScript. NinjaTrader's import page advises importing only from a trusted source. Imported code may not let you read the logic, which matters when you need to know why an order went out.

The settings that govern failure deserve as much attention as the entry signal, so most of this guide covers them. Labels below come from NinjaTrader's help guide as read in November 2026. Check the current guide for your build.

  • Strategy Builder: generates a NinjaScript strategy from rules you select, for simpler logic.
  • NinjaScript Editor: full C# control over entries, exits and risk checks.
  • Imported archives: convenient, but you may only know what the author documents.

How do you start NinjaTrader 8 automated trading on a chart?

Open the Strategies window from the chart's right-click menu, the toolbar icon or Ctrl+S. Add the strategy from the Available list, set its properties, set Enabled to True and click OK, as described in the chart guide. The platform must be connected to a brokerage or data vendor, though Replay and Simulated Data Feed connections also work. A strategy started from the Strategies tab in the Control Center runs without appearing on a chart.

Three properties deserve a second look. Account decides whether orders go to simulation or to a live connection. Data Series decides what the strategy sees, so logic built for one-minute bars will behave differently on another series. Exit on close covers the end of the session, so know how it is set before you hold through one.

Start behavior is where the name misleads. The default is Wait until flat, and per NinjaTrader's syncing page it does not check or change your account position. It waits for the strategy's own virtual position to reach flat, then sends live orders. If the account holds a position at that moment, the two will be out of sync. The synchronize options can close or place live trades, and Adopt account position appears only if the developer built the strategy for it.

After enabling, open the Strategies tab. It shows strategy position, account position and a Sync column. Two more documented traps: manually cancelling a strategy order can stop the strategy from executing as expected, and clicking Close on an account and instrument with a running strategy disables it.

Why run in simulation first?

Because it is the cheapest place to learn that a strategy double-enters or ignores its stop. Select Sim101 and the strategy trades through NinjaTrader's simulation engine, which weighs volume, time in the order queue and random delays instead of filling whenever price touches your order. The fills are still estimates, with no real order in the market.

Write down the behaviours you are checking before you start, so a quiet week does not pass for a successful test. Run at least one full session, including the open and the close, plus a news release day if the instrument reacts to them. Compare what the strategy did with what you expected, order by order.

To repeat a specific session, the Playback connection replays recorded data. NinjaTrader calls Market Replay data its most accurate option and says Playback from start is useful for strategy testing. It also notes that simulated internet latency is absent in playback, so fills there can differ from Sim101.

Log every surprise: a rejected order, a stop that moved late, a position that stayed open after you disabled the strategy. Those are far cheaper to find here than on an evaluation account with a loss limit behind it.

  • Does every entry have a protective stop attached, at the price you expect?
  • Does the strategy stay at the position size you set after partial fills?
  • What happens to orders and the position when you disable it?
  • Does the Sync column stay true after you trade the same instrument by hand?
  • Does it respect a daily loss limit you coded yourself?

Strategy Analyzer versus live results: what is the difference?

The Strategy Analyzer runs a strategy over historical data and covers backtesting, optimisation, walk-forward optimisation, basket testing and Monte Carlo simulation, as listed on NinjaTrader's Strategy Analyzer page. It tells you how the rules would have behaved under the simulation's assumptions. It says little about how they will fill tomorrow.

NinjaTrader's discrepancies page gives the reasons. Backtests can only use each bar's open, high, low and close, so an order may fill in a test and not in real time. Backtests also process at bar close, while a real-time strategy can process each tick, so a condition can be true inside a bar and false at its close. For method, see how to backtest an EA, and for live fills, slippage and execution.

Do not optimise until a result looks good and then call it validated. Parameters tuned to one stretch of history tend to fit that stretch, as EA optimisation and overfitting explains. Walk-forward testing shows whether settings hold on data they were not tuned on, and live results can still differ.

Strategy AnalyzerSim101 accountLive account
DataHistorical dataLive or simulated feedLive market data
FillsEstimated from bar values, order price and fill algorithmModelled from volume, queue time and random delaysReal, set by bid, ask and available volume
ProcessingAt bar closeCan run on each tickCan run on each tick
SlippageA setting you enterNo real order in the marketReal
Best used forTesting logic and parametersTesting order handling and behaviourOnly after the first two look sound
Main riskOverfitting to the pastA false sense of fill qualityReal money and real rule limits

Which order handling and connection loss settings matter?

The strategy author sets how it reacts to broken connections and rejected orders. NinjaTrader's reference pages show both as properties set in the strategy's code, so if you did not write it, ask the author what they chose.

On connection loss, the ConnectionLossHandling page lists three options, with Recalculate as the default. A strategy stops if the data feed is down longer than DisconnectDelaySeconds, if the order feed is down and the strategy tries an order action, or if both feeds are down longer than that delay. If the connection returns before any of that, Recalculate keeps running without recalculating.

On rejected or failed orders, the RealtimeErrorHandling page makes StopCancelClose the default. It warns that IgnoreAllErrors can have serious adverse effects unless you have programmed your own rejection handling.

SettingOptionWhat NinjaTrader documents
Connection lossKeepRunningResumes on reconnect as if no disconnect occurred
Connection lossRecalculate (default)If it was stopped, tries to recalculate strategy position on reconnect
Connection lossStopStrategyStops when disconnected past the delay, no action on reconnect
Realtime errorsStopCancelClose (default)Stops, cancels working orders, closes positions the strategy manages
Realtime errorsStopCancelCloseIgnoreRejectsSame on all errors except order rejections
Realtime errorsIgnoreAllErrorsKeeps running, your code must handle rejections

Worked example

Illustrative numbers only. A strategy holds 2 contracts long with Recalculate selected and DisconnectDelaySeconds at 60. If the data feed drops for 90 seconds, 90 is past 60, so the strategy stops and tries to recalculate its position on reconnect. If the feed drops for 40 seconds, the strategy keeps running with no recalculation. Either way, check the Strategies tab afterwards. Suppose you closed 1 contract by hand meanwhile: the account position is then 1 long while the strategy position can still read 2 long. The account position is the real one.

Do you need a VPS to run NinjaTrader 8 strategies?

No, but a strategy only trades while NinjaTrader is running and connected. A laptop that sleeps, updates or loses wifi will interrupt it. A VPS is a remote machine that stays on, so the platform keeps running when your own computer is off.

It adds its own failure points: remote desktop sessions, memory limits and connection routes you cannot see. Test the whole setup in simulation on the VPS, and check what happens to the strategy after a reboot. The trade-offs are covered in VPS versus a local PC for a trading bot.

A VPS removes one cause of interruption and adds no trading edge. It also does not change what a firm permits. If a policy limits where or from which device you trade, read it in the firm's terms before you set anything up, as IP and device rules describes.

  • Match the operating system to NinjaTrader's minimum requirements, which listed Windows 11 or Windows Server 2016 or later, 64-bit, as read in November 2026.
  • Know which connection loss option the strategy uses before you leave it unattended.
  • Keep a way to flatten the account that does not depend on the strategy itself.
  • Never assume a restart restores a position correctly. Compare strategy and account position.

Is automation allowed on a prop firm account?

Whether NinjaTrader can run it and whether a firm allows it are separate questions. Automation in futures depends on each firm's policy, which can differ by account type and platform and can change over time. Confirm with the firm directly before you enable anything on an evaluation or funded account.

The general picture is in futures prop firm automation rules, and the platform comparison is in NinjaTrader versus MetaTrader for prop firms.

PraxAI publishes this blog and sells automation software, so weigh that. It supports NinjaTrader 8 for futures. On that platform, treat PraxAI GUARD as a risk control only and test it on a demo account, which you can do only after purchase. Confirm with your firm that automation is permitted before relying on any of it.

Frequently asked questions

Can I run an automated strategy on NinjaTrader 8?

Yes. NinjaTrader 8 automated trading uses NinjaScript strategies that you write, generate with the Strategy Builder or import. Enable one from a chart or the Strategies tab, assign an account and start on simulation. Whether you may use it on a prop account depends on that firm's policy.

Does a NinjaTrader strategy wait for my account to be flat before it trades?

Not exactly. The default, Wait until flat, does not check your account position. It waits for the strategy's own position to reach flat, then goes live. If the account holds a position at that point, the two are out of sync.

Is the Strategy Analyzer result what I will get live?

No. It estimates fills from historical bar values, and NinjaTrader documents why real-time results can differ. Use it to test logic, then check order handling on a simulation account.

What happens to my position if my connection drops?

It depends on the strategy's ConnectionLossHandling setting: KeepRunning, Recalculate or StopStrategy. After any outage, compare strategy position with account position in the Strategies tab.

Do I need a VPS for NinjaTrader 8 automated trading?

Not strictly, but a VPS keeps the platform running when your own computer is off. Test the whole setup in simulation on it first, and check what happens after a reboot.

Educational content, not financial advice. Trading leveraged products carries a high risk of loss, and no strategy or software guarantees a pass or a payout. Prop firm rules differ by account type and change over time, so check the current terms on the firm's own site before you trade.

Keep reading

Want the bot that runs this discipline for you?

PraxAIPraxAI™

The AI trading system that passes prop firm challenges and protects your funded accounts, hands free. Join 2,000+ traders running it today.

7-Day Money-Back
Secure Payment
Instant Delivery

Legal Disclaimer

PraxAI is not a broker and not a prop firm, and we do not open or provide trading accounts. Our software is not affiliated with, endorsed by, or sponsored by any of the prop firms named on this site; those names appear for compatibility reference only. Trading forex and leveraged products carries significant risk and is not suitable for every investor, so weigh your financial situation and risk tolerance carefully before trading. The bot and all material on this site are provided for educational and informational purposes only and do not constitute financial, investment, or trading advice. PraxAI is not a licensed financial advisor and does not provide advisory services.

Not Affiliated With Meta / Facebook

This site is not part of the Facebook or Meta websites and is not endorsed by Meta Platforms in any way. FACEBOOK is a trademark of Meta Platforms, Inc.

Earnings & Risk Disclaimer (U.S. Government Required)

Trading forex on margin offers large potential rewards but also a high level of risk. You must be aware of those risks and willing to accept them before trading the forex markets. Do not trade with money you cannot afford to lose. No representation is made that any account will, or is likely to, achieve profits or losses similar to anything discussed on this site. The past performance of any system or methodology is not necessarily indicative of future results.

CFTC Rule 4.41(b)(1) / NFA Rule 2-29

SIMULATED OR HYPOTHETICAL PERFORMANCE RESULTS HAVE INHERENT LIMITATIONS. UNLIKE AN ACTUAL TRACK RECORD, THESE RESULTS DO NOT REPRESENT REAL TRADING, AND BECAUSE THE TRADES WERE NOT ACTUALLY EXECUTED THEY MAY HAVE UNDER OR OVER COMPENSATED FOR MARKET FACTORS SUCH AS LACK OF LIQUIDITY. HYPOTHETICAL PROGRAMS ARE ALSO DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES LIKE THOSE SHOWN. IN PRACTICE THERE ARE OFTEN SHARP DIFFERENCES BETWEEN HYPOTHETICAL RESULTS AND THE ACTUAL RESULTS LATER ACHIEVED BY ANY TRADING PROGRAM. HYPOTHETICAL TRADING ALSO INVOLVES NO FINANCIAL RISK, AND NO HYPOTHETICAL RECORD CAN FULLY ACCOUNT FOR THE IMPACT OF FINANCIAL RISK IN REAL TRADING.

Trading on a live account can lose real money, and the owners of PraxAI (praxai.io) cannot be held accountable for any losses that may occur, including losses arising from possible software bugs, glitches, or malfunctions.

PraxAI and its owners assume no responsibility for errors, inaccuracies, or omissions in these materials and do not warrant the accuracy or completeness of any information, text, graphics, links, or other items contained in them. PraxAI and its owners are not liable for any special, indirect, incidental, or consequential damages, including lost revenue or lost profits, that may result from these materials.

We assume you are legally permitted to purchase and use our products. Following the global and local laws and regulations that apply to you is your responsibility, and we cannot be held responsible for any damages or legal action against you arising from those regulations.

All information on this website, and any software or guide purchased from it, is for educational purposes only and is not intended as financial advice. Any statement about profit or income, express or implied, is not a guarantee. Your own trading may result in losses, as no trading system is guaranteed. You accept full responsibility for your actions, trades, and any profit or loss, and you agree to hold PraxAI (praxai.io) and any authorized distributors of this information harmless.

Important Notices

Risk of loss: forex trading carries a high level of risk and may result in the loss of your entire investment. No guarantees: past performance does not indicate future results, and there is no assurance you will achieve the same outcomes. Liability: we are not responsible for any losses incurred from using this bot, and by using it you agree to hold us harmless from any and all liabilities or damages. None of our services or information should be considered financial advice. All rights reserved. Using this website or its contents means you accept this disclaimer.

© 2025 PraxAI™ · All rights reserved.