Lorentzian Classifier Indicator for NinjaTrader 8
Created 19 Sep 2025
·
Updated 27 Feb 2026
The Lorentzian Classifier indicator for NinjaTrader 8 is a Free indicator that provides bullish/bearish signals based on a machine learning classification model.
Prerequisites
To properly use this indicator you should have the following prerequisites available.
- NinjaTrader 8, with any license type. Click here to download
- Order Flow data is not required to use this indicator (you don't need to have a Lifetime license).
- An automated-trading.ch account with an active Free account (no paid subscription required)
Description
This classification model is built on the Lorentzian distance measure to find similarities between features extracted from a block of price bars. The Lorentzian distance is a special type of distance measure able to classify features in a multi-dimensional space — a novel way to implement Nearest-Neighbour algorithms. By using it, the indicator can find similar blocks of price action in historical training data and infer the next bar's outcome from a vote among the most similar historical features.
Here are the steps the indicator executes to predict the next price action outcome and attribute a score to that prediction:
- Consider a period of bars to analyze — a Prediction Period parameter sets how many of the most recent bars are used, and this sliding window progresses as new bars close.
- Extract features from those bars — not based on any indicator values, but on context-based Time, Price, and Volume values.
- Use the Lorentzian distance algorithm to find the most similar features among the training data loaded when the indicator is initialized.
- Take a number of the most similar samples — the count can be set manually via Voting Count, or determined automatically (via a clustering algorithm) when Voting Count is 0.
- Let those samples vote on the outcome — each votes whether the next candle will be bullish or bearish — and average the result into a predicted price movement, in points, for the next N candles.
Examples
Example 1: MES on the 1-Minute Timeframe
The indicator's simplest usage scenario, running on MES (Micro ES, the S&P 500) on the 1-minute timeframe, with a threshold value of 5 filtering out any signal scoring below 5 — leaving only high-probability signals, drawn as green arrows for bullish and red arrows for bearish. This example uses the RTH session (09:30-16:30 EST); time of day has a big impact on signal quality since the classification algorithm is context-based on price, time, and volume, and MES/US futures volume is much higher during RTH than during ETH (extended trading hours).
Example 2: MES on the 1-Minute Timeframe
With the same parameters, more signal arrows appear — some of good quality, some irrelevant (e.g. a green bullish arrow drawn during a bearish downtrend). Low-quality signals can usually be dismissed by checking the very next bar after the signal, while some signals do successfully predict a genuine change of market regime and trend.
Example 3: Composite Signal — a Range Based on Two Consecutive Signals
The indicator can produce a more complex composite signal from a sequence of two consecutive arrow signals close to each other and forming an increasing (bullish) or decreasing (bearish) price action — defining a price range that can be traded as a breakout entry setup, both on the bullish and bearish side.
Parameters
We always try to keep the parameters to a 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. This indicator is totally free to use, but you need to register for a free account and license to use it. |
| General | |
| Data Folder | The path to the folder where you should download and place the training data files (see the Installation section below). |
| Prediction Period | Sets the number of lookback bars used for inference. Default value 15; can be modified to experiment with other values. |
| Enable on Extended Trading Hours | Enables/disables running prediction during the ETH (extended trading hours) interval 18:00-09:30 EST — useful if you only want to trade during RTH. |
| Signal Threshold (Points) | Minimum predicted price movement (0 to any positive number) required to generate a signal. The higher this value, the fewer signals produced. |
| Prediction Candle Shift | Shifts which candle the prediction outcome is evaluated against. |
| Voting Count | The number of similar historical samples used to calculate the score of the next bars' outcome. Default value 0, which makes the indicator automatically decide the sample count via a clustering algorithm; any other value (e.g. 20) fixes the indicator to always take that many samples. |
| Render | |
| Show Signal Arrow | Enables/disables drawing a signal arrow when a signal is generated. |
| Show Score Text | Enables/disables drawing the signal's prediction score when a signal is generated. |
| Score Text Size | Font size of the Score Text, if drawn. |
| Draw Opacity (1-100) | Opacity of the indicator's drawings. |
| Arrow Bullish Color / Arrow Bearish Color | Color used to draw bullish/bearish arrow signals. |
| Show Sequence Signal | Shows the composite signal of two consecutive arrow signals as a range rectangle. |
| Sequence Rectangle Bullish Color / Bearish Color | Color used to draw bullish/bearish range rectangles. |
| Sound Alert | |
| Play Sound Alert | Enables/disables playing a sound when a signal is generated. |
| Play Sound File | Sets 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.
Download
You can also download this strategy — and every other automated-trading.ch strategy or indicator — anytime from your centralized Downloads page.
Installation Steps
Frequently Asked Questions
General
Release Notes
- Added New composite signal: sequence signal
- Added New parameter: Prediction Candle Shift; Change of prediction algorithm; Updated Training Data to 30 January 2025
- Fixed Bug: Indicator didn't work on Real time prices; Better prediction results with improved algorithm; Showing indicator progress on Ninjascript output window
- First Release of the indicator