Summary
The Random-Forest Machine Learning Strategy is a Premium mechanical strategy for the NinjaTrader 8 platform. This strategy leverages artificial intelligence and predictive analytics to identify and trade market movements. The strategy can be used to pass trader funding programs
We highly recommend joining our discord community by following this invite link
Index
Prerequisites
To properly use this strategy you should have available the following prerequisites
- NinjaTrader 8. with any license type minimum version 8.1.6.* Click here to download
- automated-trading.ch Account with Premium Subscription
- A pre-trained Machine Learning model .zip file that you can download from this page below from the Installation section
Important Disclaimer
We strongly recommend that you never run your algorithmic trading systems on your hard-earned real money. You should always minimize your risk and run your strategies on trader funding programs so that the maximum amount your risk to lose is the monthly subscription fee you pay those programs.
Here are the trader funding programs that we recommend using, and that we use to run this Machine Learning strategy on:
- Lucid Trading
- Funded Next
- Tradeify
- Apex Trader Funding
- Want to know more about propfirms and how to chose the best one ? Click Here
Strategy Overview
The Random-Forest Machine Learning Strategy represents a cutting-edge approach to algorithmic trading, combining the power of artificial intelligence with robust order management and risk control. This strategy utilizes a pre-trained Random Forest machine learning model (generated for multiple instruments MES, ES, MNQ, NQ...) to predict future price movements.
Unlike traditional rule-based strategies that rely on fixed technical indicators and predefined patterns, the Machine Learning Strategy learns from historical price data to identify complex, non-linear relationships in market behavior. The model analyzes multiple features including daily price levels, support and resistance zones, market structure changes, and volatility indicators to generate highly contextualized trading signals.
The strategy is designed to be fully automatic and can scale into multiple instances on the same or on multiple accounts. It features robust order management with connection loss recovery, precise risk control with dynamic position sizing, and multiple exit strategies including ATM Strategy integration and manual management options.
How It Works
The Machine Learning Strategy operates in several stages:
1. Feature Engineering
The strategy constructs a comprehensive feature set from market data to feed into the machine learning model:
- Daily Levels: Distance from previous day's high, low, and current day's high, low, and open prices
- Higher Timeframe (HTF) Levels: Distance from 30-minute and 4-hour timeframe previous highs and lows to capture medium-term structure
- Volatility Indicators: Distance from SuperTrend upper and lower bands for adaptive volatility measurement
- Volume Dynamics: Volume differences between the current bar and previous bar to capture momentum shifts
- Price Momentum: Close price differences over the last 3 bars to capture recent directional bias
- >Time of Day: Encoded time features to capture intraday seasonality patterns
2. Model Prediction
The pre-trained Random Forest model processes the feature set to predict the close price for a specified prediction horizon (default: 20 bars ahead on 1 minute timeframe). The model generates a prediction score indicating the expected price movement magnitude and direction.
3. Signal Generation
When the predicted price movement exceeds the prediction threshold (in points), the strategy generates a trading signal:
- A long signal is generated when the model predicts upward price movement
- A short signal is generated when the model predicts downward price movement
- Signals are optionally filtered using SuperTrend indicator to reduce false signals in choppy markets
4. Entry Management
The strategy confirms and executes trades based on confirmed signals:
- Only one position per direction can be active at a time
- Market orders are used for instant execution (no pending orders)
- Entry quantity is determined based on the selected quantity strategy (Fixed or Risk Adjusted based on the stoploss level)
- Trades are only allowed within the specified trading time window
As all our strategies, this strategy implements two methods to set quantity for open positions.
- Fixed Quantity: This method will use the same quantity value for each position. If the stoploss is variable between positions (by using a dynamic stop loss value), The win/loss will be also variable between positions
- Dynamic Risk Adjusted Quantity: This method will calculate quantity of each position based on multiple factors:
- The stoploss of the position
- The maximum risk (in $ currency value) allowed for a position to take
- The maximum quantity allowed for a position to take
5. Position Management
Once a position is opened, the strategy manages it using one of several configurable methods:
- ATM Strategy: Delegates position management to your chosen ATM strategy template
- SuperTrend: Uses SuperTrend indicator to trail stop loss and manage exits dynamically
Apart from those position management methods, the strategy allows to set the stop loss based on multiple strategies and to set the take profit based on a ratio based method. Check the parameters section for a detailed explanation
6. Exit Strategies
The strategy supports multiple exit methods:
- Stop Loss: Multiple options including fixed currency amount, points, SuperTrend levels, swing prices, or prediction signal levels
- Take Profit: Can be set as fixed currency, points, stop loss ratio, or predicted price targets
- Session Closing: Automatically closes all positions at end of trading session
- Daily Limits: Stops trading when daily profit target is reached or daily loss limit is hit
- Trade Count Limits: Can stop after reaching maximum daily winning or losing trade counts
Entry Setup Examples
Example #1: Reversal Short Entry
Let's start with the first example. Running on MES 1 minute timeframe, this example shows a reversal short entry setup. The strategy generated a short signal based on the prediction of the model.Reversal signals are generated on the opposite direction following a Fair Value Gap (FVG). When supertrend entry filter is applied to reversal signals, the strategy will only take the reversal signal if the supertrend is green for bearish signals, and red for bullish signals. The same parameters are going to be used for the next examples.
Example #2: Trend Long Entry
This second example runs on the same instrument, timeframe and parameters as the first example. You can see on this example a first signal that was suppressed by supertrend filter. The first signal was a trend long signal, but supertrend was in Red state so the signal was ignored. Then you can see a second trand bullish signal that was generated while the supertrend was in Green state. So the signal was taken. The take profit is the predicted target by the Model, and the stoploss was the opposite of the take profit target in terms of distance from the entry price, so the risk reward ratio is 1:1 in this trade.
Features
The Random-Forest Machine Learning Strategy includes a comprehensive set of advanced features:
Artificial Intelligence-Powered Predictions
- Pre-trained Random Forest model for robust and adaptive price predictions
Advanced Order Management
- No pending orders - only market orders for guaranteed execution
- Robust in-house Order Manager resistant to connection losses
- ATM Strategy integration for user custom defined position management
- Support for both Rithmic and NinjaTrader brokerage Tradovate accounts
Entry Filtering and Confirmation
- Optional SuperTrend entry filter to confirm directional bias
- Configurable prediction threshold to filter low-confidence signals
- Trading time window restrictions
Precise Backtesting
- Compatible with NinjaTrader's official backtesting best practices
- Tick-level execution for highly accurate results
- Support for optimization across all configurable parameters
Parameters
The strategy provides comprehensive parameter control while keeping the most critical settings easily accessible:
| General Settings | |
| Execute Historical Trades | This parameter is very important and should be used carefully. This parameter will enable executing trades when the strategy is run on Historical mode you may check this parameter to test the performance of the strategy on days in the past or to simply test if the used parameters will generate trades on the current day. But when you run the strategy on Live mode, you should uncheck this parameter. |
| Daily TakeProfit Target | Dollar amount target for daily profit. Trading stops when reached after a position is closed (0 = disabled) |
| Daily StopLoss Limit | Dollar amount limit for daily losses. Trading stops when reached, the active trade will be closed if Unrealized Pnl reaches this limit(0 = disabled) |
| Stop @ Winning Count | Stop trading after reaching this number of winning trades per day, a trade is considered a win if its PnL is above 10$ and is considered a loss if below -10$ (0 = disabled) |
| Stop @ Losing Count | Stop trading after reaching this number of losing trades per day, a trade is considered a win if its PnL is above 10$ and is considered a loss if below -10$ (0 = disabled) |
| ML Settings | |
| Prediction Threshold Points | Minimum predicted points movement to generate a trading signal. Filters low-confidence predictions, the recommended value for MES is 10 and for MNQ it should be higher |
| Model File | Path to the pre-trained Random Forest model (.zip file). Model can be selected interactively when the strategy is loaded if not specified |
| Trading Session | |
| Time Zone |
This parameter sets the time zone to be used for the Trade Time parameter below. Since futures markets are open and closed based on US market time zone which is EST (US Eastern, New York), this parameter allows you to avoid adapting the trade time to EST or another timezone if your execution machine is not on the same Timezone as the market. Setting this parameter value to EST will tell the strategy to ignore your local timezone and automatically use EST timezone when running. In the same manner, if you wish to run the strategy based on a CET trade time (suppose you run the strategy on DAX) and your local timezone is EST. You can set this value to CET, and the strategy will automatically figure out the correct time when to start and end trading.
|
| Trade Time (hh:mm-hh:mm,...) | Trading hours in 24-hour format. Example: "09:30-16:00" for standard market hours. Multiple time windows supported (comma-separated). This multiple time windows should start and end on the same day. So if you for example want to start trading at 18:00 and end at 16:00 EST, you should split the intervals at midnight like this => "18:00-23:59,00:01-16:00", or "00:01-16:00,18:00-23:59" will also work |
| Entry Setup | |
| Order Label | Label for orders placed by the strategy (useful for tracking and filtering) |
| Quantity Strategy | This parameter sets how the quantity should be set for a Trade
|
| Max Qty | This parameter sets the maximum allowed quantity when the Risk Adjusted method is selected. This option is very useful since some propfirms has order quantity limits that can cause the account to be invalidated |
| Fixed Quantity | This sets the quantity when using Fixed Quantity strategy |
| SuperTrend Entry Filter | Enable/disable SuperTrend confirmation filter. When enabled, only enter trades in direction confirmed by SuperTrend. Notice that Reversal trades are confirmed by the inverse of SuperTrend direction |
| Order Management | |
| Order Management Strategy |
|
| ATM Strategy Template Name | Name of the ATM strategy template to use when Order Management Strategy is set to "ATM Strategy" |
| StopLoss Strategy | Multiple options available:
|
| Swing Points Period | Period for identifying swing highs/lows when using "Last Swing Price" stop loss strategy |
| TakeProfit Strategy |
|
| Stoploss/TakeProfit Ratio | When using "Stop Loss Ratio" take profit strategy, the ratio of take profit to stop loss distance. Example: 2.0 means TP = 2 x SL |
| Risk Per Trade ($) | This sets the risk in dollars for one position.
|
| Max Allowed Risk Per Trade ($) |
|
| StopLoss Points | Stop loss in points when using Points-based stop loss |
| StopLoss Offset Points | Additional points to add/subtract to calculated stop loss for safety margin |
| TakeProfit Currency | Target take profit amount in dollars when using Fixed Currency take profit |
| TakeProfit Points | Target take profit in points when using Points-based take profit | On Opposite Signal | Action when opposite direction signal occurs: Breakeven Position | Close Position | Do Nothing |
| SuperTrend Settings | |
| SuperTrend Mode |
|
| Period | This sets the supertrend period |
| Multiplier | This sets the Supertrend multiplier. The bigger this parameter the wider the superstrend bands |
| Moving Avg. Type | This selectes the Moving Average type for Supertrend |
| Smooth | This sets the smoothing period of the supertrend |
| Command Buttons | |
| The strategy allows to manually execute some commands in case you want to manually intervene. The commands buttons are added to the Chart Trader panel, make sure to show it on your active chart | |
![]() | |
| Arm/Disarm Buttons | The Arm Long/Disabled Long and Arm Short/Disabled Short buttons can manually activate or deactivate entering trades long or short. By default those two toggle buttons are enabled meaning the strategy is armed to enter both long and short trades. Toggling the button to the disable will restrain the strategy to enter a trade in the disabled direction. This can be useful if you have a directional bias or conviction about the direction of the market |
| Close Position Button | The Close position button will immediately flatten the position on the active instrument on the active Chart. This can be useful if you want to exit a trade without having to affect the strategy or restart it. After closing the position, the strategy will continue to function normally and look for new trades to take |
| Increase Qty Button | The increase Qty button allows to increase the quantity of the current active position by +1 contract |
| Decrease Qty Button | The decrease Qty button allows to decrease the quantity of the current active position by -1 contract |
| Set Breakeven Button | The button will set the stoploss of the open position to breakeven level if the current stoploss price is lower than breakeven price for long entries and higher than breakeven price for bearish entries. |
Backtesting and Preferred Settings
Here I will try to periodically list backtests with different risk appetit. But before that here are some remarks regarding backtesting
- Past results are not guarantee of future results. All backtesting results are for indicative purposes only
- The period on which the backtest was run was not handpicked to show the best results
- Commissions are included in the backtests to get as realistic results as possible. The commission schema used is NinjaTrade Lifetime license commissions schema
- Since the AI model requires data of previous day, the signals will only be triggered starting from the second trading day on the selected interval. So if you run backtest on only one day you will not see any trades. Also make sure to enable the first parameter : Execute Historical Trades
- At automated-trading.ch we run very precise backtests due to the following 2 factors
- We are following the NinjaTrader official guide on how to achieve precise intrabar granularity backtesting by using additional tick level DataSeries See here for more info
- We are only using Market Orders instead of Pending Orders, in both real-time and becktest modes.
This template has the lead on performance on MES instrument. Good for 50k evaluation accounts.
- Instrument MES
- Timeframe 1 Minute
- Period From 01 January 2026 to 10 April 2026
- Run Mode Backtest
- Total Profit 12 138 $
- Max Drawdown (-1 841) $
- Run Release Version 1.0.0.0
Righ-Click on the button -> Save Link As... into NinjaTrader templates folder ...\Documents\NinjaTrader 8\templates\Strategy\ATCHMachineLearningPredictor
Download & Installation Instructions
At automated-trading.ch you can choose to either purchase 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 that you can use for both premium and free products
To obtain the license simply Signup and then get your license on the billing page
This Random-Forest Machine Learning Strategy is a premium strategy. It can be run on Backtest, Playback and Optimization modes for free. An active subscription is required to run it on Live mode.
To download and install the strategy follow the instructions below
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 strategy 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 Strategy 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 Strategy
- Click on the below download button to download the Random Forest Machine Learning Strategy file
- Import the downloaded .zip file into NinjaTrader using the import NinjaScript menu item
- Next, open a new chart window while making sure to load at least Two days of data into the chart since the strategy will need data from previous day to properly function
- After installing the strategy and opening a new Chart window you should add the strategy to the chart. Right-Click on the chart and Click on the "Strategies" Context menu entry. Or you can Ctrl+S on the Chart to open the "Add New Strategy" Dialog window
- After adding the strategy to the chart, the strategy will be run on Historical data loaded in the chart.
- When the Historical data run is done, the strategy will switch to Real-Time mode and will add the license panel text box to the "Chart Trader Panel"
- Make sure to display the Chart Trader panel on your active NinjaTrader Chart
- Copy/Paste your license in the text box as shown in the image below. Your license can be found on the billing main page. Make sure to create an account or login first
- Click on the Check License Button
- At this step the strategy will check the License and activate/deactivate trading according to your subscription state
- If you have an active subscription, will see the "Check License" button turned to green, and the next verification date next to your email. License check is only required once. Until the next verification date.
- At this stage, the strategy is Ready. If your license is valid, the strategy will continue running on live mode
- If you chose to not subscribe yet, and want to test the strategy beforehand, you can run it on Playback and Historical modes. Note that you will also need to load at least two days of historical data for the Machine Learning model to generate signals
Frequently Asked Questions
General
We recommend running on a VPS for best results, but it is not strictly necessary. The strategy can run on a local machine if you maintain continuous internet connection to your broker.
Yes, you can run multiple instances on the same account with different instruments or timeframes with your license.
Yes, the strategy works well with trade copiers.
Yes, this strategy is designed with trader funding programs in mind. It operates as a full-auto system with precise risk management suitable for prop firm combine evaluation.
Yes, this is a completely automated strategy. Once started on a chart, it requires no manual intervention. It automatically manages entries, exits, and position management based on ML signals and it can run on multiple days without needing to be restarted.
Automated trading eliminates emotion from trading decisions and provides consistent rule-based execution. Machine learning strategies specifically can identify complex patterns that are difficult for humans to spot manually.
This strategy has been favorable for me on the long run with ups and downs, especially when it is run on multiple insturments. But the question remains pertinent, why I'm selling it?
The answer is I'm not selling it, I'm renting it to generate an additional income and diversify my different sources of income besides what this strategy can generate. Which you should also do. You should not rely on one source of income to reach financial independance, the key is diversification.
The edge of this strategy will not disappear if many people start using it. This strategy is purely mechanical and does not rely on a hidden quantitative pattern that should not be disclosed
The source code is not provided. The strategy is protected intellectual property.
Machine Learning & Models
The strategy uses Random Forest regression from Microsoft.ML, specifically the FastForest trainer. This algorithm is robust, handles non-linear relationships well, and is resistant to overfitting.
No, a pretrained model is provided on the download page. We will provide periodic updates of the model based on the latest data.
Generally not recommended. Market structure varies significantly between instruments.
Billing
Yes, you can cancel your subscription at any time from your account dashboard. Your subscription will remain active until the next billing cycle.
No. However, you can run the strategy on Backtest, Playback and Optimization modes for free without an active subscription to test its performance and settings before deciding to subscribe for live trading.
No refund is possible. We recommend testing the strategy on backtest and paper trading modes before using it on live mode to make sure it fits your needs and expectations.
Technical
Any NinjaTrader 8 license type will work (Free, Trader, or Professional). The strategy doesn't require any specific license tier.
The strategy works best on 1-minute to 5-minute timeframes. Longer timeframes (hourly+) may produce fewer signals due to the prediction horizon structure.
The strategy includes robust connection loss recovery. It's designed to handle temporary disconnections gracefully without losing position tracking or order integrity.
We are following the NinjaTrader official guide on how to achieve precise intrabar granularity backtesting by using additional tick level DataSeries See here for more info
Don't take my word for it. Test it yourself, at the end of each trading day, run a backtest of the strategy on that day and compare it with the live trades the strategy made during the day.
Release Notes
- First Release of the strategy
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

