The Bayesian RSI: Asking Who's Winning, as a Probability
The classic RSI gives you a number between 0 and 100 and leaves you to decide what it means. Is 35 oversold enough? Is 70 a warning or a strong trend? The number itself doesn't say how confident it is, or how much evidence is behind it.
The AIQ Genesis Bayesian RSI asks the same underlying question, who is in control, buyers or sellers, but answers it as a probability. The line reads 0.50 when it's a coin toss, below 0.50 when sellers have the edge, and above 0.50 when buyers do. It is the same Bayesian way of thinking about evidence that sits behind the AIQ Expert Rating, applied to a single, familiar question.
Keeping score, with a fading memory
Think of the indicator as a scorekeeper. Every bar that closes higher than the one before is a point for the buyers. Every bar that closes lower is a point for the sellers. Unchanged closes don't score. Old points slowly fade, so last week counts for more than last quarter. With the default half-life of 14 bars, a point loses half its weight every 14 bars, which works out to a memory of roughly the last 20 bars.
For readers who want the math: the two running scores feed a Beta-binomial model that starts from a neutral, uniform prior. The plotted line is the posterior mean, the up score divided by the total. In plain terms, it is the indicator's best estimate of the chance that buyers are winning right now.
Reading the signal
The Bayesian RSI is a mean-reversion tool. It looks for a long entry when sellers have had the upper hand long enough that the market looks stretched to the downside, and it steps aside once buyers are back in control.
- Long entry. The line falls to or below 0.48. A green triangle appears below the bar on your price chart, so you don't have to watch the lower pane.
- Exit to flat. The line rises to or above 0.52. A red triangle appears above the bar.
- Zone shading. When the line pushes past a threshold, the area between the line and the threshold is shaded, green below 0.48 and red above 0.52, the same way many traders shade RSI above 70 and below 30. The pane is also tinted while the signal is long.
- One arrow per trade. Once long, the indicator holds until the exit condition is met. A second dip during the trade doesn't produce a new arrow. If you want to see those dips, turn on the optional new-dip dots, which mark each fresh drop back below 0.48 while you're already long.
Because the 0.48 to 0.52 band is narrow, a raw version of this signal can flip back and forth. Three whipsaw filters are on by default: a short smoothing of the line, two confirmation bars before the signal changes, and a minimum hold of three bars after an entry. Setting them to 1, 1 and 0 gives you the original, unfiltered signal.
Long or flat, never short
The red triangle means "step aside", not "go short". The thresholds were researched as entries and exits for long trades only. A reading of 0.52 means buyers have a slight edge, not that the market is overextended, and stocks have a long-run upward drift that works against short trades. A short side would need its own, much higher threshold and its own testing.
The margin of error, honestly
A Bayesian model can tell you how uncertain its own estimate is, and the indicator can draw that as a 90% band around the line. We turned it off by default, and it's worth explaining why.
Because the indicator only remembers roughly the last 20 bars, it can never be very sure. The band stays about plus or minus 0.17 around the line almost all the time, and it barely changes with market conditions. That is useful to know once: the 0.48 to 0.52 trigger zone sits well inside that margin of error, so a single cross is an early lean, not a certainty. But a band that is nearly constant adds little to the chart, and it squeezes the pane so the thresholds are harder to see. Turn it on under Display if you want to see it. Raising the half-life is the only thing that narrows it. The band is for context only and is never used by the signals.
Context and protection
Mean reversion works better in some markets than others, so the indicator carries the same regime flag used in our other scripts: Bull when price is above its 200-bar average, Bear when below, and Choppy when volatility is running well above normal. The status table shows the current regime, and you can block new entries in any regime you choose.
There is also an optional ATR trailing stop. By default it sits 3 ATRs below the highest close since entry and only ever moves up. You can use it in place of the threshold exit, or alongside it so the trade closes on whichever comes first. The stop is drawn on the price chart in orange while you're long, a stop exit is marked with a red X, and after a stop-out the line must leave the oversold zone before a new entry is allowed. For a mean-reversion entry, pairing the threshold exit with a stop is the natural combination: the threshold takes the bounce, and the stop limits the damage if a dip turns into a real downtrend.
The settings worth knowing
- Half-life (default 14) controls how quickly the score adapts. Shorter is faster and noisier.
- Long-on and long-off (defaults 0.48 and 0.52) set the entry and exit levels. Long-on must stay below long-off.
- Exit mode chooses between the threshold exit, the ATR stop, or both.
The 0.48 and 0.52 levels came from a grid search on daily data for S&P 100 stocks from 1989 to 2026, using the original unfiltered signal. In that research the signal compared best with buy-and-hold in choppy markets and lagged it in steady bull markets. The whipsaw filters and the ATR stop have not been through the same testing yet, and all of it was on daily bars. Those are historical results, not a forecast, so test it on your own markets and timeframe before relying on it.
The Bayesian RSI is free on TradingView. Search for "AIQ Genesis Bayesian RSI" in the indicators panel, or see all AIQGENESIS scripts. For the full Bayesian evidence picture, add the free AIQ Essential indicator.
One question, who's winning, answered as a probability. Enter on the lean, respect the margin of error.