Naive Bayes AI - Direction Probability ML [Dots3Red]

🧠 NAIVE BAYES AI - DIRECTION PROBABILITY [Dots3Red]
This indicator uses a Gaussian Naive Bayes classifier, trained continuously on the current chart's own history, to estimate the probability that price will be higher a set number of bars from now. It shows that probability as a line, marks high-confidence readings, and keeps an honest scoreboard of how accurate its predictions have been compared with a simple baseline.
✨ WHY THIS MATTERS
This indicator uses a real, well-understood machine-learning method, trains only on information that was available at the time, and reports its own track record next to the result you would get by always guessing the more common outcome. If the model is not adding value on your chart, the dashboard says so.
⚙️ HOW IT WORKS
📐 Four features describe each bar
• RSI — momentum
• Distance from a trend EMA, measured in ATR — how stretched price is
• Rate of change — recent speed of the move
• Relative volume — current volume versus its average
🧠 The model — Gaussian Naive Bayes learns, for bars that were later followed by a rise and bars that were later followed by a fall, the typical value and spread of each feature. For the current bar, it compares the bar's features with both profiles and combines them into a single probability: P(up). It is a classic, transparent classifier: no hidden layers, no curve-fitting to a target you can't see.
🔁 Online learning on a rolling window — a bar only becomes a training sample once its outcome is known, which is the set number of bars later. The model keeps the most recent samples up to your window size and drops older ones, so it adapts as the market's character changes.
🎯 Signals — when P(up) rises above your threshold the reading is marked bullish; when it falls below the mirror threshold it is marked bearish. In between, the model has no strong opinion.
📊 Honest scoring — every prediction is checked once its horizon has passed:
• Bullish and bearish signal accuracy, each with its sample size
• All-bar accuracy compared with a baseline: the score you would get by always guessing whichever outcome turned out more common over the measured period
🔒 No lookahead — training only uses samples whose outcome was already known at the time, and signals are labeled on confirmed bars. The probability line on the forming bar updates live as its features change.
🖥️ Dashboard on the price chart — current P(up), signal, bullish and bearish accuracy, all-bar accuracy vs baseline, training sample count, and the features in use.
🧭 HOW TO USE
1️⃣ Check model vs baseline first. If all-bar accuracy is not above the baseline, the model isn't finding a useful pattern on this chart and timeframe. Try another horizon or timeframe, or don't rely on it here.
2️⃣ Look at signal accuracy, not just the line. High-confidence readings are where the model should do best; the dashboard shows whether they do.
3️⃣ Match the horizon to your holding period. A 10-bar horizon on a 15-minute chart is a very different question from 10 bars on a daily chart.
4️⃣ Use the training window to balance stability and adaptiveness. Larger windows are steadier; smaller windows react faster to regime changes.
5️⃣ Use it as context, not a trigger. The probability is an estimate based on past behavior on this chart, not a guarantee.
⏱️ WHICH TIMEFRAMES WORK BEST
15-minute through daily. The model needs enough history to fill its training window; lower timeframes provide more samples, higher timeframes tend to have less noise.
🛠️ SETTINGS
🧠 Model — prediction horizon, training window size, minimum samples before predicting, signal threshold
📐 Features — RSI length, trend EMA length, rate-of-change length, volume average length, ATR length
🎨 Visuals — bullish and bearish colors, probability line thickness, level line color, signal zone shading and transparency, signal labels on the price chart
🖥️ Dashboard — show/hide, position
🔔 Alerts — AI bullish signal, AI bearish signal
📝 NOTES
Naive Bayes assumes the features are independent of each other given the outcome, which is never exactly true in markets; it is a simplification that often works reasonably well in practice. Signal accuracy is counted per bar while a signal is active, so consecutive signal bars are counted separately. On symbols without volume data, the relative-volume feature carries no information and the model relies on the other three. All results are specific to this chart, timeframe and settings.
⚠️ DISCLAIMER
This is an analytical and educational tool. It does not generate trade signals and does not constitute financial advice. Past prediction accuracy does not guarantee future performance.
This indicator uses a Gaussian Naive Bayes classifier, trained continuously on the current chart's own history, to estimate the probability that price will be higher a set number of bars from now. It shows that probability as a line, marks high-confidence readings, and keeps an honest scoreboard of how accurate its predictions have been compared with a simple baseline.
✨ WHY THIS MATTERS
This indicator uses a real, well-understood machine-learning method, trains only on information that was available at the time, and reports its own track record next to the result you would get by always guessing the more common outcome. If the model is not adding value on your chart, the dashboard says so.
⚙️ HOW IT WORKS
📐 Four features describe each bar
• RSI — momentum
• Distance from a trend EMA, measured in ATR — how stretched price is
• Rate of change — recent speed of the move
• Relative volume — current volume versus its average
🧠 The model — Gaussian Naive Bayes learns, for bars that were later followed by a rise and bars that were later followed by a fall, the typical value and spread of each feature. For the current bar, it compares the bar's features with both profiles and combines them into a single probability: P(up). It is a classic, transparent classifier: no hidden layers, no curve-fitting to a target you can't see.
🔁 Online learning on a rolling window — a bar only becomes a training sample once its outcome is known, which is the set number of bars later. The model keeps the most recent samples up to your window size and drops older ones, so it adapts as the market's character changes.
🎯 Signals — when P(up) rises above your threshold the reading is marked bullish; when it falls below the mirror threshold it is marked bearish. In between, the model has no strong opinion.
📊 Honest scoring — every prediction is checked once its horizon has passed:
• Bullish and bearish signal accuracy, each with its sample size
• All-bar accuracy compared with a baseline: the score you would get by always guessing whichever outcome turned out more common over the measured period
🔒 No lookahead — training only uses samples whose outcome was already known at the time, and signals are labeled on confirmed bars. The probability line on the forming bar updates live as its features change.
🖥️ Dashboard on the price chart — current P(up), signal, bullish and bearish accuracy, all-bar accuracy vs baseline, training sample count, and the features in use.
🧭 HOW TO USE
1️⃣ Check model vs baseline first. If all-bar accuracy is not above the baseline, the model isn't finding a useful pattern on this chart and timeframe. Try another horizon or timeframe, or don't rely on it here.
2️⃣ Look at signal accuracy, not just the line. High-confidence readings are where the model should do best; the dashboard shows whether they do.
3️⃣ Match the horizon to your holding period. A 10-bar horizon on a 15-minute chart is a very different question from 10 bars on a daily chart.
4️⃣ Use the training window to balance stability and adaptiveness. Larger windows are steadier; smaller windows react faster to regime changes.
5️⃣ Use it as context, not a trigger. The probability is an estimate based on past behavior on this chart, not a guarantee.
⏱️ WHICH TIMEFRAMES WORK BEST
15-minute through daily. The model needs enough history to fill its training window; lower timeframes provide more samples, higher timeframes tend to have less noise.
🛠️ SETTINGS
🧠 Model — prediction horizon, training window size, minimum samples before predicting, signal threshold
📐 Features — RSI length, trend EMA length, rate-of-change length, volume average length, ATR length
🎨 Visuals — bullish and bearish colors, probability line thickness, level line color, signal zone shading and transparency, signal labels on the price chart
🖥️ Dashboard — show/hide, position
🔔 Alerts — AI bullish signal, AI bearish signal
📝 NOTES
Naive Bayes assumes the features are independent of each other given the outcome, which is never exactly true in markets; it is a simplification that often works reasonably well in practice. Signal accuracy is counted per bar while a signal is active, so consecutive signal bars are counted separately. On symbols without volume data, the relative-volume feature carries no information and the model relies on the other three. All results are specific to this chart, timeframe and settings.
⚠️ DISCLAIMER
This is an analytical and educational tool. It does not generate trade signals and does not constitute financial advice. Past prediction accuracy does not guarantee future performance.
Connect the dots to elevate your trading.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Connect the dots to elevate your trading.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.