Use this indicator directly on TradingView — the world's most popular charting platform.
What does the Wyckoff Comparative Strength indicator do?
FibAlgo - Wyckoff Comparative Strength measures how a stock performs relative to a benchmark index — a cornerstone of Wyckoff analysis. The indicator displays a zero-centered RS strength oscillator in a separate pane, showing the percentage deviation of the Relative Strength ratio from its moving average. When the oscillator is above zero, the stock is outperforming its benchmark; when below, it is underperforming. The indicator also detects stock-vs-benchmark divergences with configurable cooldown, performs wave amplitude comparison, and provides a composite outperformance score (0-100). Wyckoff emphasized that the strongest trades come from instruments showing comparative strength against the broad market during accumulation, with the RS ratio being the primary tool for identifying such leaders and laggards.
Key Concepts
- Relative Strength (RS) Ratio — Calculated as Stock Price / Benchmark Price. A rising RS ratio means the stock is outperforming the benchmark; a falling ratio means underperformance. This is the most direct way to visualize Wyckoff's comparative strength principle.
- RS Strength Oscillator (Zero-Centered) — The indicator converts the RS ratio into a percentage deviation from its moving average: (RS Smoothed − RS MA) / RS MA × 100. Positive values mean RS is above its MA (outperforming regime); negative values mean RS is below its MA (underperforming regime). The zero line represents the MA crossover level, providing a clean, scale-independent view regardless of absolute price ratios.
- Stock vs Benchmark Divergence — When the stock makes higher highs/lows while the benchmark makes lower highs/lows (bullish divergence), or vice versa (bearish divergence), it reveals shifting relative strength. Wyckoff considered such divergences as powerful early signals of which instrument is being accumulated or distributed. Divergences are confirmed at bar close, and a configurable cooldown period prevents excessive signaling.
- Wave Comparison (Wyckoff Wave Analysis) — Compares the average amplitude of rallies and declines between stock and benchmark. A stock that rallies more and declines less than the benchmark is "Dominant" — showing genuine underlying strength. A stock that rallies less and declines more is "Submissive" — a sign of innate weakness.
- Outperformance Scoring — A composite 0-100 score centered at 50 (neutral) combining RS trend direction, RS momentum, relative performance, and wave quality. Each component is scaled to its typical size on the current chart, so the grades read the same on any timeframe. Scores above 70 indicate clear outperformance; below 30 indicate significant weakness.
How does the Wyckoff Comparative Strength indicator work?
1. RS Ratio Calculation & Oscillator The raw RS ratio is computed as the current stock's close divided by the benchmark symbol's close on each bar. This raw ratio is smoothed with a short SMA (default 3 periods) to reduce noise while preserving responsiveness. A longer-period SMA (default 20 periods) serves as the trend reference moving average. The indicator then converts these into a zero-centered oscillator by calculating the percentage deviation of the smoothed RS from its MA:
- RS Ratio = Close / Benchmark Close
- Smoothed RS = SMA(RS Ratio, RS Smoothing)
- RS MA = SMA(RS Ratio, RS MA Period)
- Oscillator = (Smoothed RS − RS MA) / RS MA × 100
- Oscillator above zero → outperforming (green fill)
- Oscillator below zero → underperforming (red fill)
This Mansfield-style approach ensures the Y-axis stays centered around zero regardless of the absolute price ratio between stock and benchmark, making the oscillator universally readable across any instrument pair.
2. Performance Comparison The indicator measures the percentage return of both the stock and the benchmark over a configurable lookback period (default 20 bars). Relative performance is the difference between the two, showing how much the stock is outperforming or underperforming in absolute terms.
- Stock Performance = (Close − Close[N]) / Close[N] × 100%
- Benchmark Performance = (Bench Close − Bench Close[N]) / Bench Close[N] × 100%
- Relative Performance = Stock Performance − Benchmark Performance
3. Wave Comparison (Wyckoff Wave Analysis) Wyckoff's wave analysis compares how aggressively a stock rallies versus its benchmark and how well it resists declines:
- Per-bar percentage up-moves and down-moves are calculated separately for both stock and benchmark, over the same interval for both, on every bar where the benchmark prints a new bar
- Bars where the benchmark market is closed (for example crypto or forex against SPY at night and on weekends) are skipped, so the benchmark's carried-forward price is never counted as a flat bar
- These are averaged over the Wave Comparison Length (default 20 bars)
- Rally Ratio = Average Stock Rally / Average Benchmark Rally — values above 1.0× mean the stock rallies harder
- Decline Resistance = Average Benchmark Decline / Average Stock Decline — values above 1.0× mean the stock declines less
- A ratio reads 1.00× (neutral) when neither the stock nor the benchmark moved in that direction, and both ratios are limited to 10×
- Wave Classification: both ratios above 1.1 = "Dominant ▲", both below 0.9 = "Submissive ▼", mixed = "Rally Strong", "Decline Resist", or "Neutral ═"
- In the info table, each ratio is shown in the bullish color above 1.1, in the bearish color below 0.9, and in the neutral color in between
4. Divergence Detection Divergences between stock and benchmark swing extremes are detected using a two-window comparison method:
- Window 1 (recent): highest high and lowest low of the last N bars
- Window 2 (previous): highest high and lowest low of the N bars before that
- Bullish divergence: stock makes higher high while benchmark makes lower high, OR stock makes higher low while benchmark makes lower low — stock is stronger
- Bearish divergence: stock makes lower high while benchmark makes higher high, OR stock makes lower low while benchmark makes higher low — stock is weaker
- Conflicting swings give no signal: when the stock widens its range (higher high and lower low) while the benchmark narrows (lower high and higher low), or the reverse, neither a bullish nor a bearish divergence is marked
- Divergences are evaluated on closed bars: on the live bar, a label, background tint or alert appears only once the bar has closed, so signals do not appear and then vanish
- Edge trigger ensures each divergence fires only once on the transition bar, avoiding repeated signals
- Divergence Cooldown (default 10 bars) enforces a minimum gap between same-type signals, preventing excessive noise in trending markets
- Divergence labels include detailed tooltips showing the specific swing comparison, relative performance, RS ratio value, and strength score
5. Outperformance Scoring The composite score ranges from 0 to 100, centered at 50 (neutral — performing in line with benchmark). Four components contribute:
- RS Trend (±15 points): how far the RS ratio is above or below its MA
- RS Momentum (±15 points): rate of change of the RS ratio over the performance lookback
- Relative Performance (±10 points): stock vs benchmark percentage return difference
- Wave Quality (±10 points): combined rally ratio and decline resistance strength, measured on a log scale so that a stock which simply moves more (or less) than the benchmark in both directions scores neutral
The first three components are scaled by their own typical size on the current chart (the root mean square of roughly the last 100 bars): a typical reading earns half of the component's points, and a reading of twice the typical size or more earns the full points. This keeps the grades comparable across timeframes and instruments. RS Momentum and Relative Performance both follow the stock's return versus the benchmark over the Performance Lookback, so they usually point the same way. The score is rounded to a whole number before it is graded.
Score grades: 70+ = Outperforming, 50-69 = Neutral, 30-49 = Underperforming, below 30 = Weak.
Features
- Zero-Centered RS Oscillator — Displays the RS ratio as a percentage deviation from its moving average, providing a clean oscillator view that stays centered around zero regardless of absolute price ratios between stock and benchmark (Mansfield RS approach)
- Zero Reference Line — The zero line represents the RS MA crossover level. Oscillator above zero = outperforming; below zero = underperforming, with instant visual polarity
- RS/Zero Fill Zone — Green fill when oscillator is above zero (outperforming); red fill when below (underperforming), providing instant visual feedback on the current strength regime
- Stock vs Benchmark Divergence Detection — Identifies bullish and bearish divergences by comparing swing highs and lows between the stock and benchmark across two adjacent windows
- Divergence Cooldown — Configurable minimum bar gap (default 10) between same-type divergence signals, preventing excessive noise in trending or choppy markets
- Edge-Triggered Divergence Labels — Labels appear once per divergence transition, confirmed at bar close, with detailed tooltips including swing comparison details, relative performance, RS ratio, and strength score
- Wave Comparison Analysis — Compares average rally and decline amplitudes between stock and benchmark, classifying the relationship as Dominant, Submissive, Rally Strong, Decline Resist, or Neutral
- Rally Ratio and Decline Resistance Metrics — Quantitative measures of how the stock rallies versus the benchmark and how well it resists declines, displayed in the info table
- Outperformance Scoring (0-100) — Composite score centered at 50 combining RS trend, RS momentum, relative performance, and wave quality with four grades (Outperforming, Neutral, Underperforming, Weak)
- Performance Comparison — Side-by-side N-bar percentage returns for stock and benchmark with the difference shown as Relative Performance
- Divergence Background Coloring — Optional background tinting on divergence bars for instant identification of relative strength shifts
- Configurable Benchmark Symbol — Compare against any index, ETF, or symbol. Default SPY for US equities; change to QQQ, DIA, IWM, or any relevant benchmark
- Info Table (13 rows) — Real-time dashboard showing Benchmark symbol (marked "no data" or "warm-up" when the benchmark cannot be used yet), RS Ratio, RS Trend, Stock/Benchmark/Relative Performance, Wave classification, Rally Ratio, Decline Resistance, Strength Score with grade, Divergence counts, and Last Divergence age
- Alert System — Individual alerts for bullish and bearish divergences, sent once at bar close, with detailed messages including ticker, benchmark, swing comparison type, relative performance, price, benchmark price, RS ratio, and score
How to use the Wyckoff Comparative Strength indicator
- Add the indicator to your chart. It opens in a separate pane below the price chart, displaying the RS strength oscillator around a zero line.
- Set the Benchmark Symbol to match your market. For US stocks, SPY (S&P 500) is the default. For Nasdaq-heavy stocks, consider QQQ. For crypto, use BTCUSD or a broader crypto index.
- When the oscillator is above zero (green fill), the stock is outperforming its benchmark — this is the Wyckoff definition of comparative strength favoring the stock.
- Watch for bullish divergence labels: the stock is making higher highs or higher lows while the benchmark makes lower ones. This is a leading indicator that the stock is being accumulated more aggressively than the market.
- Watch for bearish divergence labels: the stock is making lower highs or lower lows while the benchmark makes higher ones. This suggests distribution or relative weakness in the stock.
- Check the Wave classification in the info table. "Dominant ▲" with Rally Ratio above 1.0× and Decline Resistance above 1.0× confirms the stock both rallies harder and declines less — the hallmark of Wyckoff comparative strength.
- Use the Score (0-100) for quick assessment. Scores above 70 ("Outperforming") indicate strong relative strength suitable for long-side entries. Scores below 30 ("Weak") indicate significant underperformance.
- Combine with other Wyckoff indicators: when Accumulation & Distribution (#1) shows Phase C/D and this indicator shows the stock outperforming the benchmark with the oscillator above zero, the probability of a successful markup increases substantially.
- During market-wide selloffs, monitor which stocks keep the oscillator above zero. These relative strength leaders often produce the strongest rallies when the broader market recovers.
- Adjust the RS MA Period for different trading styles: shorter (10-14) for swing trading, longer (30-50) for position trading.
Limitations
- This indicator does not generate buy or sell signals. It measures relative strength between a stock and a benchmark for educational and analytical purposes based on Wyckoff methodology.
- The indicator displays in a separate pane (not overlaid on price). The oscillator shows the percentage deviation of the RS ratio from its moving average, not the absolute RS ratio value. The smoothed RS ratio (SMA over the RS Smoothing length) is shown in the info table.
- Divergence detection uses a fixed window comparison method. In strong trending markets, divergences may be rare; in choppy markets, they may fire more frequently. Adjust the Divergence Lookback and Divergence Cooldown to match market conditions.
- Divergence signals are confirmed at bar close. On the live bar they appear only after the bar closes, never during it.
- Wave comparison requires sufficient up and down bars within the wave length. In strong one-directional trends, one side may have very small average moves, making ratios volatile. A minimum threshold of 0.001% prevents division-by-zero issues, and both ratios are limited to 10×.
- The benchmark symbol must be available on TradingView and have data for the current timeframe. If the benchmark returns no data, the RS ratio will not be calculated and the Benchmark row of the info table shows "(no data)". Divergences and the score start once the benchmark has enough bars of its own history; until then the table shows "(warm-up)".
- When the benchmark trades fewer hours than the chart symbol (for example crypto or forex against SPY), the RS ratio, performance and divergence windows use the benchmark's last available price while its market is closed. Only the wave comparison skips those bars.
- Volume is not used in this indicator. Wyckoff comparative strength focuses on price behavior relative to benchmark, not volume dynamics. Combine with volume-based indicators (VSA #3, Selling & Buying Climax #5) for complete Wyckoff analysis.
- Past relative strength does not guarantee future performance. A stock outperforming today may begin underperforming at any time.
Trading involves risk. This indicator is an analysis tool, not financial advice: use it alongside your own analysis and risk management.
Release notes
v2.0LatestBar-close divergences and a timeframe-neutral score
Divergence labels, tint and alerts are now confirmed at bar close, conflicting swings no longer produce two opposite signals, and the strength score means the same on any timeframe.
After updating
- Delete and re-create your alerts for this indicator with the "Any alert() function call" condition. TradingView alerts keep running the script version they were created with.
Fixed
- Divergence labels, background tint and alerts are confirmed at bar close, so they no longer appear on the live bar and vanish.
- Conflicting swings no longer mark a bullish and a bearish divergence on the same bar.
- Wave comparison now works while the benchmark market is closed, for example crypto against SPY at night, and false divergences at the start of the benchmark's history are gone.
Improved
- Score components are scaled to their typical size on the chart, so grades mean the same on any timeframe, and volatility alone no longer adds points. The printed score now matches its grade.
- The RS ratio is readable on low-priced symbols, oscillator values show 2 decimals, and the table notes when the benchmark has no data or is still warming up.
- Alerts include the price, the benchmark price and the RS ratio.
Frequently Asked Questions
What is the Wyckoff Comparative Strength indicator?
TradingView indicator that measures Wyckoff Comparative Strength — relative performance vs benchmark with RS oscillator and divergence analysis.
Is Wyckoff Comparative Strength free to use on TradingView?
Yes, Wyckoff Comparative Strength is completely free to use. You can add it directly to your TradingView charts at no cost.
How do I add Wyckoff Comparative Strength to my TradingView chart?
Open TradingView, click on "Indicators" at the top of your chart, search for "Wyckoff Comparative Strength" by FibAlgo, and click to add it. It will appear on your chart immediately.
What trading strategies work best with Wyckoff Comparative Strength?
Wyckoff Comparative Strength is commonly used for Wyckoff Method, Momentum, and Oscillators analysis. It works well as part of a multi-indicator confirmation strategy on any timeframe.
Learn More
- Technical Analysis for Crypto Trading: The Definitive GuideLearn technical analysis from basics to advanced for cryptocurrency trading. Master chart patterns, indicators, volume analysis, and multi-timeframe strategies.
- Smart Money Concepts (SMC): How Institutional Traders Move MarketsLearn Smart Money Concepts including order blocks, fair value gaps, liquidity sweeps, and breaker blocks. Understand how institutions trade.
- Risk Management in Crypto Trading: The Complete Survival GuideMaster position sizing, stop losses, portfolio allocation, and emotional discipline for crypto trading. Learn why risk management matters most.
Start Using Wyckoff Comparative Strength
This indicator is free to use on TradingView. Add it to your charts and use it alongside your own analysis.
Related indicators
View All
Wyckoff Price Cycle
TradingView indicator that identifies the four Wyckoff market cycle phases — Accumulation, Markup, Distribution, and Markdown — confirmed on closed bars.
See Details
Wyckoff SOS & SOW
TradingView indicator that identifies Wyckoff Sign of Strength (SOS) and Sign of Weakness (SOW) events with LPS/LPSY confirmations.
See Details
Wyckoff Re-Accumulation & Re-Distribution
TradingView indicator that detects Wyckoff Re-Accumulation and Re-Distribution patterns — consolidation pauses within established market trends.
See Details
Wyckoff Accumulation & Distribution
TradingView indicator that automatically detects Wyckoff Accumulation and Distribution schematics as each bar closes, with phase classification (A through E).
See Details
ICT SMT Divergence
TradingView indicator that detects ICT SMT Divergence — cross-symbol analysis comparing swing extremes to identify institutional manipulation.
See Details