Machine Learning Trading Indicators

Machine learning trading indicators learn patterns from historical data to forecast the next move rather than applying a fixed formula. The most popular, jdehorty's Lorentzian Classification, turns indicators like RSI and ADX into features, finds the most similar past bars by Lorentzian distance, and predicts what price did after them. They are pattern-matchers, not crystal balls; overfitting is the central danger.
What are machine learning trading indicators?
Machine learning trading indicators are a class of tools that use algorithms to learn patterns from historical market data and produce a forecast or signal, rather than applying a fixed formula. Their popularity has exploded on TradingView — the top all-time list features several, including jdehorty’s celebrated Lorentzian Classification, AlgoAlpha’s ML Adaptive SuperTrend, and LuxAlgo’s SuperTrend AI.
They represent the intersection of two powerful trends: the accessibility of Pine Script and the rise of machine learning.
The core difference from a traditional indicator is adaptation. A classic tool like the RSI applies the same equation to every bar forever. A machine-learning indicator, by contrast, examines many past examples and derives its output from what actually happened in similar situations before.
The promise is a tool that can capture complex, non-linear relationships in the data that a simple formula cannot — recognising subtle combinations of conditions that preceded up moves versus down moves. In practice, most ML indicators on TradingView use relatively lightweight techniques (nearest-neighbour classifiers, simple clustering) that run within Pine Script’s constraints, rather than the heavy neural networks used in institutional quant research.
That does not make them useless — a well-built pattern-matcher can add genuine value — but it does mean it is crucial to understand what they actually do under the hood, and, just as importantly, what they cannot do.
Traditional vs machine learning indicators at a glance
| Aspect | Traditional indicator | Machine learning indicator |
|---|---|---|
| How the output is made | Same fixed formula on every bar | Derived from what happened in similar past bars |
| Inputs | Price, sometimes volume | Features built from indicators such as RSI, ADX, CCI |
| Adapts to the data | No, the equation never changes | Yes, through stored labelled examples |
| Typical TradingView technique | Fixed formula, such as RSI or MACD | Nearest-neighbour classifiers or simple clustering |
| Transparency | Formula fully visible | Often a black box |
| Best use | A well-understood reading of price | One probabilistic input alongside structure and risk rules |
◆Neither type knows why price moves; both need confirmation and a defined stop.
What are features, labels and training in ML indicators?
Every machine-learning indicator is built from three ingredients, and understanding them demystifies the whole field. The first is features — the inputs the model learns from. In trading, features are usually derived from familiar indicators: the RSI value, the ADX, a rate-of-change, the CCI, and so on. Each bar is described by a handful of these feature values, which together form a ‘fingerprint’ of the market’s state at that moment.
The Lorentzian Classification indicator, for example, defaults to a set of five such features.
The second ingredient is labels — the ‘answer’ the model is trying to learn. For a classifier, the label is typically whether price went up or down some number of bars after each historical bar.
By pairing each bar’s feature fingerprint with what price did next, the model builds a library of ‘when the market looked like this, it then did that.’ The third ingredient is training — the process of using that labelled library to make predictions.
In a nearest-neighbour approach (the kind most TradingView ML indicators use), ‘training’ is simply storing the historical examples; the prediction happens live by comparing the current bar’s features to all the stored ones. This features-labels-training framework underlies essentially every ML indicator you will encounter.
When you understand that an ML indicator is really just answering ‘which past bars most resemble now, and what happened after them?’, the mystery evaporates and you can evaluate the tool sensibly.
How does a k-nearest-neighbour indicator make a prediction?
The most popular ML trading indicator, Lorentzian Classification, is built on k-nearest-neighbours (kNN) — one of the simplest and most intuitive machine-learning algorithms. Use the interactive tool below to see it make a prediction, then we will unpack it.
The logic is remarkably simple. Each historical bar is a point in a multi-dimensional feature space (the tool above uses two features so it fits on a chart; real indicators use several). Each point is coloured by what price did next — green for up, red for down.
To predict the current bar, the algorithm finds the k most similar past bars — the nearest points in feature space — and lets them vote: if most of the nearest neighbours were followed by up moves, it predicts up.
That is the entire idea: ‘the market looks most like these five past moments, and four of them went up, so I predict up.’ The Lorentzian part refers to how ‘distance’ between bars is measured.
Instead of ordinary straight-line (Euclidean) distance, jdehorty’s indicator uses a Lorentzian distance metric, which — borrowing an idea from physics — warps the feature space so that it is more robust to the large, sudden swings and outliers that markets produce around major events. The claim is that this warping helps the classifier find genuinely similar historical conditions even when volatility distorts the raw feature values.
Whether or not the physics analogy is essential, the practical effect is a nearest-neighbour classifier tuned to be less thrown off by market extremes.
Why is overfitting the biggest danger for ML indicators?
If there is one concept that determines whether a machine-learning indicator helps or harms you, it is overfitting — and it is the single most important thing to understand about the entire field. Overfitting happens when a model learns the noise in historical data rather than a genuine, repeatable pattern. An overfit model describes the past almost perfectly and predicts the future almost uselessly.
The danger is acute in trading because markets are extraordinarily noisy and only weakly predictable. Given enough features and parameters, an algorithm can always find some combination that would have perfectly called every past turn — but those relationships are coincidences that will not recur.
The seductive trap is the beautiful backtest: an ML indicator, tuned until its historical signals look flawless, that then falls apart the moment it meets live data it has never seen. This is why professional quants obsess over out-of-sample testing — evaluating a model only on data it was not trained on — and treat a perfect in-sample fit as a red flag rather than a success.
For the retail trader using a TradingView ML indicator, the practical defences are: be deeply sceptical of any ML tool advertised with a near-perfect win rate; prefer simpler models with fewer features, which overfit less; never optimise the settings until the historical results look perfect, because you are almost certainly fitting noise; and always assume live performance will be meaningfully worse than the backtest.
Respecting overfitting is what separates traders who use ML tools soberly from those who are seduced and burned by them.
What can ML indicators do well, and where do they fall short?
Machine-learning indicators occupy a genuinely useful but frequently over-hyped niche, and using them well means having a clear-eyed view of both sides. Their strengths are real. They can capture non-linear combinations of conditions that a single fixed formula misses — recognising that a particular blend of RSI, ADX and volatility has historically preceded up moves, for instance. They adapt their output to the data rather than applying one rigid rule.
And at their best, they can distil several indicators’ worth of information into a single, cleaner signal, reducing chart clutter.
Their limitations, however, are fundamental and must never be forgotten. Markets are only weakly predictable and are driven substantially by unpredictable events — news, policy, sentiment — that no chart-based model can foresee, which caps how good any price-only predictor can be. ML indicators are highly prone to overfitting, as discussed.
They are often ‘black boxes’ whose reasoning is opaque, making it hard to know why a signal fired or to trust it in a novel situation. The lightweight ML that fits inside Pine Script is far simpler than institutional models, so the ‘AI’ label often promises more than the tool delivers.
And crucially, past patterns recurring is an assumption, not a law — when market regimes shift, a model trained on the old regime can fail badly. The honest conclusion is that ML indicators are best viewed as another probabilistic signal, no more sacred than an RSI reading, to be weighed alongside price, structure and context — never as an oracle to be obeyed.
How should you use machine learning indicators responsibly?
Used with the right mindset, an ML indicator can be a helpful part of a trading process; used naively, it is a fast route to losses. The difference lies in a handful of disciplined habits.
- Treat it as one input, not an oracle. Weigh the ML signal alongside price, trend, structure and levels — never take a trade on the label alone.
- Demand confluence. Act on an ML prediction only when it agrees with your other analysis — a bullish label at a support level in an uptrend, for example. Ignore signals that fire against structure.
- Respect the confidence. Many ML tools report how strongly the neighbours agree. A split, low-confidence vote — a bar on the decision boundary — is a signal to stand aside, not to trade.
- Prefer simple, transparent tools. Favour indicators whose logic you understand and that use few features. Complexity you cannot inspect is risk you cannot manage.
- Manage risk as if it will be wrong. Because any single prediction can fail, size every trade with your normal risk rules and a defined stop, exactly as you would with any other signal.
The unifying principle is humility. A machine-learning indicator is a sophisticated way of asking ‘what usually happened after conditions like these?’ — a genuinely useful question, but one with a probabilistic, not certain, answer. Traders who fold that answer into a broader, risk-managed process do well; those who outsource their thinking to the ‘AI’ and follow it blindly do not. The tool is only as good as the judgement wrapped around it.
Machine learning indicators and Smart Money Concepts
There is a natural and powerful pairing between machine-learning indicators and Smart Money Concepts, because each supplies exactly what the other lacks. An ML indicator is a pure pattern-matcher: it can tell you that current conditions resemble past bars that went up, but it has no understanding of why price moves — no concept of liquidity, order flow, or the structural reasons behind a turn.
Smart Money Concepts provide precisely that causal, structural understanding, but without a systematic way to score how the current setup compares to history.
Combining them creates a check in both directions. When an ML indicator predicts up and price has just swept liquidity below an obvious low and shifted structure to the upside off a demand zone, you have a statistical pattern-match and a structural, order-flow reason pointing to the same conclusion — a genuinely high-conviction alignment.
Conversely, when an ML signal fires against clear structure — predicting up while price is cleanly breaking down through support — that disagreement is a valuable warning to distrust the label and stand aside. In this way the SMC read acts as a sanity filter on the black-box signal, and the ML signal acts as a systematic confirmation of the discretionary read.
Neither is sufficient alone, but together they cover each other’s blind spots: the machine finds the statistical echo of the past, and Smart Money analysis explains whether there is a real reason for it to matter now.
How can you see through the AI indicator hype?
No discussion of machine-learning trading indicators is complete without addressing the hype, because the gap between marketing and reality in this space is enormous and expensive to ignore. The words ‘AI’ and ‘machine learning’ carry a powerful aura of infallibility, and unscrupulous marketing exploits it relentlessly — promising indicators that ‘predict the market with 95% accuracy’ or ‘let AI trade for you.’ A clear head here protects your capital.
Several truths cut through the noise. First, if a machine-learning indicator could genuinely predict prices with high accuracy, its creator would not be selling it for a subscription — they would be quietly compounding a fortune. The very existence of a sales pitch is evidence against the claim.
Second, the ML that runs inside a charting platform is, by necessity, simple — a nearest-neighbour classifier or a small clustering routine — not the vast, data-rich models used by institutional quant funds, and it is bounded by the same weak predictability of markets that limits everyone. Third, an impressive backtest proves almost nothing, because of overfitting; the only test that matters is honest out-of-sample and forward performance.
And fourth, no indicator, however sophisticated, removes the need for risk management, position sizing, and judgement — the parts of trading that actually determine long-term survival. None of this means ML indicators are worthless; the best of them, like Lorentzian Classification, are thoughtfully built and can add value as one input.
It means you should approach them as a sober, sceptical professional — interested in the genuine edge they might provide, immune to the fantasy that they are a shortcut to guaranteed profits.
What mistakes do traders make with ML indicators?
- Trusting the label as certainty. An ML prediction is a probability, not a fact. Trading it blindly, without other confirmation, is the fastest way to lose with these tools.
- Falling for the perfect backtest. A flawless historical fit usually means overfitting to noise. Be most sceptical of the tool with the prettiest past results.
- Over-optimising the settings. Tuning features and parameters until the backtest looks perfect fits noise, not signal. Prefer simple, robust defaults.
- Ignoring low-confidence signals. A split neighbour vote — a bar on the decision boundary — is a stand-aside, not a trade. Respect the confidence reading.
- Believing the AI hype. If it truly predicted markets, it would not be for sale. Treat ‘95% accuracy’ claims as marketing, not fact.
- Skipping risk management. No model removes the need for a stop and proper sizing. Manage every ML-signalled trade as if it will be wrong, because sometimes it will.
◆ Test Your Knowledge
Machine Learning Trading Indicators with Quantum Algo
Machine learning indicators find patterns in features; Smart Money Concepts explain why price actually moves. Quantum Algo’s SMC tools give a machine-learning signal the structural and liquidity context it lacks — so an ML prediction that agrees with a break of structure at a real level is worth acting on, while one firing against structure is a warning to stand aside.
Related guides
Related reading: see also our SuperTrend AI (Clustering) indicator for a deeper dive into a complementary tool.
◇ Frequently Asked Questions
They are indicators that use algorithms to learn patterns from historical data and produce a forecast, rather than applying a fixed formula. On TradingView, the most popular is Lorentzian Classification, which uses a k-nearest-neighbour approach to predict the next move from similar past bars.
It turns classic indicators like RSI and ADX into features describing each bar, then uses k-nearest-neighbours to find the most similar past bars, measured with a Lorentzian distance metric. Those neighbours vote on the prediction based on what price did after them.
It is an alternative way of measuring how similar two bars are in feature space. Borrowed from physics, it warps the space to be more robust to the large, sudden swings markets produce around major events, helping the classifier find genuinely similar historical conditions.
They can add value as one probabilistic input, capturing non-linear patterns a fixed formula misses. But markets are only weakly predictable, and these tools are prone to overfitting, so they are not oracles. They work best combined with price, structure and risk management.
Overfitting is when a model learns the noise in historical data rather than a real, repeatable pattern. It produces a beautiful backtest but fails on live data. Because markets are noisy, overfitting is the central danger of machine-learning indicators.
Not necessarily, but the space is full of hype. If an indicator truly predicted prices with high accuracy, its creator would trade it rather than sell it. Well-built tools like Lorentzian Classification can help as one input, but claims of near-perfect accuracy are marketing, not reality.
A normal indicator applies the same fixed formula to every bar. A machine-learning indicator derives its output from what happened in similar past situations, adapting to the data and capturing complex, non-linear combinations of conditions a single formula cannot.
No. A prediction is a probability, not certainty, and the model has no understanding of why price moves. Use it as one input alongside price, trend, structure and levels, act only on confluence, and always manage risk with a defined stop.
Most use values derived from classic indicators as features — the RSI, ADX, CCI, rate-of-change and similar — describing each bar's market state. Lorentzian Classification, for example, defaults to a set of five such features.
Very well. An ML indicator finds statistical patterns but does not know why price moves, while Smart Money Concepts explain the liquidity and structure behind moves. When both point the same way, conviction is high; when they disagree, it is a warning to stand aside.
References & Related Guides
More in this topic
- Best TradingView Indicators — Complete Guide
- Divergence Trading: Complete Guide
- Elliott Wave Theory — Complete Trading Guide
- Fisher Transform Indicator: Complete Guide
- Harmonic Patterns: Complete Trading Guide
- Heikin Ashi — Complete Smoothed Candlestick Guide
- Inside Bar Trading: Complete Guide
- Leverage Trading: The Complete Guide
- Pin Bar Trading: Complete Guide
- Pivot Points — Complete Intraday Support & Resistance Guide
- Position Trading: Complete Guide
- Power of Three (AMD): The Complete ICT Guide
- Lorentzian Classification Guide
- Non-Repaint Indicators Guide
- AI Trading Journal Guide
Core reading
- BOS & CHoCH: Complete Market Structure Guide
- Order Blocks Trading: Complete Guide
- Risk Management in Trading — Complete Guide
- Candlestick Patterns Guide — Engulfing, Pinbar & More
- All Premium Guides
- Quantum Algo on TradingView
- Public Track Record