Oscillators & Momentum Indicators
RSI with chart signals, stochastic, MACD, Bollinger Band volatility and breakouts, relative volume (RVOL), and building custom oscillators.
From Thrive on YouTube
Watch the matching Thrive video
Trading Indicators, Honestly: What They Can and Cannot Do
Part of Trading Journal and Performance Review. Education only. Not financial advice.
Enhanced RSI Indicator
The standard RSI is a single line oscillating between 0 and 100. An enhanced RSI adds moving average smoothing, dynamic overbought/oversold levels, and momentum classification. On volatile assets like SOL, the standard 70/30 levels trigger too frequently: adaptive levels based on recent RSI range produce higher-quality signals. This version also includes a momentum state label so you can see at a glance whether momentum is accelerating, decelerating, or neutral.
1//@version=52indicator("Enhanced RSI", overlay=false)34rsiLen = input.int(14, "RSI Length")5smoothLen = input.int(5, "Signal Smoothing")6adaptLen = input.int(100, "Adaptive Level Lookback")78rsi = ta.rsi(close, rsiLen)9rsiSignal = ta.ema(rsi, smoothLen)1011// Adaptive overbought/oversold based on recent RSI distribution12rsiHigh = ta.percentile_linear_interpolation(rsi, adaptLen, 85)13rsiLow = ta.percentile_linear_interpolation(rsi, adaptLen, 15)1415// Momentum state16accel = rsi - rsiSignal17state = accel > 2 ? "Accelerating" :18 accel < -2 ? "Decelerating" : "Neutral"1920// Gradient color21rsiColor = color.from_gradient(rsi, rsiLow, rsiHigh,22 color.green, color.red)2324plot(rsi, "RSI", rsiColor, 2)25plot(rsiSignal, "Signal", color.new(color.white, 50), 1)26plot(rsiHigh, "Dynamic OB", color.new(color.red, 60), 1,27 plot.style_line)28plot(rsiLow, "Dynamic OS", color.new(color.green, 60), 1,29 plot.style_line)30hline(50, "Mid", color.new(color.gray, 80))3132bgcolor(rsi > rsiHigh ? color.new(color.red, 90) :33 rsi < rsiLow ? color.new(color.green, 90) : na)RSI Chart Signals: Plotting on Price
One limitation of oscillators is that they live in a separate pane. RSI chart signals solve this by translating oscillator readings into plotshape markers directly on the price chart. When RSI crosses above oversold, a buy marker appears below the candle. When RSI crosses below overbought, a sell marker appears above. This lets you see oscillator signals without ever looking away from the price chart: critical for fast-moving assets like ETH during high-volatility events.
1//@version=52indicator("RSI Chart Signals", overlay=true)34rsiLen = input.int(14, "RSI Length")5obLevel = input.int(70, "Overbought")6osLevel = input.int(30, "Oversold")78rsi = ta.rsi(close, rsiLen)910// Signal conditions11bullSignal = ta.crossover(rsi, osLevel)12bearSignal = ta.crossunder(rsi, obLevel)13strongBull = bullSignal and volume > ta.sma(volume, 20) * 1.514strongBear = bearSignal and volume > ta.sma(volume, 20) * 1.51516plotshape(bullSignal and not strongBull, "Oversold Exit",17 shape.triangleup, location.belowbar,18 color.new(color.green, 30), size=size.tiny)19plotshape(strongBull, "Strong Oversold Exit",20 shape.triangleup, location.belowbar,21 color.green, size=size.small, text="RSI")22plotshape(bearSignal and not strongBear, "Overbought Exit",23 shape.triangledown, location.abovebar,24 color.new(color.red, 30), size=size.tiny)25plotshape(strongBear, "Strong Overbought Exit",26 shape.triangledown, location.abovebar,27 color.red, size=size.small, text="RSI")2829// Background flash on extreme readings30bgcolor(rsi > 80 ? color.new(color.red, 92) :31 rsi < 20 ? color.new(color.green, 92) : na)Volume confirmation
Stochastic Oscillator with Smoothing Options
The stochastic oscillator measures where the close sits within the recent high-low range. A reading of 80 means the close is near the top of the last N bars' range. Unlike RSI, the stochastic is bounded by recent price extremes, making it more responsive to range-bound conditions. This version supports multiple smoothing methods and includes cross detection between the %K and %D lines.
1//@version=52indicator("Stochastic Pro", overlay=false)34kLen = input.int(14, "%K Length")5kSmooth = input.int(3, "%K Smoothing")6dSmooth = input.int(3, "%D Smoothing")7smooth = input.string("SMA", "Smoothing",8 options=["SMA", "EMA"])910rawK = ta.stoch(close, high, low, kLen)11k = smooth == "EMA" ? ta.ema(rawK, kSmooth) : ta.sma(rawK, kSmooth)12d = smooth == "EMA" ? ta.ema(k, dSmooth) : ta.sma(k, dSmooth)1314bullCross = ta.crossover(k, d) and k < 2515bearCross = ta.crossunder(k, d) and k > 751617kColor = color.from_gradient(k, 20, 80, color.green, color.red)18plot(k, "%K", kColor, 2)19plot(d, "%D", color.new(color.white, 40), 1, plot.style_line)20h80 = hline(80, "OB", color.new(color.red, 60), hline.style_dashed)21h20 = hline(20, "OS", color.new(color.green, 60), hline.style_dashed)22fill(h80, h20, color.new(color.gray, 94))2324plotshape(bullCross, "Bull Cross", shape.circle,25 location.bottom, color.green, size=size.tiny)26plotshape(bearCross, "Bear Cross", shape.circle,27 location.top, color.red, size=size.tiny)MACD with Histogram Coloring and Signal Detection
The MACD (Moving Average Convergence Divergence) consists of the MACD line (fast EMA minus slow EMA), the signal line (EMA of the MACD line), and the histogram (difference between them). A professional MACD indicator uses four-color histogram coloring: rising positive (strong bull), falling positive (weakening bull), falling negative (strong bear), and rising negative (weakening bear). This four-state system gives you early warnings of momentum shifts on BTC and ETH before the crossover actually occurs.
1//@version=52indicator("MACD Pro", overlay=false)34fastLen = input.int(12, "Fast Length")5slowLen = input.int(26, "Slow Length")6sigLen = input.int(9, "Signal Length")78[macdLine, signalLine, hist] = ta.macd(close, fastLen, slowLen, sigLen)910// Four-state histogram coloring11histColor = hist >= 0 ?12 (hist > hist[1] ? color.new(color.green, 0) :13 color.new(color.green, 60)) :14 (hist < hist[1] ? color.new(color.red, 0) :15 color.new(color.red, 60))1617plot(hist, "Histogram", histColor, 2, plot.style_histogram)18plot(macdLine, "MACD", color.new(#5ce1e6, 0), 2)19plot(signalLine, "Signal", color.new(#ff4895, 0), 1)20hline(0, "Zero", color.new(color.gray, 80))2122// Signal detection23bullCross = ta.crossover(macdLine, signalLine)24bearCross = ta.crossunder(macdLine, signalLine)25zeroUp = ta.crossover(macdLine, 0)26zeroDown = ta.crossunder(macdLine, 0)2728plotshape(bullCross, "Bull Cross", shape.triangleup,29 location.bottom, color.green, size=size.tiny)30plotshape(bearCross, "Bear Cross", shape.triangledown,31 location.top, color.red, size=size.tiny)32bgcolor(zeroUp ? color.new(color.green, 90) :33 zeroDown ? color.new(color.red, 90) : na)Bullish momentum is accelerating: trend is strong. Best time for long entries.
Histogram still above zero but shrinking: momentum is weakening. Consider tightening stops.
Bearish momentum is accelerating: strongest selling phase. Avoid long entries.
Histogram still below zero but bars getting smaller: selling pressure easing. Watch for reversal.
MACD crosses above zero: fast EMA overtakes slow EMA. Medium-term trend shift confirmed bullish.
MACD crosses below zero: trend confirmed bearish. Strongest macro sell signal from MACD.
Bollinger Band Volatility and Breakout Detection
Bollinger Bands measure volatility using standard deviations around a moving average. Beyond the standard band overlay, two derived metrics are especially powerful: Bandwidth (the width of the bands as a percentage of the middle band) and %B (where price sits within the bands, 0 = lower band, 1 = upper band). Bandwidth squeezes on BTC often precede explosive moves, when bandwidth hits its lowest level in 120 bars, a major breakout is imminent.
1//@version=52indicator("BB Volatility", overlay=false)34length = input.int(20, "BB Length")5mult = input.float(2.0, "Std Dev", step=0.1)6sqLen = input.int(120, "Squeeze Lookback")78[mid, upper, lower] = ta.bb(close, length, mult)910bandwidth = (upper - lower) / mid * 10011pctB = (close - lower) / (upper - lower) * 1001213// Squeeze detection14bwLow = ta.lowest(bandwidth, sqLen)15isSqueeze = bandwidth <= bwLow * 1.051617// Breakout detection18breakUp = ta.crossover(close, upper)19breakDown = ta.crossunder(close, lower)2021bwColor = isSqueeze ? color.new(color.yellow, 0) :22 color.new(color.gray, 30)23plot(bandwidth, "Bandwidth", bwColor, 2)24plot(bwLow, "Squeeze Level", color.new(color.yellow, 60), 1,25 plot.style_line)2627bgcolor(isSqueeze ? color.new(color.yellow, 92) : na)28bgcolor(breakUp ? color.new(color.green, 88) :29 breakDown ? color.new(color.red, 88) : na)Relative Volume (RVOL) Indicator
Relative volume compares the current bar's volume to its historical average. An RVOL of 2.0 means volume is twice the normal level. This is one of the most underutilized indicators in crypto: price moves on high RVOL are significantly more likely to follow through than moves on low RVOL. On SOL and ETH, breakouts with RVOL above 2.0 have a substantially higher success rate than those below 1.0.
1//@version=52indicator("Relative Volume", overlay=false)34avgLen = input.int(20, "Average Length")5highThresh = input.float(2.0, "High RVOL Threshold")67avgVol = ta.sma(volume, avgLen)8rvol = volume / avgVol910rvolColor = rvol >= highThresh ? color.new(color.yellow, 0) :11 rvol >= 1.0 ? color.new(color.green, 20) :12 color.new(color.red, 40)1314plot(rvol, "RVOL", rvolColor, 2, plot.style_histogram)15hline(highThresh, "High", color.new(color.yellow, 60),16 hline.style_dashed)17hline(1.0, "Average", color.new(color.gray, 60))1819alertcondition(rvol >= highThresh and close > open,20 "High RVOL Bullish", "RVOL spike on bullish bar")Multi-Oscillator Momentum Dashboard
Individual oscillators can give conflicting signals. A multi-oscillator dashboard scores momentum across RSI, Stochastic, MACD, and RVOL, producing a single composite score from -4 (maximum bearish) to +4 (maximum bullish). This forces you to wait for oscillator agreement before acting, dramatically reducing false signals on choppy BTC ranges.
1//@version=52indicator("Momentum Dashboard", overlay=false)34rsi = ta.rsi(close, 14)5[k, d] = ta.stoch(close, high, low, 14)6[macdLine, sigLine, hist] = ta.macd(close, 12, 26, 9)7rvol = volume / ta.sma(volume, 20)89// Score each oscillator: +1 bullish, -1 bearish10rsiScore = rsi > 55 ? 1 : rsi < 45 ? -1 : 011stochScore = k > 60 ? 1 : k < 40 ? -1 : 012macdScore = hist > 0 and hist > hist[1] ? 1 :13 hist < 0 and hist < hist[1] ? -1 : 014volScore = rvol > 1.2 and close > open ? 1 :15 rvol > 1.2 and close < open ? -1 : 01617total = rsiScore + stochScore + macdScore + volScore1819// Gradient color for the score20scoreColor = color.from_gradient(total, -4, 4, color.red, color.green)2122plot(total, "Score", scoreColor, 3, plot.style_histogram)23hline(0, "Neutral", color.new(color.gray, 60))24hline(3, "Strong Bull", color.new(color.green, 70), hline.style_dashed)25hline(-3, "Strong Bear", color.new(color.red, 70), hline.style_dashed)2627bgcolor(total >= 3 ? color.new(color.green, 90) :28 total <= -3 ? color.new(color.red, 90) : na)Trading with oscillator confluence
| Score +4 | All four oscillators bullish. Maximum conviction long. Occurs rarely: acts as a high-confidence signal. |
| Score +2 to +3 | Majority agreement bullish. Good for entries with trend confirmation from higher timeframes. |
| Score -1 to +1 | Mixed signals. No clear momentum bias. Stay flat or reduce position size until alignment improves. |
| Score -2 to -3 | Majority agreement bearish. Look for short entries or exit remaining longs. |
| Score -4 | All oscillators bearish. Maximum conviction short. Strong signal to avoid any long exposure. |
Put this lesson to work
Free on Thrive, no account needed.