Random-Forest Machine Learning Indicator for NinjaTrader 8

Created 05 Apr 2026 · Updated 12 Apr 2026

This Machine Learning based indicator for NinjaTrader 8 is a Free, powerful predictive tool built on a Random Forest regression algorithm, forecasting future price movements from a sophisticated analysis of multiple market features and technical confluences.

Prerequisites

To properly use this indicator you should have the following prerequisites available.


Description

Algorithm Overview

The indicator uses a Random Forest machine learning model, trained on historical market data, to predict price movements a specific number of bars into the future (20 bars on the 1-minute timeframe). Random Forest is an ensemble learning method that combines multiple decision trees to provide robust and accurate predictions — reducing overfitting and improving prediction accuracy by aggregating results from multiple independent models.

Feature Engineering

The Random Forest model analyzes a comprehensive set of features extracted from price action, including:

  • Previous Day Reference Points: distance from the previous day's high and low prices, for overnight gap analysis and potential support/resistance levels
  • Current Day Reference Points: distance from the current day's high and low prices, capturing intraday momentum and range dynamics
  • Higher Timeframe Data: distances from 30-minute and 4-hour timeframe highs and lows, for multi-timeframe signal confirmation
  • Technical Indicator Confluence: price proximity to SuperTrend levels and other proprietary indicators, identifying key levels where multiple analyses converge
  • Volume Analysis: volume differential compared to the previous bar, capturing changes in market participation and trading intensity
  • Price Action Patterns: close price differences over multiple periods, detecting momentum shifts and trend changes
Technology Stack

This indicator is powered by Microsoft's ML.NET library, a professional-grade machine learning framework providing high-performance model training and inference, suitable for real-time trading applications.

Training Data

The model has been trained on extensive historical data capturing various market conditions, volatility levels, and price patterns, so it has learned diverse market behaviors and can adapt to different trading environments.

Prediction Output

The indicator generates predictions as expected price movements (in points) for the next 20 bars. When the predicted movement exceeds the user-defined threshold, a signal is generated — bullish when the model predicts positive price movement, bearish when it predicts a downward move.

Signal Integration & Automation

The entry signals generated by this indicator can be seamlessly integrated with third-party trading software such as AlgoStudio and Bloodhound, letting you automate your trading strategies based on the machine learning predictions — opening up automated order placement and position management.

Audio Notifications

Real-time sound alerts trigger whenever an entry signal is generated, so you never miss an opportunity even when away from your screen — customizable to any .wav file on your computer.

Examples

All the examples below are on the MES instrument, with a prediction threshold of 10 points.

Example 1: Strong Sell Signals on a Bearish Trend

The indicator predicts continuation of a sell trend by generating a series of sell signals, which were confirmed and would have been profitable if taken — generated during RTH (regular trading hours), where volume is considerably high on MES.

Strong Sell signals on a bearish Trend
Click to enlarge
Example 2: Strong Buy Signal, but Where Placing the Stop Loss Is Crucial

A bullish buy signal occurs, but price action later pulls back into the FVG that created the entry signal — a reminder to always add a buffer of points to the FVG wick that created the entry, to avoid getting stopped out by price pullbacks.

Strong Buy signal but where putting the stoploss is crucial
Click to enlarge
Example 3: Not All Signals Are Perfect, but Previous Signals and Context Matter

The indicator generates a bad bullish signal — but it was preceded by a group of strong bearish signals, and the last group of bearish signals confirms the bearish trend continuation, showing why context around a signal matters.

Not All signals are perfect but previous signals and context is important
Click to enlarge
Example 4: Continuation Signals & Reversal Signals

The indicator can generate both reversal and continuation signals. Reversal signals are distinguished by being generated after an opposite-direction FVG — e.g. a bearish reversal signal generated after a bullish FVG followed by a red candle.

Continuation Signals & Reversal Signals
Click to enlarge

Signals & Usage in Strategy Builder

The indicator exposes signal plots that can be used from the Strategy Builder and third-party software such as Bloodhound and AlgoStudio.

These signal plots are transparent and are not drawn on the chart. To use them from the Strategy Builder, select them and build logic on their values — the Buy signal and Sell signal plots hold +1 for bullish signals and -1 for bearish signals, otherwise 0. So a bullish signal condition should check "greater than 0", and a bearish signal condition should check "lower than 0".

Strategy Builder example showing signal usage
Click to enlarge

Parameters

We always try to keep the parameters to a minimum.

License
LicenseThis is the free license key you get when you create an account on automated-trading.ch. After creating an account, copy your license key from the billing page. You need to set this parameter only once per month. This indicator is totally free to use, but you need to register for a free account and license to use it.
ML Settings
Model FileThe full path to the trained machine learning model file (.zip format) — download it from the Installation section below and specify the full path. The model file contains the trained Random Forest regression algorithm used for predictions.
Prediction Threshold PointsMinimum predicted price movement (in points, from 0 to any positive number) required to generate a signal. The higher this value, the fewer signals produced. Default value: 10 points.
Rendering
Bullish Color / Bearish ColorColor used to render bullish/bearish signals and indicators.
Sound Alert
Play SoundEnables/disables playing a sound when a signal is generated.
Play Sound FileSets which .wav file is played on the sound alert.

Download & Installation Instructions

License Requirements

At automated-trading.ch you can choose to either purchase a monthly subscription to use our premium products, or use our free products without subscribing.

In both cases, you need to create an account so you can get a License you can use for both premium and free products.

To obtain your license, simply sign up and then get your license on the billing page.

Important: This is a Free product — no paid subscription is required to run it live, though creating an account is still required to get your license.
Download
Sign in to download this file.
Latest Version v1.1.0.0 · Published 5 months ago
This file was downloaded 64 times. Last download was 1 week ago.

You can also download this strategy — and every other automated-trading.ch strategy or indicator — anytime from your centralized Downloads page.

Installation Steps
1
Download the Random Forest model file for your instrument (training is specific to each instrument and timeframe — a model is provided per instrument on the 1-minute timeframe).
2
Download and extract the Microsoft.ML runtime dependencies into your NinjaTrader Custom bin directory (C:\Users\{Your Windows Username}\Documents\NinjaTrader 8\bin\Custom\) — make sure the DLL files land directly in that folder, not a subfolder, and don't overwrite a newer version already there.
3
Import the downloaded .zip file into NinjaTrader using the Import NinjaScript menu item.
4
Open a new chart window, loading at least two days of data — the indicator needs data from the previous day to function properly.
5
Right-click the chart and choose Indicators... to add the indicator to the chart, pasting your license (found on the billing page) as you do.
6
Specify the model file's full path in the Model File parameter — or leave it empty and the indicator will show a Browse File dialog to select the model .zip file.
7
After that, the indicator runs on the chart's historical data first, then continues to run on live market data.

Frequently Asked Questions

General

Yes — if you have an idea that you believe can improve this indicator, use the contact page to send us a message.

No, the source code of the indicator is protected for copyright reasons.

No, this indicator only does rendering and doesn't provide data that can be used from within a strategy — check out our other strategies for one based on this same concept.

Yes, you can use this indicator without TickReplay, but bear in mind that in this case the indicator will not detect events on historical candles — it will only start detecting them on real-time volume and price data.

That's expected — this indicator is completely free to use, but it requires a free license obtained by registering a free account, and that license is re-verified by the indicator every month. When you see the License expired message, just copy/paste your free license key into the License parameter and hit Apply or OK — this refreshes the license validity for one more month. You'll need to do this every month.

Release Notes

  • Updated Random Forest Model with two new Time-Sessions features; requires updating Model to 20260410-suffixed file version

  • Bug Fix: real-time prediction executed each tick freezing NT/computer; now executes on bar close

  • First Release of the Machine Learning Indicator
discord
Join our Discord community
Questions, feedback, or just want to chat with other traders? Come say hi.
Join Discord
Quick Facts
Platform NinjaTrader 8
Category Indicator
Plan Required Free
Latest Version v1.1.0.0
Last Updated 5 months ago
Downloads 64