NinjaTrader Strategy Builder: Build Your First Strategy Without Coding

March 24, 2026

NinjaTrader Strategy Builder: Build Your First Strategy Without Coding

March 24, 2026

NinjaTrader's Strategy Builder lets you create automated trading strategies by clicking through a visual interface — no programming knowledge required. You define your entry conditions, exit conditions, and risk rules by selecting from drop-down menus, and NinjaTrader generates the underlying NinjaScript code for you. This guide walks through building a simple moving average crossover strategy from scratch, running a backtest on it, and reading the results.

Conditions Entry / Exit Risk Rules Backtest → EMA cross? Buy / Sell Stop / Target Perf report
Strategy Builder workflow: define conditions → entries and exits → risk rules → run backtest

1. Open the Strategy Builder

  1. In the NinjaTrader Control Center, click New > Strategy.
  2. A dialog asks how you want to create the strategy. Select Strategy Builder (not "NinjaScript Editor").
  3. A new wizard-style window opens with tabs across the top: General, Inputs, Conditions, Entries, Exits, and so on.

Work through the tabs from left to right. Each tab builds on the previous one.

2. General Tab — Name and Basic Settings

  • Name — give your strategy a descriptive name, e.g. EMA Crossover 9-21.
  • Description — optional, but useful if you build many strategies.
  • Default quantity — set to 1 contract to start. You can change this before each backtest.
  • Calculate on bar close — leave this checked for most strategies. It means signals fire at the close of each bar rather than on every tick, which avoids a lot of backtest noise.

3. Inputs Tab — Define Your Variables

Inputs are the adjustable parameters of your strategy — things like indicator periods and stop sizes. Defining them here means you can change them from the backtest settings screen without re-opening the Strategy Builder.

For our example strategy, add two inputs:

  • FastPeriod — type: int, default value: 9
  • SlowPeriod — type: int, default value: 21

Click the Add button, fill in the name and default value, and click OK for each one.

4. Conditions Tab — Define Your Entry Logic

This is the core of the strategy. You are telling NinjaTrader: "when this happens, consider entering."

We want to go long when the 9-period EMA crosses above the 21-period EMA:

  1. Click Add Condition Set and name it Long Entry Condition.
  2. Click Add Condition.
  3. In the condition editor:
    • Condition 1: Set to EMA(FastPeriod) — choose EMA from the indicator list, and type FastPeriod in the period field.
    • Operator: Set to Crosses above.
    • Condition 2: Set to EMA(SlowPeriod).
  4. Click OK.

Add a second condition set for your short entry (EMA FastPeriod crosses below EMA SlowPeriod) the same way, or leave it long-only for a simpler first test.

5. Entries Tab — What to Do When the Condition Is True

  1. Click Add Entry.
  2. Set Condition Set to your Long Entry Condition.
  3. Set Action to Buy.
  4. Set Order type to Market.
  5. Set Quantity to 1 (or link it to the default quantity).
  6. Click OK.

This tells the strategy: when the EMA crossover condition fires, buy 1 contract at market.

6. Exits Tab — When to Close the Trade

You have several options for exits. For a basic first strategy, add two exits:

Stop loss

  1. Click Add Exit.
  2. Set type to Stop Loss.
  3. Set the stop to a fixed number of ticks — for ES, 20 ticks (5 points) is a reasonable starting point.
  4. Link it to your Long entry.

Profit target

  1. Click Add Exit again.
  2. Set type to Profit Target.
  3. Set the target to 40 ticks (10 points) — a 2:1 reward-to-risk ratio.
  4. Link it to your Long entry.

You can also add an Exit on session close to make sure the strategy never holds a position overnight.

7. Generate and Save

Once all tabs are filled in, click Generate NinjaScript (or Finish). NinjaTrader compiles the strategy. If there are no errors, it appears in your strategy list ready to backtest.

8. Running a Backtest

  1. Open a chart of the instrument you want to test (e.g. ES, 5-minute bars, last 6 months of data).
  2. Click the Strategies button in the chart toolbar (the small robot icon), or right-click and select Strategies.
  3. Find your strategy in the list, select it, and click Add.
  4. Set the account to Backtesting and click OK.
  5. NinjaTrader runs the strategy across all historical data on the chart. Entry and exit arrows appear on the chart.

9. Reading the Performance Report

After the backtest runs, a Strategy Analyzer panel opens. The key numbers to look at first:

  • Net Profit — total profit or loss over the test period. A positive number is a good sign, but not the only factor.
  • Win Rate — percentage of trades that were profitable. A strategy with a 2:1 reward-to-risk ratio only needs a win rate above 40% to be profitable overall.
  • Max Drawdown — the largest peak-to-trough loss during the test. This tells you the worst run of bad luck the strategy went through. If your max drawdown is larger than you could stomach financially or emotionally, reduce position size.
  • Profit Factor — total winning trades divided by total losing trades. A profit factor above 1.5 is generally considered decent; above 2.0 is strong.
  • Total Trades — if the strategy only generated 5 trades over 6 months, the results are not statistically meaningful. You want at least 30–50 trades to draw any conclusions.

10. What to Do With the Results

A good backtest result does not guarantee future profits — markets change. But a poor backtest result on a long period of diverse data is a useful signal that the strategy has a flaw worth investigating.

A sensible testing process:

  • Test on at least 3–6 months of data initially.
  • Try different FastPeriod and SlowPeriod combinations using the Optimization feature in the Strategy Analyzer — it runs the backtest across a range of inputs automatically.
  • Once you find settings that look solid, test them on a different time period you did not use during optimisation (called out-of-sample testing). If the results hold up, you have more confidence in the strategy.
  • Run the strategy on paper trading (Sim101 account) for several weeks before going live.

Summary

NinjaTrader's Strategy Builder lets you build, backtest, and optimise a strategy entirely through a point-and-click interface. Define your conditions (EMA crossover), attach entry and exit actions (market buy, stop loss, profit target), generate the code, and run the Strategy Analyzer on historical data. Use the Win Rate, Max Drawdown, and Profit Factor together — not Net Profit alone — to judge whether a strategy is worth testing live.

If you want to go beyond the visual builder and write strategies in code, NinjaTrader uses NinjaScript — a C#-based language. If you are coming from TradingView, Pine Script serves the same role there and is worth learning alongside — the Pine Script cheatsheet is a good starting point. For a head-to-head look at how the two platforms compare for strategy development, see the NinjaTrader vs TradingView guide.