Harmonic Oscillator - Multi-Component Momentum ConsensusHarmonic Oscillator - Multi-Component Momentum Consensus
Harmonic Oscillator is a seven-component momentum analysis system that transforms standard oscillators into a unified consensus framework. The indicator combines RSI, Stochastic RSI, MACD, EMA Trend, Momentum, Volume, and Divergence Zone detection into a single composite oscillator with automatic regime classification and qualified voting.
Rather than monitoring multiple separate indicators, traders can observe how these momentum calculations align or diverge through a single panel displaying vote count (X/7), regime state (TRENDING/BIAS/RANGING), and a normalized composite line.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗢𝗩𝗘𝗥𝗩𝗜𝗘𝗪
Traditional momentum analysis often requires monitoring multiple oscillators simultaneously: RSI for momentum strength, Stochastic for extreme zones, MACD for trend-following momentum, and so on. Each indicator has its own scale, its own interpretation rules, and its own blind spots.
Harmonic Oscillator addresses this by implementing a voting system where seven independent components each cast a vote based on their specific criteria. The indicator then:
• Counts votes to show consensus level (displayed as X/7)
• Blends three oscillators into a single normalized composite line (0-100 scale)
• Classifies market regime based on composite position and baseline confirmation
• Detects divergences between price structure and oscillator structure
• Filters signals through optional higher timeframe trend alignment
The result is a unified view of momentum conditions that may help traders identify when multiple factors are agreeing versus conflicting.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗛𝗢𝗪 𝗜𝗧 𝗪𝗢𝗥𝗞𝗦
The indicator is built around one core principle: momentum readings are more meaningful when multiple independent calculations agree.
𝗧𝗵𝗲 𝗦𝗲𝘃𝗲𝗻 𝗩𝗼𝘁𝗶𝗻𝗴 𝗖𝗼𝗺𝗽𝗼𝗻𝗲𝗻𝘁𝘀
Each component analyzes a different aspect of momentum and casts a bullish, bearish, or neutral vote:
𝟭. 𝗥𝗦𝗜 (𝗠𝗼𝗺𝗲𝗻𝘁𝘂𝗺-𝗔𝘄𝗮𝗿𝗲)
What it does: RSI is calculated with additional RMA smoothing to reduce noise. The voting logic requires both threshold position AND slope confirmation. RSI must be above 50 with rising slope to vote bullish, or below 50 with falling slope to vote bearish. Special conditions detect potential reversals (RSI below 30 but rising).
How to interpret it: A green RSI arrow in the panel indicates bullish momentum with directional confirmation. A red arrow indicates bearish. Gray dash means RSI is not showing clear directional conviction.
𝟮. 𝗦𝘁𝗼𝗰𝗵𝗮𝘀𝘁𝗶𝗰 𝗥𝗦𝗜 (𝗦𝗹𝗼𝗽𝗲 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀)
What it does: Stochastic RSI uses EMA smoothing on K and D lines for stability. The vote requires K-line momentum alignment: K above D with positive slope for bullish, K below D with negative slope for bearish.
How to interpret it: This component captures turning points in momentum. When SRSI votes while RSI doesn't (or vice versa), it may indicate the oscillators are at different phases of a move.
𝟯. 𝗠𝗔𝗖𝗗 (𝗛𝗶𝘀𝘁𝗼𝗴𝗿𝗮𝗺 𝗔𝗰𝗰𝗲𝗹𝗲𝗿𝗮𝘁𝗶𝗼𝗻)
What it does: Rather than voting on histogram direction alone, MACD votes on histogram acceleration, which is the rate of change of the histogram. This approach aims to identify momentum shifts before the histogram crosses zero.
How to interpret it: MACD acceleration can signal momentum changes early. A bullish vote means histogram is positive and accelerating, OR negative but accelerating upward.
𝟰. 𝗘𝗠𝗔 𝗧𝗿𝗲𝗻𝗱 (𝗣𝗼𝘀𝗶𝘁𝗶𝗼𝗻 + 𝗦𝗹𝗼𝗽𝗲)
What it does: Requires both price position relative to EMA AND slope confirmation. Price above EMA with positive EMA slope = bullish vote. Price below EMA with negative slope = bearish vote.
How to interpret it: This prevents votes in ambiguous situations where price is above a falling EMA or below a rising EMA. The EMA vote indicates clear trend alignment.
𝟱. 𝗠𝗼𝗺𝗲𝗻𝘁𝘂𝗺 (𝗥𝗮𝘁𝗲 𝗼𝗳 𝗖𝗵𝗮𝗻𝗴𝗲)
What it does: Uses smoothed Rate of Change (ROC) with the same qualification requirement: ROC positive AND increasing for bullish, ROC negative AND decreasing for bearish.
How to interpret it: Pure momentum measurement. When MOM agrees with trend components, directional conviction may be higher.
𝟲. 𝗩𝗼𝗹𝘂𝗺𝗲 (𝗖𝗼𝗻𝗳𝗶𝗿𝗺𝗮𝘁𝗶𝗼𝗻)
What it does: Compares current volume to recent average. Votes bullish when volume is elevated (1.2x+ average) on an up candle. Votes bearish when elevated volume accompanies a down candle.
How to interpret it: Volume confirmation adds weight to directional moves. Low volume readings during directional moves may indicate less conviction.
𝟳. 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲 𝗭𝗼𝗻𝗲
What it does: Detects when price and oscillator are in extreme zones with structural disagreement. Votes bullish when oscillator is oversold but price is making higher lows. Votes bearish when oscillator is overbought but price is making lower highs.
How to interpret it: This component specifically looks for potential reversal setups where momentum and price structure are disagreeing.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗪𝗛𝗬 𝗧𝗛𝗘𝗦𝗘 𝗖𝗢𝗠𝗣𝗢𝗡𝗘𝗡𝗧𝗦 𝗪𝗢𝗥𝗞 𝗧𝗢𝗚𝗘𝗧𝗛𝗘𝗥
The seven components are designed to capture different aspects of momentum:
1. 𝗥𝗦𝗜 + 𝗦𝘁𝗼𝗰𝗵𝗮𝘀𝘁𝗶𝗰 𝗥𝗦𝗜: Two approaches to measuring momentum strength and turning points
2. 𝗠𝗔𝗖𝗗 + 𝗠𝗼𝗺𝗲𝗻𝘁𝘂𝗺: Trend-following momentum and pure rate of change
3. 𝗘𝗠𝗔 𝗧𝗿𝗲𝗻𝗱: Price position relative to moving average with slope confirmation
4. 𝗩𝗼𝗹𝘂𝗺𝗲: Participation confirmation on directional moves
5. 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲 𝗭𝗼𝗻𝗲: Structural disagreement detection in extreme zones
When multiple factors align (RSI slope confirms, MACD accelerates, EMA trend agrees, volume confirms), this represents broad momentum agreement. Such conditions may warrant attention, though they do not guarantee any particular outcome.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗛𝗢𝗪 𝗧𝗢 𝗨𝗦𝗘
This section provides step-by-step guidance for interpreting the indicator's visual elements.
𝗦𝘁𝗲𝗽 𝟭: 𝗖𝗵𝗲𝗰𝗸 𝘁𝗵𝗲 𝗥𝗲𝗴𝗶𝗺𝗲 𝗖𝗹𝗮𝘀𝘀𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻
The regime label at the top of the status panel provides immediate market context:
• TRENDING ▲ or TRENDING ▼: Composite oscillator at extremes (above 65 or below 35) with 200 EMA baseline confirming direction. This may indicate sustained directional momentum.
• BIAS ▲ or BIAS ▼: Composite showing moderate lean (above 55 or below 45) without extreme readings. Directional tendency without full momentum extension.
• RANGING: Composite near midpoint (45-55 zone). This may indicate consolidation, indecision, or transition between directional moves.
The regime classification helps contextualize other readings. A high vote count during TRENDING may indicate trend continuation. The same vote count during RANGING may indicate an emerging directional move.
𝗦𝘁𝗲𝗽 𝟮: 𝗢𝗯𝘀𝗲𝗿𝘃𝗲 𝘁𝗵𝗲 𝗩𝗼𝘁𝗲 𝗖𝗼𝘂𝗻𝘁
The vote count (displayed as X/7) shows how many components currently agree:
• 6/7 or 7/7: High consensus. Most or all components showing directional agreement through their different calculation methods.
• 4/7 or 5/7: Moderate consensus. Majority agreement with some components neutral or conflicting.
• 1/7 to 3/7: Low consensus. Components are in disagreement or showing mixed readings.
The consensus meter bar at the bottom of the oscillator panel also visualizes this. Brighter colors indicate higher consensus.
𝗦𝘁𝗲𝗽 𝟯: 𝗥𝗲𝗮𝗱 𝘁𝗵𝗲 𝗖𝗼𝗺𝗽𝗼𝘀𝗶𝘁𝗲 𝗢𝘀𝗰𝗶𝗹𝗹𝗮𝘁𝗼𝗿
The main oscillator line blends RSI, Stochastic RSI, and MACD using winsorized normalization:
• Above 75 zone: Extended bullish momentum (overbought region)
• Above 85 zone: Extreme overbought
• Below 25 zone: Extended bearish momentum (oversold region)
• Below 15 zone: Extreme oversold
• 45-55 zone: Neutral/consolidation area
The signal line (thinner line) provides crossover reference. When composite crosses above signal = bullish momentum shift. Below = bearish shift.
Important: Like all oscillators, the composite can remain at extremes during strong directional moves. Overbought does not mean "sell"; it means momentum is extended.
𝗦𝘁𝗲𝗽 𝟰: 𝗖𝗵𝗲𝗰𝗸 𝗜𝗻𝗱𝗶𝘃𝗶𝗱𝘂𝗮𝗹 𝗖𝗼𝗺𝗽𝗼𝗻𝗲𝗻𝘁𝘀
The status panel shows each component's current vote with arrows:
• ▲ (green): Component voting bullish
• ▼ (red): Component voting bearish
• — (gray): Component neutral/no vote
This breakdown helps identify which factors are agreeing and which are diverging. For example, if RSI and SRSI show bullish but MACD shows bearish, momentum may be mixed.
𝗦𝘁𝗲𝗽 𝟱: 𝗪𝗮𝘁𝗰𝗵 𝗳𝗼𝗿 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀
Divergence labels appear when price and oscillator structure disagree:
• ▲ DIV (bullish): Price makes lower low, oscillator makes higher low. Appears only in oversold zone (below 25).
• ▼ DIV (bearish): Price makes higher high, oscillator makes lower high. Appears only in overbought zone (above 75).
Divergences indicate structural disagreement that may precede reversals. However, divergences can persist or resolve without reversal. They are one input for analysis, not standalone signals.
𝗦𝘁𝗲𝗽 𝟲: 𝗖𝗼𝗺𝗯𝗶𝗻𝗲 𝗠𝘂𝗹𝘁𝗶𝗽𝗹𝗲 𝗙𝗮𝗰𝘁𝗼𝗿𝘀
The indicator provides the most context when multiple elements align:
Example Scenario A (Trend Continuation):
Composite holding above 65 for eight bars. Regime reads TRENDING▲, votes at 6/7, no divergence labels. The oscillator hasn't touched the 85 extreme zone yet. Components are aligned with room to extend before reaching overbought conditions.
Example Scenario B (Momentum Fading):
Regime shows BIAS▼ during a two-day selloff. But votes just dropped from 5/7 to 3/7, and the composite crossed above the signal line. The regime label says bearish while components are losing agreement. This type of disconnect often appears before moves stall or reverse.
Example Scenario C (Exhaustion Warning):
After a rally, composite hits 87 in the extreme zone. A ▼ DIV label appears. Votes drop from 7/7 to 4/7 over three bars. None of this guarantees reversal, but multiple warning signs appearing together (extreme reading, divergence, falling consensus) suggest caution.
Example Scenario D (Breakout From Consolidation):
Regime has shown RANGING for two days, composite hovering 48-52, votes stuck at 2/7 to 3/7. Then regime flips to BIAS▲, votes jump to 5/7, composite breaks above 55. When all three shift together after a quiet period, consolidation may be resolving into a directional move.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗡𝗔𝗩𝗜𝗚𝗔𝗧𝗜𝗡𝗚 𝗗𝗜𝗙𝗙𝗘𝗥𝗘𝗡𝗧 𝗠𝗔𝗥𝗞𝗘𝗧 𝗖𝗢𝗡𝗗𝗜𝗧𝗜𝗢𝗡𝗦
𝗧𝗿𝗲𝗻𝗱𝗶𝗻𝗴 𝗠𝗮𝗿𝗸𝗲𝘁𝘀
In trending conditions, traders may observe the regime classification showing "TRENDING" with baseline confirmation, composite remaining in the upper or lower half of the range, and high consensus readings (5-7 votes) persisting across multiple bars. The qualification requirements help maintain agreement during trends. A sustained move where RSI stays above 50 with positive slope, MACD histogram accelerates, and EMA slope confirms will show consistent directional votes. Divergences may appear in extreme zones but may not resolve immediately during strong trends.
𝗥𝗮𝗻𝗴𝗶𝗻𝗴 𝗠𝗮𝗿𝗸𝗲𝘁𝘀
In ranging or consolidating conditions, the regime classification will often show "RANGING" or alternate between brief directional readings. The composite typically oscillates around the 50 line without reaching sustained extremes, and vote counts fluctuate without reaching high consensus for extended periods. Divergences appearing at range extremes may be more significant in these conditions, potentially indicating range boundaries.
𝗛𝗶𝗴𝗵 𝗩𝗼𝗹𝗮𝘁𝗶𝗹𝗶𝘁𝘆 𝗘𝘃𝗲𝗻𝘁𝘀
During high volatility events, components may respond rapidly to price changes. Vote counts can swing from high bullish to high bearish consensus quickly. The regime classification helps contextualize whether these swings are occurring within a larger trending structure or representing genuine momentum reversals. The composite may reach extreme zones (85+ or 15-) during volatility spikes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗧𝗘𝗖𝗛𝗡𝗜𝗖𝗔𝗟 𝗗𝗘𝗧𝗔𝗜𝗟𝗦
• Normalization uses winsorized statistics: extreme values are clipped before scaling to prevent outliers from dominating the composite blend
• Qualification logic requires directional confirmation (slope, acceleration) beyond simple threshold positions
• Divergence detection uses pivot comparison with left/right bar lookback, filtered to extreme zones only
• Regime classification combines composite position thresholds with 200 EMA slope direction
• HTF data uses confirmed bars only with request.security() lookahead disabled
• All signals fire on bar close only (non-repainting): historical display matches live behavior
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗨𝗡𝗜𝗤𝗨𝗘 𝗙𝗘𝗔𝗧𝗨𝗥𝗘𝗦
• 𝗦𝗲𝘃𝗲𝗻-𝗖𝗼𝗺𝗽𝗼𝗻𝗲𝗻𝘁 𝗩𝗼𝘁𝗶𝗻𝗴: Each component uses qualification criteria beyond simple thresholds, reducing noise from single-indicator false signals
• 𝗤𝘂𝗮𝗹𝗶𝗳𝗶𝗲𝗱 𝗩𝗼𝘁𝗲𝘀: Components only vote when showing directional conviction (slope confirmation, acceleration, etc.), not just static positions
• 𝗖𝗼𝗺𝗽𝗼𝘀𝗶𝘁𝗲 𝗡𝗼𝗿𝗺𝗮𝗹𝗶𝘇𝗮𝘁𝗶𝗼𝗻: Three oscillators blended using winsorized statistics for a smoother, more stable reading than any single oscillator
• 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗰 𝗥𝗲𝗴𝗶𝗺𝗲 𝗗𝗲𝘁𝗲𝗰𝘁𝗶𝗼𝗻: TRENDING/BIAS/RANGING classification provides immediate market context
• 𝗛𝗧𝗙 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲 𝗙𝗶𝗹𝘁𝗲𝗿: When enabled, divergence signals are filtered by higher timeframe trend direction to reduce counter-trend noise
• 𝗡𝗼𝗻-𝗥𝗲𝗽𝗮𝗶𝗻𝘁𝗶𝗻𝗴: All calculations use confirmed bar data only. Historical display matches what was shown in real-time.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗦𝗘𝗧𝗧𝗜𝗡𝗚𝗦 𝗢𝗩𝗘𝗥𝗩𝗜𝗘𝗪
𝗖𝗼𝗿𝗲 𝗦𝗲𝘁𝘁𝗶𝗻𝗴𝘀
• 𝗦𝗶𝗴𝗻𝗮𝗹 𝗠𝗼𝗱𝗲: Alert threshold only (no visual change). Controls when High Consensus alerts fire:
- Conservative = 6+ votes to trigger alert
- Balanced = 5+ votes (default)
- Aggressive = 4+ votes
• 𝗛𝗧𝗙 𝗙𝗶𝗹𝘁𝗲𝗿: When enabled, divergence signals are filtered by higher timeframe trend. Bullish divergences only appear when HTF is bullish (price above HTF EMA). Bearish divergences only appear when HTF is bearish. Helps avoid counter-trend signals.
• 𝗛𝗧𝗙 𝗧𝗶𝗺𝗲𝗳𝗿𝗮𝗺𝗲: Timeframe used for HTF filter (default 4H). The indicator checks if price is above/below the 50 EMA on this timeframe.
𝗗𝗶𝘀𝗽𝗹𝗮𝘆 𝗦𝗲𝘁𝘁𝗶𝗻𝗴𝘀
• Show Divergences: Toggle divergence labels on/off
• Show Consensus Meter: Toggle vote count bar at bottom of oscillator
• Show Status Panel: Toggle the info table
• Show OB/OS Zone Fills: Toggle colored fill zones for extreme areas
𝗧𝗮𝗯𝗹𝗲 𝗦𝗲𝘁𝘁𝗶𝗻𝗴𝘀
• Table Position: 9 position options (corners, centers, edges)
• Table Font Size: Tiny/Small/Normal
• Table Layout: Horizontal (wide, desktop) or Vertical (compact, mobile-friendly)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗔𝗟𝗘𝗥𝗧𝗦
14 alert conditions available:
𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲 𝗔𝗹𝗲𝗿𝘁𝘀
• Bullish Divergence / Bearish Divergence: Divergence detected in extreme zone
• Any Divergence: Either type detected
𝗖𝗿𝗼𝘀𝘀𝗼𝘃𝗲𝗿 𝗔𝗹𝗲𝗿𝘁𝘀
• Bullish Crossover / Bearish Crossover: Composite crosses signal line
• Any Crossover: Either type detected
𝗘𝘅𝘁𝗿𝗲𝗺𝗲 𝗭𝗼𝗻𝗲 𝗔𝗹𝗲𝗿𝘁𝘀
• Extreme Overbought / Extreme Oversold: Composite enters 85/15 zones
• Exit Overbought / Exit Oversold: Composite exits 85/15 zones
𝗥𝗲𝗴𝗶𝗺𝗲 𝗔𝗹𝗲𝗿𝘁𝘀
• Regime to Bullish / Regime to Bearish: Regime classification changes direction
𝗖𝗼𝗻𝘀𝗲𝗻𝘀𝘂𝘀 𝗔𝗹𝗲𝗿𝘁𝘀
• High Bull Consensus / High Bear Consensus: Vote count reaches Signal Mode threshold (6+/5+/4+ depending on mode). Alert only, no visual change.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗟𝗜𝗠𝗜𝗧𝗔𝗧𝗜𝗢𝗡𝗦
• 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀 𝘁𝗼𝗼𝗹, 𝗻𝗼𝘁 𝗮 𝘀𝗶𝗴𝗻𝗮𝗹 𝗴𝗲𝗻𝗲𝗿𝗮𝘁𝗼𝗿: This indicator displays consensus, regime state, and divergences for the trader to interpret. It does not tell you when to buy or sell.
• 𝗖𝗼𝗻𝘀𝗲𝗻𝘀𝘂𝘀 𝗰𝗮𝗻 𝗹𝗮𝗴: By the time all components agree, price movement may have already begun. High consensus readings indicate current agreement, not future direction.
• 𝗘𝘅𝘁𝗿𝗲𝗺𝗲𝘀 𝗰𝗮𝗻 𝗽𝗲𝗿𝘀𝗶𝘀𝘁: Like all oscillators, the composite can remain at extremes during strong directional moves. Overbought does not mean "must reverse."
• 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 𝗮𝗿𝗲 𝗻𝗼𝘁 𝗴𝘂𝗮𝗿𝗮𝗻𝘁𝗲𝗲𝗱: Divergences indicate structural disagreement. They may precede reversals but can also persist or resolve without reversal.
• 𝗟𝗮𝗴𝗴𝗶𝗻𝗴 𝗶𝗻𝗱𝗶𝗰𝗮𝘁𝗼𝗿: All signals are derived from historical price data and confirm on bar close.
• 𝗣𝗮𝘀𝘁 𝗽𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝗱𝗼 𝗻𝗼𝘁 𝗴𝘂𝗮𝗿𝗮𝗻𝘁𝗲𝗲 𝗳𝘂𝘁𝘂𝗿𝗲 𝗿𝗲𝘀𝘂𝗹𝘁𝘀.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗖𝗢𝗡𝗖𝗟𝗨𝗦𝗜𝗢𝗡
Harmonic Oscillator provides a structured framework for analyzing momentum through seven independent components, a normalized composite oscillator, and automatic regime classification. The indicator is designed to help traders identify when multiple momentum factors are agreeing versus conflicting, which may provide useful context for analysis.
The voting system, qualification requirements, and regime detection work together to present a unified view of momentum conditions that would otherwise require monitoring multiple separate indicators.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔶 𝗗𝗜𝗦𝗖𝗟𝗔𝗜𝗠𝗘𝗥
Trading is risky and most traders lose money. This indicator is provided for informational and educational purposes only. It does not constitute financial advice, and past performance does not guarantee future results. All content, tools, and analysis should not be considered as recommendations to buy or sell any asset. Users are solely responsible for their own trading decisions. Always use proper risk management and consider consulting a qualified financial advisor before making trading decisions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built with PineScript v6. Non-repainting. All signals confirmed on bar close.
Wskaźnik Pine Script®















