Random-Forest Machine Learning Indicator for NinjaTrader 8

NinjaTrader 8 Indicator Published 06 April 2026
PREMIUM
Description

This Machine Learning based Indicator for Ninjatrader 8 is a powerful predictive tool built on a Random Forest regression algorithm. This indicator leverages advanced machine learning techniques to forecast future price movements based on a sophisticated analysis of multiple market features and technical confluences.

Algorithm Overview:

The indicator uses a Random Forest machine learning model, trained on historical market data from 2024 to current market data (April 2026 on the time of writing this page), to predict price movements a specific number of bars into the future (20 bars when in 1 minute timeframe). Random Forest is an ensemble learning method that combines multiple decision trees to provide robust and accurate predictions. This approach reduces overfitting and improves 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 previous day's high and low prices, providing context 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, incorporating multi-timeframe analysis for enhanced signal confirmation
  • Technical Indicator Confluence: Price proximity to SuperTrend levels and other proprietary indicators, identifying key technical 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 the Microsoft .NET Machine Learning (ML.NET) library, a professional-grade machine learning framework that provides high-performance model training and inference. The use of ML.NET ensures reliable, fast, and accurate predictions suitable for real-time trading applications.

Training Data:

The model has been trained on extensive historical data from 2024, capturing various market conditions, volatility levels, and price patterns. This training ensures the model has learned diverse market behaviors and can adapt to different trading environments.

Prediction Output:

The indicator generates predictions in the form of expected price movements (in points) for the next 20 bars. When the predicted movement exceeds the user-defined threshold, a signal is generated. Bullish signals appear when the model predicts positive price movement, while bearish signals indicate predicted downward price movement.

Signal Integration & Automation:

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

Audio Notifications:

The indicator provides real-time sound alert functionality that triggers whenever an entry signal is generated. This feature ensures you never miss a trading opportunity by keeping you informed even when you are away from your screen. You can customize the alert sound to any .wav file on your computer, making it easy to distinguish machine learning signals from other notifications in your trading setup.

Examples

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

  • Example 1 : Strong Sell signals on a bearish Trend
  • example1
    Click to enlarge

    On this example you can see the indicator in action predicting continuation of a sell trend by generating a series of sell signals. Those prediction signals were confirmed and would have been profitable if taken. Those signals were generated suring the RTH (Regular trading hours) where volume is considerably high on MES

  • Example 2 : Strong Buy signal but where putting the stoploss is crucial
  • example2
    Click to enlarge

    In this example, we can see a bullish buy signal. But later price action pulled back into the FVG that created the entry signal. This makes us always consider a buffer points to add to the FVG wick that created the entry in order to not get hit by price pullbacks

  • Example 3 : Not All signals are perfect but previous signals and context is important
  • example3
    Click to enlarge

    In this example, we can see where the indicator generates a bad bullish signal. But as you can see, this bullish signal was preceeded by a group of strong bearish signals. You can also see the last group of bearish signals that confirm the bearish trend continuation

  • Example 4 : Continuation Signals & Reversal Signals
  • example4
    Click to enlarge

    This example shows that the indicator is capable of generating both reversal and continuation signals. Reversal signals are distinguished by the fact that they are generated after an opposite direction FVG. For example the first bearish reversal signal on the chart example above is generated after a bullish FVG followed by a red candle

    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

    Those signal plots are transparent and are not drawn on the chart. To use them from the strategy builder you can select them and build a logic upon their values like this example where you are creating a condition based on the sell signal generated by the indicator. The Buy signal and the sell signal plots will contain the values of +1 for bullish signals and -1 for bearish signals, otherwise they have the value 0. So to detect a bullish signal you should set a condition of Greater than 0, and for a bearish signal you should set a condition of lower than 0.

    machine-learning-signals
    Click to enlarge
    Parameters

    We always try to keep the parameters to minimum.

    License
    License This 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, once the license key is validated it will be remembered for the rest of the billing cycle. This indicator is totally free to use, but you need to register to have a free account and License to be able to use it.
    ML Settings
    Model File This is the full path to the trained machine learning model file (.zip format). You need to download the model file from the installation section below and specify the full path to it. The model file contains the trained Random Forest regression algorithm that is used for predictions.
    Prediction Threshold Points This parameter sets a threshold from 0 to infinite positive numbers that will be the minimum predicted price movement (in points) to generate a signal. The more you increase this value the less signals you will obtain. The default value is 10 points
    Rendering
    Bullish Color The color to use for rendering bullish signals and indicators
    Bearish Color The color to use for rendering bearish signals and indicators
    Sound Alert
    Play Sound Enable/Disable playing a sound when a signal is generated
    Play Sound File This parameter will set the file name to be played on sound alert. This can be set to any .wav file on your computer
    Download & Installation Instructions
    Step 1 : Downloading Random-Forest model files for each instrument

    Training a Random-Forest model is specific to each instrument and timeframe. This is why we provide a model for each instrument on the 1 Minute timeframe

    • Download those .zip Files into any folder. By preference to C:\Users\{Your Windows Username}\Documents\ATCHMachineLearningIndicator
    • This folder should be used when selecting Model File parameter on the indicator later on
    • Don't extract these files. The Machine learning model is the .zip file
    Step 2 : Downloading and Installing Microsoft.ML Dependencies

    The Machine Learning Indicator requires Microsoft.ML runtime dependencies to function properly. These dependencies need to be installed in your NinjaTrader Custom bin directory.

    • Download the Microsoft.ML-dependencies.zip file
    • Extract the downloaded .zip file into your NinjaTrader Custom bin directory located at: C:\Users\{Your Windows Username}\Documents\NinjaTrader 8\bin\Custom\
    • If you already have a file with a newer version on the location, don't overwrite it
    • Make sure all the DLL files are extracted directly into the Custom bin directory (not in a subfolder)
    Step 3 : Ninjatrader Indicator
    • Click on the below download button to download the ATCHMachineLearningIndicator file
    • This file was downloaded 3 times. Last download was 1 hour ago
    • Import the downloaded .zip file into NinjaTrader using the import NinjaScript menu item
    • how to import add on to NinjaTrader
    • Next, open a new chart window and make sure to load at least Two days of data into the chart since the indicator will need data from previous day to properly function
    • image
    • After installing the indicator and opening a new Chart window you should add the indicator to the chart. Right-click on the chart and click on Indicators...
    • image
    • While adding the indicator you should copy/paste your Free License that you can find on the Billing page
    • And you should specify the model file full path into the Model File parameter. You can leave the parameter value empty and the indicator will show a Browse File dialog box to select the model .zip file
    • After that, the indicator is added with success and will execute on Historical Data and then will continue to run on live market data
    Frequently Asked Questions
    General
    Can I ask you to modify/add a new feature to this Indicator?

    Yes, If you have an idea that you believe can improve this indicator, I will be more then happy to hear from you. Please use the contact page to send me a message

    Will I get the source code of the indicator when I download it?

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

    Can this indicator be used in a strategy?

    Yes. This indicator can generate signals that can be used in strategy builder or 3rd part software such as Bloodhound or AlgoBuilder

    Can I use this indicator without the TickReplay mode enabled?

    Yes it is recommended to use this indicator without TickReplay

    This indicator is Free but I see Licensed Expired message when I try to use it

    Yes this indicator is completely free to use. But it requires a free license that you get by registering a free account. And the license is verified each month by the indicator. When you see the License expired message, you just need to copy/paste your free license key into the License parameter and then hit Apply or Ok. This is will refresh the license validity for one extra month. You should do this every month

    Release Notes
    Release 1.0.0.0 - 06 April 2026

    • First Release of the Machine Learning Indicator

    User Comments & Feedback

    You can find feedback of our users and ask questions about this strategy by joining our discord community by following this invite link or clicking on the Discord logo image. Joining is completely free discord-invitation