Tech Setup

NinjaTrader Strategy Builder: Build and Backtest a Rule-Based Strategy Without Coding

Cameron Bennion
·
2025-12-29
·
4 min read
Books, notes and laptop on a study desk
Photo by Yen Vu on Unsplash.

A visual strategy builder makes it easy to produce a backtest that looks great and means very little. NinjaTrader 8's Strategy Builder lets you define entry and exit rules by choosing indicators and conditions from menus, and it generates the NinjaScript for you. The tool is fine for testing ideas. The hard part is the testing discipline around it, and that is where most first strategies fail.

When Strategy Builder fits

It suits rules built from standard indicators (a moving average cross, an RSI threshold, price versus VWAP), simple entries and exits, and quick prototypes you want to test before spending time on code. It doesn't suit logic that depends on a sequence across many bars, custom calculations that no stock indicator provides, or tight control over order handling. Those need NinjaScript in C#.

Existing YMI automated strategies have their own written specs. For how they actually behave, read the KPL bot specs and the Marty bot specs. A builder-made strategy shouldn't be assumed to reproduce either one.

Building a simple rule set

Your next step

Review the setup before you automate it.

Read the NinjaTrader setup and strategy limits, then test in SIM. YMI bot access belongs to Pro. Check your broker or prop firm's rules before enabling automation.

In the Control Center, open New and choose Strategy Builder. Screen names and layout shift between 8.x versions, so I'll describe the tasks and you can match them to the NinjaTrader 8 help guide.

  1. Name the strategy so you can find it later, for example VWAP_Pullback_Test.
  2. Add the indicators you need. Here that is VWAP and RSI with a 14 period. The instrument and bar interval get chosen when you run the strategy, so write the rules without depending on them.
  3. Define the long entry conditions. Close[0] < VWAP[0] means the current close is below VWAP. Close[0] > Close[1] means the bar closed higher than the prior bar. RSI[0] < 40 adds a weak-momentum condition. All three must be true at once.
  4. Add the action: enter long, 1 contract, with an order label you'll recognize in the trade list.
  5. Add the exits. A fixed 8-tick stop and 16-tick target on ES is $100 risk and $200 reward per contract, or $10 and $20 on MES. A volatility-scaled stop is possible too, but whether the builder supports it directly depends on your version.
  6. Set the strategy to exit on session close if you don't want positions held through the daily break.
  7. Open the generated code in the NinjaScript Editor, read it, and compile it.

For a short, invert the comparisons. These thresholds are placeholders to learn the tool with. The rule set buys weakness, and nothing here has been validated.

Backtesting in Strategy Analyzer

Backtests run from New, then Strategy Analyzer, not from the strategy list. Choose the front-month contract and check how your historical data handles rollovers. A suspiciously short history usually means a bad contract merge. Pick bar type, date range, commission and slippage, and look at how the analyzer treats limit order fills. A limit order filled the moment price touches it is more generous than a real queue.

Costs matter more than most people expect. Here is a hypothetical: a strategy shows 500 points of gross profit over 400 trades.

ItemHypothetical value
Gross profit, 500 ES points$25,000
Slippage, 1 tick per side (0.5 point round trip)$25 per trade
Commission, round trip (use your own rate)$4 per trade
Total cost, 400 trades at $29$11,600
Net after costs$13,400

More than 46 percent of the gross result disappeared, and a strategy with a smaller average win per trade would have been wiped out. Always run with costs on.

Reading the results

Look at net profit after costs, maximum drawdown, average win and average loss, and expectancy per trade: win rate times average win, minus loss rate times average loss. Ask whether you could sit through the worst drawdown, and whether your account's loss rules would allow it. There's no profit factor or trade count that certifies an edge. Thirty trades can't separate skill from luck, and hundreds of trades from one market regime may not carry over to another. Check whether one stretch of the test produced most of the profit.

Overfitting and the out-of-sample check

Adding conditions until the equity curve looks perfect is curve fitting. The standard guard is a split by date. As an example, tune on 2019 to 2022 and test on 2023 to 2024 data you haven't touched. Once you look at the second period and go back to tweak the rules, it is no longer out of sample. Passing the split doesn't prove the strategy will work forward. It only means it didn't fail the one check you set up.

Before real money

Treat builder output as functional, not tuned. Run it on a SIM account and watch the actual orders: do the stop and target appear at the right prices, do they cancel properly, what happens on a disconnect or around a contract roll. Selecting the SIM account and connecting to Playback are separate steps, so check which you're on. SIM fills don't recreate live slippage, queue position or how you react under pressure, so a good SIM run is a bug check, not live proof.

Tags:

About the Author

Cameron Bennion
Cameron BennionAbout Cameron →

Founder, Young Money Investments · Quant Trader

Cameron trades ES, NQ, and futures across multiple market cycles. He founded Young Money Investments to teach systematic, data-driven trading and manages Magnum Opus Capital. His work emphasizes documented rules, risk controls, and review over outcome promises.

Systematic Futures TradingHedge Fund Manager, Magnum Opus CapitalRisk-First EducationNinjaTrader SpecialistFutures: ES · NQ · RTY · CL · GC
Learn the daily planning process:7-Day Free Trial →

Free, No Credit Card

Get the Free Room Preview

See how the room works before choosing a membership. Follow a setup in SIM and review what happened.

🔒 Your information is secure. We respect your privacy and will never spam you.

Risk Disclosure & Disclaimer

Educational Purposes Only: The content provided in this blog is for educational and informational purposes only. It does not constitute financial, investment, or trading advice. Young Money Investments is not a registered investment advisor, broker-dealer, or financial analyst.

Risk Warning: Trading futures, forex, stocks, and cryptocurrencies involves a substantial risk of loss and is not suitable for every investor. The valuation of futures, stocks, and options may fluctuate, and as a result, clients may lose more than their original investment.

CFTC Rule 4.41 - Hypothetical or Simulated Performance Results: Certain results (including backtests mentioned in these articles) are hypothetical. Hypothetical performance results have many inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program.

Testimonials: Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

Review the setup before you automate it.

Read the NinjaTrader setup and strategy limits, then test in SIM. YMI bot access belongs to Pro. Check your broker or prop firm's rules before enabling automation.

Pro is $795/month. No trial. Start in SIM.