Adaptive Composite Oscillator (ACO)Adaptive Composite Oscillator (ACO)
A momentum oscillator that adapts its own lookback length, normalization bands, and signal logic to current market conditions, rather than relying on the fixed parameters and fixed 70/30-style bands used by traditional oscillators like RSI or Stochastic.
How it works
1. Adaptive lookback. The effective momentum length shortens when recent volatility (ATR relative to its own average) is elevated, and lengthens when volatility is calm. The oscillator speeds up in choppy or volatile stretches and slows down in quiet ones, instead of using one fixed period regardless of context.
2. Manual adaptive RSI. Pine's built-in ta.rsi() requires a fixed length, which a bar-by-bar adaptive length can't satisfy. So the RSI is built manually with a Wilder-style recursive average whose smoothing factor is derived from the adaptive length on every bar — same underlying math as RSI, just computed in a way that tolerates a variable length.
3. KAMA-style smoothing. The raw adaptive RSI is passed through a Kaufman Adaptive Moving Average-style filter, using an efficiency ratio between fast and slow EMA constants. This makes the line track efficient, directional moves closely while damping down noise during back-and-forth chop.
4. Statistical normalization. Rather than fixed overbought/oversold levels, the smoothed momentum is converted into a z-score against its own rolling mean and standard deviation. The ±2 SD bands self-calibrate to each instrument's own volatility character instead of using one arbitrary threshold for every market.
5. Regime filter (ADX/DMI). An ADX reading classifies conditions as ranging or trending. In ranging conditions, z-score extremes are treated as mean-reversion signals. In strong trends (ADX above threshold), those same extremes are deliberately ignored — since momentum can stay "overbought" for a long time inside a real trend — and instead a zero-line cross in the direction confirmed by +DI/−DI is treated as a trend-continuation signal.
6. Volume confirmation. Every signal additionally requires volume above its own moving average, filtering out low-participation moves that wouldn't hold up.
7. Algorithmic divergence with connecting lines. Bullish and bearish divergence is detected by comparing confirmed price pivots to oscillator pivots — a defined rule, not a discretionary read — and drawn as connecting lines on both the price chart and the oscillator pane, so the actual shape of the divergence is visible rather than marked with a single dot.
What's plotted
Oscillator line (z-score), colored by regime — gray for ranging, blue for confirmed uptrend, orange for confirmed downtrend
Dashed ±2 SD statistical bands and a zero line
Yellow background shading while in a strong-trend regime
Green/red triangles for volume-confirmed long/short signals
Magenta/lime connecting lines for bearish/bullish divergence, on both panes
How to use it
Start by reading the regime background: yellow shading means the market is trending strongly by ADX; no shading means it's ranging. That tells you which of the two signal modes is currently active. Then read the line color — gray, blue, or orange — which tells you the direction of any active trend. Triangles mark volume-confirmed signals: green below the line for long, red above for short. Connecting lines mark divergence: magenta between two price/oscillator highs for bearish, lime between two lows for bullish — these appear a few bars after the second pivot confirms, since a pivot needs bars on both sides to validate.
The strongest setups combine elements rather than relying on one signal alone — for example, a long triangle firing alongside a lime divergence line, or a trend-mode zero-cross that agrees with a higher-timeframe trend you've checked separately. Avoid taking ranging-mode mean-reversion signals against a clearly shaded trending background — that's exactly the mismatch the regime filter exists to prevent.
All lengths, the ADX trend threshold, volume multiplier, pivot lookback, and KAMA constants are adjustable in settings; the defaults are a reasonable starting point, not a finished strategy. Four alert conditions are built in (Long Signal, Short Signal, Bullish Divergence, Bearish Divergence) via TradingView's standard Add Alert dialog. 指标

指标

VWAP Rope Band by ByblloVWAP Rope Band plots a smoothed trend line (the "rope") that only moves once price has traveled beyond a VWAP-deviation threshold from its last position - small back-and-forth noise around VWAP is absorbed, and the line only steps when a move is statistically meaningful.
The threshold is the standard deviation of (close - VWAP) over a lookback period, scaled by a multiplier, so the surrounding band automatically widens or narrows with how far price is currently dispersing from VWAP - no manual adjustment needed as volatility changes.
A genuine trend reversal is only registered once the rope actually reverses direction (not on every VWAP wiggle). That short transition window gets its own color, an optional gradient cloud, and an optional Buy/Sell badge at the exact bar the reversal is confirmed.
INTENDED USE
Works well for short-term futures scalping - Nasdaq futures, KOSPI200 futures, and similar instruments. Built and tested primarily on the 1-minute chart, but the underlying VWAP/rope/band logic is timeframe-agnostic and holds up well on 2, 3, and 5-minute charts and other intraday timeframes too. The StdDev Length and Band Multiplier adapt to volatility automatically, but it's worth rechecking them when you switch timeframe or instrument.
FEATURES
- Threshold-based "rope" trend line that ignores VWAP noise, only stepping on statistically meaningful deviations
- Volatility-adaptive band (self-widening/narrowing standard-deviation envelope around the rope)
- True-gradient cloud fill between rope and band, with adjustable steepness
- Confirmed-reversal transition detection with its own color/cloud, auto-expiring after 5 bars if unresolved
- Optional Buy/Sell badge plotted at the exact bar a reversal is confirmed
- Two alert families: simple rope crossover/crossunder, and confirmed Buy/Sell signal alerts
- Works on any chart type (candlestick, Heikin Ashi, Renko, etc.) since prices are pulled via request.security() from the underlying ticker
This is a visual/alerting tool only - it does not place real orders. For educational and informational purposes only, not financial advice. Always verify how the rope and bands behave on your specific symbol and timeframe before relying on them for live trading. 指标

Thermometer OscillatorThermometer Oscillator
This one comes from David Bowden's Gann trading material — a quick way to check whether a trend still has gas in the tank or is about to stall. I built it as a simple momentum readout, nothing fancy.
Each bar gets scored on three things, added up into one number from -5 to +5:
1. Today's close vs. yesterday's close — +2 if higher, -2 if lower, 0 if it didn't move.
2. Today's close vs. today's open — same idea, +2/-2/0.
3. Today's range vs. yesterday's close — +1 if the whole bar sat above yesterday's close, -1 if it sat entirely below, 0 if yesterday's close landed inside the bar.
Add the three up and you get a number between -5 and +5. It plots like an RSI, with lines at +5, +3, 0, -3 and -5 so you can see where things stand at a glance. There's also a moving average on top (EMA by default, 9-period, but you can switch to SMA/WMA/RMA and change the length) to smooth out the noise.
Don't trade off this thing alone. It's an early-warning tool, not a signal. The way it's meant to be used: watch for it disagreeing with price. If a market's been sitting at +5 for a few days and then drops to +1 while price is still grinding out higher highs, that's momentum leaking out before the chart shows it.
Bowden's original write-up covers the daily version — previous day vs. current day. He does the same thing for the weekly trend, but you don't need a second calculation for that, just flip the chart to a weekly timeframe and read it the same way.
Educational tool only, not trading advice. Do your own homework before putting money behind it. 指标

Volatility Regime Breakout [Squeeze + ATR + Trend + PreAlert]Volatility Regime Breakout
Indicador híbrido que combina tres capas de confirmación para detectar el nacimiento de regímenes de alta volatilidad y filtrar entradas de baja calidad en mercados laterales.
Cómo funciona:
🔹 Squeeze (BB vs KC): detecta cuándo las Bandas de Bollinger se comprimen dentro de los Canales de Keltner — una fase de baja volatilidad que históricamente precede a movimientos direccionales fuertes.
🔹 Pre-Alerta: antes del release, el indicador mide si la compresión se está acelerando (contracción del ancho de banda) para avisarte con anticipación (fondo morado + icono ⚠) de que una entrada podría estar gestándose — no es señal de entrada, es un aviso temprano.
🔹 Confirmación de expansión (ATR Ratio): al salir del squeeze, exige que el ATR esté expandiéndose realmente respecto a su media, filtrando rupturas falsas sin volumen/rango real detrás.
🔹 Dirección de tendencia (EMA + pendiente): solo genera señal de compra/venta cuando la ruptura coincide con la dirección de la tendencia de fondo, evitando operar contra-tendencia en el primer impulso.
Incluye:
Fondo de color diferenciado para 3 estados: squeeze normal, pre-alerta, breakout confirmado
Señales BUY/SELL en vela cerrada (sin repintado)
Niveles de Stop Loss / Take Profit sugeridos basados en ATR (referencia visual, no ejecución automática)
Alertas configurables independientes para pre-alerta y entrada confirmada, con mensajes personalizados
Todos los parámetros de sensibilidad son ajustables desde el panel de configuración
Recomendado para: BTC y criptoactivos de alta volatilidad, marcos temporales de 1h en adelante para reducir ruido.
⚠️ Este script es una herramienta de análisis técnico, no un sistema de trading automático ni una recomendación financiera. Los niveles de SL/TP son referenciales. Se recomienda validar la lógica mediante backtesting propio antes de usar en cuenta real, y aplicar siempre una gestión de riesgo adecuada. 指标

Minor H1 BIAS Analyse## 1. Purpose of the Script
The **Minor H1 BIAS Analyse** is designed to determine the short-term directional market BIAS.
It does not provide entries. Instead, it evaluates several trend, momentum, and structure conditions and classifies the market as:
Long
Short
Neutral
The script should therefore be used as a directional filter together with a separate entry strategy.
---
## 2. Structure of the Minor BIAS
The Minor BIAS is based on five components:
EMA Trend
Price vs EMA
Current Candle Direction
Previous H1 High / Low Break
Market Structure Break
Each bullish condition adds one point to the Bull Score.
Each bearish condition adds one point to the Bear Score.
The maximum possible score is:
5 Long
5 Short
---
## 3. EMA Trend
The script uses two exponential moving averages:
Fast EMA: 20
Slow EMA: 50
If the Fast EMA is above the Slow EMA:
+1 Long
If the Fast EMA is below the Slow EMA:
+1 Short
This represents the basic trend direction.
---
## 4. ATR Neutral Buffer
The script uses an optional ATR buffer around the EMAs.
Default settings:
ATR Length: 14
ATR Multiplier: 0.20
The buffer creates a neutral zone around the EMAs.
Price must move clearly above or below both EMAs before the condition becomes bullish or bearish.
This helps filter small movements and market noise.
---
## 5. Price vs EMA
For a bullish condition, price must close above both EMAs plus the ATR Buffer.
Result:
+1 Long
For a bearish condition, price must close below both EMAs minus the ATR Buffer.
Result:
+1 Short
If price remains inside the buffer area:
No Score
The dashboard displays:
Inside Buffer
---
## 6. Current Candle Direction
The script also evaluates the current candle.
Bullish Candle:
Close above Open
+1 Long
Bearish Candle:
Close below Open
+1 Short
Doji:
No Score
This adds a simple momentum component to the BIAS.
---
## 7. Previous H1 High / Low Break
The script checks whether price closes above or below the previous candle.
Close above Previous High:
+1 Long
Close below Previous Low:
+1 Short
No Break:
No Score
This filter can be enabled or disabled in the settings.
The script uses the candle close, not only the wick.
---
## 8. Market Structure
The script also analyzes the previous market structure.
Default Lookback:
5 candles
It calculates:
Structure High
Structure Low
If price closes above the Structure High:
Bullish Structure Break
+1 Long
If price closes below the Structure Low:
Bearish Structure Break
+1 Short
If neither level is broken:
Range
No Score
---
## 9. Score System
The final Minor BIAS is calculated from the Bull Score and Bear Score.
Possible Long points:
EMA Trend
Price vs EMA
Bullish Candle
Previous High Break
Bullish Structure Break
Possible Short points:
EMA Trend
Price vs EMA
Bearish Candle
Previous Low Break
Bearish Structure Break
A minimum of three points is required.
---
## 10. Minor LONG
The Minor BIAS becomes Long when:
Bull Score is at least 3
and
Bull Score is greater than Bear Score.
Example:
Bull Score: 4
Bear Score: 1
Result:
MINOR LONG
---
## 11. Minor SHORT
The Minor BIAS becomes Short when:
Bear Score is at least 3
and
Bear Score is greater than Bull Score.
Example:
Bull Score: 1
Bear Score: 4
Result:
MINOR SHORT
---
## 12. Neutral
If neither side reaches the required conditions, the BIAS remains Neutral.
Example:
Bull Score: 2
Bear Score: 2
Result:
NEUTRAL
Neutral therefore represents an unclear or mixed market situation.
---
## 13. Dashboard
The dashboard shows the current state of every component.
It contains:
BIAS
EMA Trend
Price vs EMA
H1 Candle
Previous H1 Break
Structure
ATR Buffer
It also displays the current:
Bull Score / Bear Score
Example:
4 / 1
This makes it possible to understand why the current BIAS is Long, Short, or Neutral.
---
## 14. Chart Visualization
The script can display:
Fast EMA
Slow EMA
Previous H1 High / Low
Structure High / Low
BIAS Background
BIAS Label
Dashboard
Each visualization can be enabled or disabled individually.
The calculations continue to work even when the corresponding chart elements are hidden.
---
## 15. Alerts
The script includes alerts for:
Minor H1 LONG
Minor H1 SHORT
Minor H1 NEUTRAL
These can be used to receive a TradingView notification when the directional BIAS changes.
---
## 16. Meaning for Trading
The Minor BIAS should not be treated as an entry signal.
A simple trading rule would be:
**MINOR LONG:** Prefer Long setups.
**MINOR SHORT:** Prefer Short setups.
**NEUTRAL:** Wait for clearer conditions.
The actual entry should come from a separate trading setup.
---
## 17. BIAS Strength
The score can also be used to estimate the strength of the current direction.
3 Points:
Valid directional confirmation
4 Points:
Strong confirmation
5 Points:
Very strong alignment
For example:
5 / 0 Long
represents stronger bullish confirmation than:
3 / 2 Long
even though both are classified as MINOR LONG.
---
## 18. Important Timeframe Note
The current script uses the timeframe of the active chart.
That means the calculations are only truly based on H1 when the indicator is used on a **1-hour chart**.
If the script is placed on M5 or M1, the calculations also use M5 or M1 data.
For a true H1 BIAS that remains identical on every chart, the calculations would need to use fixed 60-minute data.
---
## 19. Conclusion
The **Minor H1 BIAS Analyse** is a score-based directional filter.
It combines:
Trend
Price Position
Momentum
Previous Candle Break
Market Structure
At least three confirmations are required for a directional BIAS.
The final result is:
MINOR LONG
MINOR SHORT
NEUTRAL
Its purpose is to identify the stronger short-term market direction before a separate entry setup is considered.
++ This was only used on NQ ++
指标

Squeeze Pro [StrixEDGE]📊 WHAT IT DOES
StrixEDGE Squeeze Pro detects when Bollinger Bands contract inside Keltner Channels — a condition known as the "squeeze" — indicating extremely low volatility that typically precedes explosive moves. It measures squeeze intensity across three levels and uses MACD momentum to predict the breakout direction.
🔬 WHY IT'S DIFFERENT
Standard squeeze indicators show only ON/OFF. This version introduces three intensity levels: the tighter the Bollinger Bands compress inside Keltner Channels, the more powerful the expected breakout. Level 3 (extreme) squeezes historically produce the largest moves. Additionally, a real-time statistics table shows squeeze frequency, average duration, directional bias, and average post-squeeze move size for the current chart.
⚙️ HOW IT WORKS
The indicator calculates Bollinger Band width relative to Keltner Channel width. When BB fits inside KC, a squeeze is active. The ratio between their widths determines intensity:
• Level 1 (yellow dots): Light compression, ratio 0.8-1.0
• Level 2 (orange dots): Medium compression, ratio 0.5-0.8
• Level 3 (red dots): Extreme compression, ratio below 0.5
A four-color MACD momentum histogram shows breakout direction:
• Dark green = bullish accelerating, Light green = bullish fading
• Light red = bearish fading, Dark red = bearish accelerating
📈 HOW TO USE
• Wait for red/orange squeeze dots (Level 2-3) to accumulate
• When dots turn green (squeeze fires), enter in the histogram's direction
• Dark green histogram bars after squeeze = LONG entry
• Dark red histogram bars after squeeze = SHORT entry
• Level 3 squeezes produce the most reliable and powerful breakouts
• Use the stats table to understand squeeze behavior on your specific chart/timeframe
🎛️ INPUTS & DEFAULTS
BB: 20 period, 2.0 multiplier | KC: 20 period, 1.5 multiplier
MACD: 12/26/9 | Stats Lookback: 200 bars
All fully customizable.
═══════════════════════════════════════════════════════
🔧 CUSTOMIZATION
All parameters are fully adjustable through the indicator settings panel. Inputs are grouped logically:
• ⚙️ Core Parameters — main calculation settings
• 📊 Table Settings — table size (Tiny to Huge), position (4 corners), visibility toggle
• 🎨 Visual Settings — colors, show/hide elements
• 🔔 Alert Settings — threshold values for notifications
📊 DATA TABLE
A built-in data table displays all key metrics in real-time. Adjust the table size from Tiny to Huge to match your chart layout. Position it in any corner. Toggle visibility on/off.
🔔 ALERTS
Pre-built alert conditions for all major signals. Set up alerts via TradingView's alert dialog — select this indicator and choose from the available conditions.
⏱️ RECOMMENDED TIMEFRAMES
Works on all timeframes. Recommended: 1H, 4H, Daily for best signal quality. Lower timeframes produce more signals but with higher noise. Weekly/Monthly for position trading context.
✅ COMPLIANCE
• No repainting — all signals based on confirmed bar close data
• No future data references
• Open-source code — verify the logic yourself
⚠️ DISCLAIMER
This indicator is a technical analysis tool, not financial advice. It does not predict future price movements. Past patterns and signals do not guarantee future results. Trading involves substantial risk of loss. Always use proper risk management, including stop losses and appropriate position sizing. Never risk more than you can afford to lose. 指标

指标

Percentile Momentum Rotation [Pineify]Percentile Momentum Rotation
Overview
Percentile Momentum Rotation is a Pine Script v6 oscillator that converts fast, medium, and slow rate of change into a comparable spectrum. It shows a centered score, horizon coherence, a fast-slow wave, and a dashboard for momentum context rather than prediction.
Problem Definition
Raw ROC is a percentage return over one window. An 8-bar ROC has a different range from a 55-bar ROC, and the same value can be ordinary in a volatile regime but unusual in a quiet one. Averaging raw readings lets the largest horizon dominate, while fixed thresholds change meaning with the distribution. The design must retain each horizon's information but remove its local scale before combination.
Design Rationale
Each ROC is ranked against its own history and centered from -100 to +100, avoiding an assumption of normal returns. A z-score was rejected because outliers can distort its mean and deviation; a raw blend was rejected because it keeps the scale mismatch. The centroid is discounted when horizon polarities disagree or ranks spread apart. This favors coherent states but reacts less to an early one-window turn. The visual hierarchy follows these variables: primary score first, explanatory layers second.
Key Features
Three independently normalized ROC percentile streams.
A coherence-weighted composite and fast-slow rotation wave.
A state-colored spectrum, horizon fan, confirmed alerts, and dashboard.
Balanced, fast-focus, and slow-focus weighting.
How It Works
The script calculates percentage ROC over fast, medium, and slow lengths. ta.percentrank compares each current ROC with its configured history. Percentile 50 maps to zero, 100 to +100, and 0 to -100. Positive therefore means high versus that horizon's recent distribution; it does not guarantee a positive raw return.
The centered ranks form a weighted centroid; the three profiles shift emphasis across horizons. Polarity checks whether ranks share a side outside the dead zone, while compactness measures dispersion. Their 0-to-1 coherence controls a 0.55-to-1.00 consistency factor applied to the score.
The wave is half the fast-minus-slow rank difference. Color encodes score direction, halo intensity encodes coherence, and fan width shows dispersion. Output remains empty through warm-up. Visuals update intrabar; diamonds and alerts require bar close.
How Multiple Indicators Work Together
This is one pipeline, not a mashup. ROC supplies horizon change; percentile rank removes local scale; the centroid summarizes location; polarity and dispersion test coherence; and the consistency factor forms the score. The wave exposes lead-lag behavior that the centroid hides, while the fan visualizes disagreement. Removing a stage either removes momentum, restores the comparability problem, or hides confidence.
Trading Ideas and Insights
Upper and lower states organize review of relative momentum expansion. Synchronization means all horizons are unusual versus their own histories, not that a trade must follow. The wave reveals whether fast momentum leads or lags the slow horizon; repeated zero crossings describe unstable context. Confirm with independent structure and risk controls.
Unique Aspects
ROC and percentile rank are standard; the contribution is their information architecture. Each horizon is normalized against itself, then the composite is discounted by both side agreement and compactness. It separates historical location, synchronization, and lead-lag rotation; the same variables control halo, fan, and wave. No retrieved code is reproduced.
How to Use
Allow the slow ROC plus percentile history to warm up.
Start with Balanced and read score, coherence, and wave together.
Treat synchronization as context, then assess price structure and risk separately.
Use confirmed alerts; current-bar plots may move before close.
Disable secondary layers for a cleaner chart.
Customization
Short ROC windows react faster but rotate more often; long windows add persistence and lag. Longer percentile history provides broader context but adapts more slowly after regime shifts. The dead zone sets how much near-median movement is directionless. Rotation thresholds define context and extremes; Synchronization Threshold sets required agreement. Weight profiles change the analytical question, so comparisons should keep settings consistent.
Assumptions and Limitations
The source and available history must be representative enough for ranking. Percentiles are relative: a high rank can occur while raw returns are negative if the decline is milder than recent declines. Results depend on lengths, lookback, and structural breaks. It is lagging and omits volume, execution, fundamentals, and structure. Visuals can change before close; alerts wait for confirmation. No future values or external data are used, but this does not establish performance.
Conclusion
Percentile Momentum Rotation turns incompatible ROC scales into an auditable spectrum. It keeps relative location, coherence, and lead-lag rotation distinct but connected, helping diagnose momentum context without treating thresholds as guaranteed entries.
指标

Triple Supertrend Confluence [MarkitTick]💡 A triple-layer Supertrend confluence system that fuses adaptive volatility bands, multi-timeframe bias, momentum strength, volume conviction, and a cooldown throttle into a single, high-confidence trend signal — then automates the entire trade plan around it with ATR-scaled stop-loss and three staged take-profit levels.
✨ Originality and Utility
Most Supertrend implementations on the platform are single-instance: one ATR period, one multiplier, one line. This script restructures the classic Supertrend into a voting system. Three independently parameterized Supertrend instances (a primary "core" trend and two auxiliary "fast" and "slow" trackers) are calculated in parallel from the same underlying price source, and a signal is only treated as valid when a configurable number of these instances agree on direction. This confluence layer is what separates the tool from a standard Supertrend plot — it is designed to filter out the single biggest weakness of trend-following overlays: getting whipsawed by a solitary indicator flipping on marginal price action.
On top of the consensus layer, the script lets traders stack up to four independent, optional confirmation filters (trend strength via ADX/DMI, higher-timeframe directional bias, relative volume, and a bar-count cooldown) before a signal is considered "confirmed." Each filter can be toggled independently, so the tool scales from a bare-bones single Supertrend up to a fully gated, multi-condition trend-following system. A real-time dashboard keeps every filter's pass/fail state visible at a glance, and an automated trade-planning layer converts each confirmed flip into a structured entry/stop/three-tier-target plan, plotted directly on the chart and exposed through webhook-ready JSON alert payloads.
🔬 Methodology and Concepts
• Core Supertrend Engine
The underlying trend engine follows the standard Supertrend construction: an ATR-derived envelope is built around a price source, with an upper band (source plus a multiple of ATR) and a lower band (source minus a multiple of ATR). These bands are "ratcheted" bar to bar — the lower band can only rise or reset if price closes below the prior lower band, and the upper band can only fall or reset if price closes above the prior upper band. The active trend line switches between the lower band (uptrend) and upper band (downtrend) whenever price closes through the opposite band, producing the familiar stepped Supertrend line. This engine is reused three times with different parameters to build the confluence system described below.
• Adaptive Source Smoothing
Rather than feeding raw HL2 price directly into the Supertrend engine, the script offers eight optional smoothing methods to pre-condition the source: Simple, Exponential, and Wilder's Moving Averages; a Double-Pass Weighted Moving Average; a Triple-Pass Volume-Weighted Moving Average; a Hull Moving Average; a custom slope-adjusted average (LLAMA) that blends a simple mean with a linear slope projection over the lookback window; and a single-state Kalman Filter that recursively updates an estimate and its error covariance bar by bar to produce a noise-adaptive average. Smoothing the source before it reaches the Supertrend calculation reduces false flips caused by single-bar noise spikes, at the cost of some responsiveness.
• Adaptive Volatility Factor
Instead of using a fixed ATR multiplier for the core Supertrend band width, the script can compute a percentile rank of current ATR against its own recent history (a lookback window of your choosing). This rank is then mapped linearly onto a user-defined minimum/maximum multiplier range. In practice, this means the band automatically widens during historically high-volatility regimes (reducing whipsaw) and tightens during historically low-volatility regimes (increasing sensitivity), rather than using one static multiplier across all conditions.
• Triple Consensus Voting
Two additional Supertrend instances — a faster-reacting pair (shorter ATR length, smaller multiplier) and a slower-reacting pair (longer ATR length, larger multiplier) — run alongside the core engine on the same smoothed source. When consensus mode is enabled, a signal is only marked confirmed if at least two of the three instances (including the core) agree on direction. This is a simple majority-vote filter designed to suppress signals that are specific to one particular band setting rather than representative of the broader trend structure.
• ADX / DMI Trend Strength Filter
An optional Average Directional Index filter, calculated using Wilder's Directional Movement methodology, requires ADX to be at or above a user-defined threshold before a flip is confirmed. This is a standard technique for distinguishing genuine directional moves from choppy, non-trending price action, since Supertrend-style systems are known to underperform in low-ADX ranging conditions.
• Higher-Timeframe Bias Filter
An optional filter pulls the trend direction of the same Supertrend engine calculated on a higher, user-selected timeframe, and only confirms a signal if it aligns with that higher-timeframe bias. The higher-timeframe value is read from the prior, fully closed bar on that timeframe to avoid any intra-bar recalculation, ensuring the filter reflects only confirmed historical structure rather than an in-progress bar.
• Volume Confirmation Filter
An optional filter compares current bar volume against its own moving average, requiring volume to exceed the average by a user-defined multiple before a signal is confirmed. This is a simple conviction check: trend changes accompanied by above-average participation are treated as more reliable than those occurring on thin volume.
• Cooldown Guard
An optional bar-count throttle prevents a new confirmed signal in the same direction as a recent prior signal if too few bars have elapsed since that prior signal within the same directional segment, reducing rapid re-signaling during choppy transition periods.
• Confirmation Lag Notice
All confirmation logic (consensus vote, ADX filter, HTF bias, volume filter, cooldown guard) and the resulting BULL/BEAR labels, alerts, and trade-level plotting are evaluated strictly on confirmed, closed bars using barstate.isconfirmed. This means every signal displayed or alerted is final and will not repaint once printed. However, users should be aware that a signal is only confirmed one bar after the actual Supertrend flip occurs, since the confirmation checks (particularly the higher-timeframe bias filter) require a fully closed bar to evaluate safely. This introduces a small, deliberate one-bar lag between the raw trend flip and the confirmed signal in exchange for eliminating repainting.
• Automated Trade Level Engine
On every confirmed flip, the script calculates a full trade plan from the entry price (the confirmed close), an ATR-scaled stop-loss (a user-defined multiple of ATR away from entry), and three take-profit levels defined as user-configurable risk:reward multiples of the initial stop distance. These levels are drawn as extending lines and labels, with shaded risk and reward zones between them, and refresh automatically on each new confirmed signal unless the signal is manually locked.
🎨 Visual Guide
Stepped trend line (color reflects the Up/Down Color inputs): traces the active Supertrend band. It plots along the lower band while price is in an uptrend and the upper band while price is in a downtrend.
Muted/gray trend line: when a filter is active but not yet satisfied, the trend line temporarily switches to the Unconfirmed Color to signal that the raw trend has flipped but confirmation is still pending.
Soft background fill (Up Fill / Down Fill colors): a translucent shaded region behind price reinforcing the current trend direction.
Heatmap candles: when enabled, candle bodies and wicks are recolored using the Heatmap Up/Down colors to match the current trend direction, offering an at-a-glance visual of trend state independent of the line itself.
"BULL" / "BEAR" labels: printed below or above the bar respectively, only on confirmed flips that pass every active filter.
Gray cooldown background: a shaded band that appears across the chart while the Cooldown Guard is actively suppressing new signals.
Trade level lines: a solid red Stop-Loss line, a dashed blue Entry line, and three dashed teal Take-Profit lines (TP1 lightest, TP3 most opaque), each extending to the right of the current bar with a price label attached, shown only when Show Trade Levels is enabled.
Shaded risk/reward zones: a light red fill between Stop-Loss and Entry (the risk zone) and a light teal fill between Entry and TP3 (the reward zone).
On-chart dashboard table: displays symbol/timeframe, Lock status, current Trend direction, Confirmed state, ADX value with a color-coded strength percentage, active Adaptive Filter type, Consensus vote count, HTF Bias direction and pass/fail, Volume filter pass/fail, and remaining Cooldown bars — all updating on the most recent bar.
📖 How to Use
Use the stepped trend line and background fill as the primary trend read: price above the line with an up-colored fill suggests an uptrend context; price below with a down-colored fill suggests a downtrend context.
Treat a "BULL" or "BEAR" label as the actionable signal rather than the raw line flip — labels only appear once every enabled filter has passed, meaning the signal has already been screened for trend strength, higher-timeframe alignment, volume conviction, and cooldown status.
If the trend line is showing the Unconfirmed Color, the underlying trend has technically flipped but is still waiting on one or more active filters — treat this as a "watch" state rather than a trade trigger.
Check the dashboard on each new bar to see exactly which filter(s) are passing or failing before a signal can confirm; this is useful for understanding why an expected signal did not appear.
When Show Trade Levels is enabled, use the plotted Stop-Loss, Entry, and TP1/TP2/TP3 lines as a starting reference for structuring a trade around a confirmed signal — adjust position sizing and targets to your own risk tolerance.
Enable Lock Signal to freeze the current trade-level plot in place (useful for screenshots or reviewing a specific setup) without it being overwritten by a new signal.
The JSON alert payloads are formatted for direct use in webhook-based automation, carrying action, ticker, timeframe, direction, and price fields for long entries, short entries, and their corresponding close-position triggers.
⚙️ Inputs and Settings
ATR Len / Factor: the ATR lookback and multiplier for the core Supertrend engine; higher Factor values produce a looser band and fewer, larger-magnitude signals.
Adaptive Factor (and Min/Max/Rank Len): when enabled, replaces the fixed Factor with a volatility-percentile-driven multiplier that ranges between Factor Min and Factor Max based on where current ATR sits within its own recent history.
Use ADX Filter / ADX Threshold / ADX Length: gates signal confirmation on trend strength; raise the threshold to demand stronger directional conviction before confirming.
Adaptive Filter / Adaptive Filter Len: selects the source-smoothing method applied before the Supertrend calculation, and its lookback length.
Use HTF Confluence / HTF: requires the selected higher timeframe's own Supertrend direction to agree before confirming a signal.
Use Volume Filter / Volume Avg Len / Volume Mult: requires current volume to exceed its moving average by the given multiple before confirming.
Use Cooldown Guard / Cooldown Bars: suppresses new same-direction signals for a set number of bars following a recent prior signal in the same directional segment.
Use Triple Consensus / Fast Factor / Fast ATR Len / Slow Factor / Slow ATR Len: enables the majority-vote filter and configures the auxiliary fast and slow Supertrend instances used to build consensus.
Lock Signal: freezes the currently plotted trade levels, preventing them from updating on a new signal.
Show Trade Levels: toggles the automated Entry/SL/TP1-3 line and label plotting.
SL ATR Mult: the ATR multiple used to place the stop-loss distance from entry.
TP1/TP2/TP3 R:R: the risk:reward multiples used to place each take-profit level relative to the stop distance.
Heatmap Candles / BULL-BEAR Labels / Show Dashboard / Position: visual display toggles and dashboard placement.
Long/Short/Close Long/Close Short Action: customizable string values embedded in the JSON alert payload's "action" field, for mapping to specific webhook automation commands.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
• Volatility-Based Trend Following (Supertrend / ATR Envelopes)
The core engine descends from the broader family of volatility-adjusted trend-following bands, which use Average True Range (a measure of typical price movement magnitude popularized by J. Welles Wilder) to scale a trailing stop-and-reverse line to prevailing market volatility rather than a fixed price distance. The ratcheting band logic ensures the line never moves against the prevailing trend, which is the defining mechanical property of a trailing-stop-style trend system as opposed to a simple moving average crossover.
• Percentile Ranking for Regime Adaptation
The adaptive factor mechanism applies percentile rank normalization — expressing current ATR as its standing relative to a distribution of its own recent historical values — as a way of contextualizing volatility without relying on a fixed absolute threshold, which allows the same logic to be meaningfully applied across instruments and timeframes with very different baseline volatility levels.
• Ensemble / Majority-Vote Filtering
The Triple Consensus mechanism is a straightforward application of ensemble logic: combining multiple independent estimators (in this case, differently parameterized instances of the same underlying model) and requiring agreement among a majority before acting. This is a well-established technique for variance reduction in signal processing and forecasting contexts, on the premise that independent estimators are less likely to agree by chance during noise-driven, non-trending conditions than during genuine directional moves.
• Wilder's Directional Movement / ADX
The ADX filter is drawn directly from J. Welles Wilder's Directional Movement System, which decomposes price movement into positive and negative directional components and derives a smoothed index (ADX) representing trend strength independent of direction. ADX below common threshold levels is widely associated with range-bound, non-trending conditions in technical analysis literature.
• Recursive State Estimation (Kalman Filtering)
The optional Kalman Filter smoothing method applies a simplified single-state form of the Kalman recursive estimation framework from control theory and signal processing, in which a running estimate is continuously updated by weighting new observations against the estimate's own error covariance, producing a smoothing average that adapts its responsiveness based on recent prediction error rather than using a fixed lookback window.
• Slope-Adjusted Trend Extrapolation (LLAMA)
The LLAMA smoothing option combines a simple arithmetic mean with a linear slope term derived from the change in price over the lookback window, projecting the average forward along the recent trend direction — a lightweight application of linear extrapolation principles used to reduce the inherent lag of simple averaging methods.
• Volume as a Conviction Proxy
The volume filter reflects the broader technical-analysis principle that price movements accompanied by above-average participation carry more informational weight than those on thin volume, a concept with roots in classical volume-price analysis dating back to early technical analysis literature (e.g., Dow Theory's treatment of volume as a confirming factor).
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. 指标

指标

指标

MAHQuant_IND_Divergence_v1.0MAHQuant Divergence for Many Indicators v1.0
A professional multi-indicator divergence detection system with advanced risk management features. This indicator combines powerful divergence scanning across 10+ technical indicators with automated Entry/SL/TP calculation and smart confluence filtering.
✨ Key Features:
1️⃣ Multi-Indicator Divergence Detection:
• Simultaneously scans for divergences across 10+ indicators:
MACD, MACD Histogram, RSI, Stochastic, CCI
Momentum, OBV, VW-MACD, CMF, MFI
Custom external indicator support
• Detects both Regular and Hidden divergences
• Bullish and Bearish divergence identification
• Visual divergence lines with customizable styles
2️⃣ Advanced Risk Management (NEW):
• Automatic SL/TP Calculation
Entry price based on signal candle close
Stop Loss using ATR-based dynamic calculation
Two Take Profit levels (TP1 = 1:1 RR, TP2 = 1:2 RR)
Visual horizontal lines for Entry, SL, TP1, TP2
• Max SL Distance Protection
Configurable maximum stop loss limit (default: 800 points)
Prevents excessive risk in high-volatility conditions
Automatically caps SL if ATR-based distance exceeds limit
3️⃣ Smart Confluence Filter (NEW):
• Option to show signals ONLY when both Regular AND Hidden divergences appear together
• Significantly reduces false signals
• Increases signal reliability and probability
4️⃣ Professional Visualization:
• Signal Label: Shows Entry, SL, TP1, TP2 prices directly on chart
• Auto-Clean Mode: Automatically removes old signal lines to keep chart clean
• Customizable line lengths, colors, and styles
• Pivot point markers (optional)
• Divergence count display
5️ Alert System:
• Built-in alerts for all divergence types
• Separate alerts for Regular Bullish/Bearish
• Separate alerts for Hidden Bullish/Bearish
• Combined positive/negative divergence alerts
⚙️ How to Use:
Basic Setup:
Add indicator to your chart
Select which indicators to scan (MACD, RSI, Stoch, etc.)
Choose divergence type: Regular, Hidden, or Both
Adjust Pivot Period (default: 5) based on your timeframe
Risk Management:
5. Set ATR Length (default: 14) for SL calculation
6. Adjust ATR Multiplier (default: 0.1-1.0) for SL distance
7. Configure Max SL Distance to limit maximum risk
8. Enable "Show SL/TP Lines" to visualize levels
Advanced Filtering:
9. Enable "Show Only Confluence" to filter for highest-probability signals
10. Use "Show Only Last Signal Lines" to keep chart clean
11. Adjust SL/TP Lines Length for visual preference
Trading Strategy:
• Entry: Enter on signal candle close or next candle open
• Stop Loss: Use the calculated SL level (below/above divergence pivot)
• Take Profit 1: Close 50% position at TP1 (1:1 RR)
• Take Profit 2: Close remaining 50% at TP2 (1:2 RR)
📊 Indicator Settings Explained:
• Pivot Period: Number of bars for pivot detection (higher = fewer but stronger signals)
• Source for Pivots: Use Close or High/Low for pivot calculation
• Divergence Type: Regular (reversal), Hidden (continuation), or Both
• Min Number of Divergence: Filter out weak signals (show only if X+ divergences detected)
• Max Pivot Points to Check: How far back to search for divergences
• ATR Multiplier: Higher = wider SL, lower = tighter SL
• Max SL Distance: Maximum allowed SL in points (prevents excessive risk)
🎯 Best Practices:
✅ Use on higher timeframes (1H, 4H, Daily) for more reliable signals
✅ Combine with trend analysis and support/resistance levels
✅ Enable Confluence filter for higher probability setups
✅ Always use proper position sizing and risk management
✅ Backtest on your preferred market before live trading
⚠️ Important Notes:
• This indicator provides signals based on divergence detection
• Not all signals will be profitable - always use stop loss
• Market conditions affect divergence reliability
• Past performance does not guarantee future results
• This is a tool to assist your analysis, not a standalone trading system
Credits & Acknowledgment:
• Original divergence detection logic inspired by LonesomeTheBlue's open-source "Divergence for Many Indicators v4" indicator
• Enhanced with professional risk management features, SL/TP automation, and confluence filtering by MAHQuant Trading System
• Thank you to the TradingView community for open-source collaboration and continuous learning
⚠️ Disclaimer:
This script is for educational and informational purposes only. It does not constitute financial, investment, or trading advice. The author is not responsible for any losses incurred from using this indicator. Past performance is not indicative of future results. Always conduct your own research and manage your risk appropriately. Trade at your own risk. 指标

Equalhigh Stochastic Dominance AuroraEQUALHIGH — STOCHASTIC DOMINANCE AURORA
OVERVIEW
Stochastic Dominance Aurora is a relative-strength regime indicator designed to identify when an asset begins to outperform a benchmark in a broad, persistent and progressively ordered manner.
Instead of relying on moving-average crossovers or overbought/oversold levels, Aurora compares the distributions of benchmark-relative returns across four consecutive time blocks.
Its purpose is to answer one practical question:
Is the asset developing genuine relative leadership, or is its recent outperformance driven by only a few exceptional bars?
The indicator is primarily designed for weekly stock analysis, although it can be used on other timeframes with appropriate settings.
HOW IT WORKS
Aurora first calculates the logarithmic return of the asset and subtracts the logarithmic return of the selected benchmark:
Relative Return = Asset Return − Benchmark Return
The observation window is then divided into four consecutive blocks:
• Block 1: oldest period
• Block 2: second period
• Block 3: third period
• Block 4: most recent period
The indicator uses a rank-based Jonckheere–Terpstra approach to determine whether the distribution of relative returns is progressively improving from the oldest block to the newest one.
Every observation in a newer block is compared with every observation in the preceding blocks. The resulting statistic is standardized into a Z-score and transformed into the Aurora Dominance line.
This rank-based method reduces the influence of isolated gaps and extreme price movements.
AURORA DOMINANCE LINE
The main line is normalized approximately between −100 and +100.
• Positive values indicate an improving relative-return structure.
• Negative values indicate a deteriorating relative-return structure.
• Values near zero indicate that no clear ordered regime has been detected.
• Values above +50 generally represent strong positive dominance.
• Values below −50 generally represent strong negative dominance.
The line measures relative structure, not absolute price direction. A stock may rise while Aurora deteriorates if the benchmark rises faster.
AURORA STATES
DORMANT — Violet
No statistically meaningful relative-return structure is present.
This is a neutral condition and does not automatically indicate weakness.
WATCH — Turquoise
The first signs of ordered relative improvement are appearing, but the evidence remains insufficient for confirmation.
This state can be used to add the asset to a watchlist.
ARMED — Cyan
The relative-return distributions are becoming meaningfully ordered and the asset is outperforming its benchmark.
The setup is developing, but one or more confirmation conditions may still be missing.
CONFIRMED — Blue
A statistically significant positive relative regime has been detected.
Confirmation requires:
• Z-score at or above the Confirmed threshold
• Positive relative momentum
• Sufficient path efficiency
• Rising Dominance score when acceleration is required
• A completed chart bar
This is the primary bullish confirmation state.
MATURE — Gold
The positive ordering has reached an exceptionally high statistical level.
Mature indicates strong relative leadership, but it may also mean that the move is already advanced. It is not automatically a new-entry signal.
FADING — Orange
The relative-return structure is deteriorating, although a complete bearish breakdown has not yet been confirmed.
This state suggests that relative leadership is weakening.
BREAKDOWN — Red
A statistically significant negative relative regime has been detected.
This condition requires negative relative momentum, sufficient path efficiency and a sufficiently negative Z-score.
SIGNAL MARKERS
BLUE “A” MARKER
A blue “A” marker appears when bullish confirmation becomes newly active on a confirmed bar.
The signal requires:
• Z-score at or above the Confirmed threshold
• Positive relative strength
• Efficiency at or above the selected minimum
• Score acceleration when enabled
• Bar-close confirmation
The marker is intended to identify the beginning of a confirmed relative-leadership regime. It is not an automatic buy signal.
RED “A” MARKER
A red “A” marker appears when bearish confirmation becomes newly active on a confirmed bar.
It identifies a new statistically ordered period of benchmark-relative deterioration.
DASHBOARD
DOMINANCE
The normalized Aurora reading displayed approximately between −100 and +100.
Z-SCORE
The standardized statistical strength of the ordered relative-return structure.
Default interpretation:
• Below 0.35: no meaningful positive structure
• 0.35 to 1.15: Watch
• 1.15 to 1.65: Armed
• 1.65 or higher: potential bullish confirmation
• 2.50 or higher: Mature positive structure
• −1.65 or lower: potential bearish breakdown
The Z-score alone does not generate confirmation. Relative momentum, efficiency and acceleration filters must also be satisfied.
RELATIVE STRENGTH
The asset’s percentage performance relative to the selected benchmark over the chosen lookback period.
• Positive: the asset outperformed the benchmark.
• Negative: the asset underperformed the benchmark.
EFFICIENCY
Efficiency measures how directly the relative-price curve travelled from its starting point to its current point.
Efficiency = Net Relative Movement ÷ Total Relative Path
A high value indicates a clean and directional relative move. A low value indicates a noisy or erratic path.
DEFAULT SETTINGS
The default configuration is designed for weekly charts:
• Block Length: 13
• Total statistical window: approximately 52 weeks
• Armed Z-score: 1.15
• Confirmed Z-score: 1.65
• Mature Z-score: 2.50
• Relative-Strength Lookback: 13
• Efficiency Lookback: 13
• Minimum Efficiency: 0.20
• Require Score Acceleration: Enabled
Four blocks of 13 weekly bars represent approximately one year of market history.
BENCHMARK SELECTION
Benchmark selection has a major influence on the results.
Suggested examples:
• Broad US equities: AMEX:SPY
• Nasdaq and growth stocks: NASDAQ:QQQ
• US small-cap stocks: AMEX:IWM
• Sector analysis: relevant sector ETF
• European equities: a broad European index or ETF supported by the data provider
The benchmark should represent the asset’s realistic opportunity set. Avoid comparing securities from unrelated markets or investment styles unless that comparison is intentional.
SENSITIVITY PROFILES
EARLY PROFILE
• Block Length: 10
• Confirmed Z-score: 1.45
• Minimum Efficiency: 0.15
This configuration produces earlier signals but increases the risk of false positives.
BALANCED PROFILE
• Block Length: 13
• Confirmed Z-score: 1.65
• Minimum Efficiency: 0.20
This is the recommended starting configuration.
SELECTIVE PROFILE
• Block Length: 13
• Confirmed Z-score: 1.96
• Minimum Efficiency: 0.25
This configuration produces fewer and generally stronger signals.
LONG-TERM PROFILE
• Block Length: 20
• Confirmed Z-score: 1.96
• Minimum Efficiency: 0.25
This configuration is slower and better suited to long-term trend confirmation.
PRACTICAL WORKFLOW
Aurora is best used as part of a complete investment process:
1. Confirm that company fundamentals are stable or improving.
2. Verify that valuation still provides an acceptable risk/reward profile.
3. Look for a Watch → Armed → Confirmed progression.
4. Check the price structure and nearby resistance levels.
5. Define the condition that would invalidate the investment thesis.
The strongest setup generally combines:
Improving fundamentals + acceptable valuation + positive relative strength + first blue Aurora confirmation
Aurora is designed to help determine when market recognition may be beginning. It does not determine whether the company is fundamentally undervalued.
ALERTS
Three alert conditions are included:
• Aurora — First Bullish Confirmation
• Aurora — First Bearish Confirmation
• Aurora — Mature Trend
For reliable notifications, configure TradingView alerts using:
Once Per Bar Close
NON-REPAINTING DESIGN
The script uses:
• No future pivots
• No negative plotting offsets
• No lookahead benchmark data
• No future-bar confirmation
• Signal markers confirmed only at bar close
Values may naturally evolve while the current realtime bar is still open. The blue and red markers are validated only after the bar closes.
LIMITATIONS
Aurora does not:
• Calculate fair value
• Analyse financial statements
• Predict earnings surprises
• Guarantee future outperformance
• Replace risk management
• Provide automatic buy or sell recommendations
The indicator may react late after a sudden price gap and may be less reliable on illiquid securities. Results also depend on the selected benchmark, timeframe and parameter configuration.
Aurora should therefore be used as a relative-regime confirmation tool rather than as a standalone trading system.
DISCLAIMER
This indicator is provided for educational and analytical purposes only. It does not constitute financial advice, investment advice or a recommendation to buy or sell any financial instrument. Past statistical relationships do not guarantee future results.
指标

指标

Nonparametric Relative Momentum [BackQuant]Nonparametric Relative Momentum
Overview
Nonparametric Relative Momentum is a percentile-rank oscillator that measures where the current price or momentum observation sits relative to its own recent empirical history.
Unlike conventional momentum oscillators that transform price using fixed arithmetic relationships, this indicator uses rank statistics . The current observation is compared directly against the previous values in a rolling window and converted into a percentile score from 0 to 100.
The result answers a simple question:
How extreme is the current observation relative to what this market has actually done recently?
Two calculation modes are available:
Price ranks the selected price source directly.
Momentum first measures price change across a configurable horizon, then ranks that momentum against its own recent history.
The oscillator also includes:
Mid-rank handling for tied observations.
Optional output smoothing.
An EMA signal line.
Configurable overbought and oversold zones.
Stepped intensity colouring as the rank becomes more extreme.
Main-chart candle colouring from the 50 midline regime.
Alerts for midline, extreme-zone and signal-line crossings.
Why “nonparametric”?
In statistics, a parametric method generally assumes that data can be described by a particular distribution or by parameters associated with that distribution.
A nonparametric method does not require the same distributional assumption.
Percentile ranks are a classic example.
The oscillator does not need to assume that recent price changes are:
Normally distributed.
Symmetric.
Constant in volatility.
Characterised by a stable mean and standard deviation.
Instead, it works directly from the ordering of the observed data.
If the current momentum observation is greater than almost every momentum observation in the recent window, it receives a high rank.
If it is lower than almost everything observed recently, it receives a low rank.
This makes the oscillator fundamentally relative to the market’s own recent empirical distribution.
Core calculation
The calculation occurs in three stages:
Select the series to rank.
Calculate its empirical percentile rank.
Optionally smooth that rank and calculate a signal average.
The selected ranking target depends on the Rank Target input.
Price Mode
In Price mode:
Target = Selected Price Source
The current source value is compared with the previous values in the Rank Window.
This answers:
Where is current price positioned within its recent price distribution?
A value near 100 means current price is above almost every observation in the comparison window.
A value near 0 means it is below almost every observation.
A value near 50 means it sits near the middle of its recent distribution.
Because Price mode ranks the price level itself, it behaves somewhat like a stochastic or price-position oscillator, although the calculation is based on empirical ranking rather than highest-lowest range normalisation.
Momentum Mode
Momentum mode first calculates:
Momentum = Source - Source
This measures the absolute price change across the selected Momentum Length.
The resulting momentum series is then percentile-ranked over the Rank Window.
The oscillator therefore answers:
How strong is the current momentum observation compared with recent momentum observations?
This is different from asking whether price itself is historically high or low.
For example, price can be near a recent high while momentum has weakened considerably. In that situation:
Price mode may remain highly ranked.
Momentum mode may fall toward the centre or lower half of the distribution.
Conversely, price does not need to be at a long-term extreme for momentum to rank very highly if the current change is unusually strong relative to recent movements.
Why Momentum mode is different from traditional RSI
The standard Relative Strength Index developed by J. Welles Wilder compares smoothed positive and negative price changes.
Its calculation depends on the relative magnitude of average gains and average losses.
Nonparametric Relative Momentum does not use that formula.
Instead:
A momentum observation is calculated.
That observation is ranked against its own historical sample.
For this reason, Momentum mode can be thought of as a rank-based relative momentum oscillator .
Both traditional RSI and this oscillator are bounded between 0 and 100, but the meaning of those values is different.
For example:
RSI = 90
means the balance of smoothed gains versus losses has produced an RSI reading of 90.
Nonparametric Relative Momentum = 90
means the current momentum observation ranks around the upper end of its recent empirical momentum distribution.
That distinction is important.
Percentile rank calculation
For each bar, the indicator compares the current target with every observation in the preceding Rank Window.
It counts:
How many previous values are below the current value.
How many previous values are exactly equal to it.
The percentile rank is then:
Rank = 100 × (Values Below + 0.5 × Equal Values) / Window Length
This produces an oscillator between 0 and 100.
Why use rank instead of magnitude?
Consider two markets.
Market A may normally move only 0.5% over the selected momentum horizon.
Market B may routinely move 5%.
A raw momentum threshold cannot be interpreted the same way for both.
Ranking changes the question.
Instead of asking:
How many points or percent did this market move?
the oscillator asks:
How unusual is this move relative to this market’s own recent behaviour?
This allows the same 0–100 framework to adapt naturally to different price scales and volatility regimes.
Mid-rank treatment of ties
A simple percentile implementation might count only observations strictly below the current value.
That can distort the result when repeated values occur.
This indicator uses mid-rank treatment .
If historical observations equal the current value, each tie contributes one half rather than being classified entirely above or below.
For example, suppose:
40% of observations are below the current value.
20% are exactly equal.
40% are above.
The mid-rank result is:
40 + 0.5 × 20 = 50
This places the tied observation at the centre of its equal-value group.
Mid-ranks are commonly used in rank-based statistics because they provide a more balanced treatment of ties.
Rank Window
The Rank Window determines how much historical data defines the current empirical distribution.
A shorter Rank Window:
Adapts quickly.
Responds strongly to recent regime changes.
Produces more rapid movement between percentiles.
Can create noisier extreme readings.
A longer Rank Window:
Builds the ranking from a larger sample.
Produces a more stable percentile estimate.
Makes extremes harder to reach.
Responds more slowly when market behaviour changes.
The window therefore controls the memory of the oscillator.
It does not smooth the underlying target directly. It changes the reference distribution against which the target is ranked.
Momentum Length
Momentum Length is used only when Rank Target is set to Momentum.
It controls the horizon over which price change is measured:
Momentum = Current Source - Source from Momentum Length bars ago
Shorter values:
Measure faster momentum.
React to shorter impulses.
Change direction more frequently.
Longer values:
Measure broader displacement.
Focus on more persistent movement.
Ignore more short-term fluctuation.
The Momentum Length and Rank Window perform separate roles.
Momentum Length determines what movement is measured.
Rank Window determines the historical sample against which that movement is judged.
Output Smoothing
The raw percentile rank can optionally be passed through an EMA.
A value of 1 leaves the rank effectively unsmoothed.
Higher values:
Reduce rapid rank fluctuations.
Create a smoother oscillator.
Reduce short-lived extreme readings.
Introduce additional lag.
The smoothing occurs after the percentile calculation.
It does not change how observations are ranked.
The 50 midline
The oscillator is centred around 50.
A value above 50 means the current observation ranks above the midpoint of its recent distribution.
A value below 50 means it ranks below the midpoint.
The interpretation depends on the selected mode.
Price mode above 50
Current price is positioned in the upper half of its recent price distribution.
Price mode below 50
Current price is positioned in the lower half.
Momentum mode above 50
Current momentum is stronger than roughly the middle of its recent momentum observations.
Momentum mode below 50
Current momentum is weaker relative to its recent distribution.
The indicator also uses this midline to colour main-chart candles:
Above or equal to 50 = bullish colour.
Below 50 = bearish colour.
This provides a simple relative-regime view on the price chart.
Percentile extremes
Because the oscillator represents rank rather than an unbounded magnitude, readings near 0 and 100 carry a straightforward interpretation.
Near 100
The current observation is greater than almost every value in the recent comparison window.
Near 0
The current observation is lower than almost every value.
These are empirical extremes.
They do not mean price or momentum cannot become more extreme.
A value near 100 can persist while a strong trend continues because new observations may repeatedly remain near the top of the evolving distribution.
Likewise, readings near 0 can persist during sustained downside momentum.
Overbought and Oversold zones
The default static zones are:
Overbought: 90–100
Oversold: 0–10
These are configurable.
The labels “overbought” and “oversold” describe statistical location, not guaranteed reversal conditions.
An overbought reading means:
The ranked observation is near the top of its recent empirical distribution.
An oversold reading means:
It is near the bottom.
During a range, these areas may help identify local extremes.
During a persistent trend, the oscillator can remain in an extreme zone for extended periods.
The zones should therefore be interpreted together with:
Trend context.
Price structure.
Oscillator direction.
Signal-line behaviour.
Why 90/10 instead of 70/30?
Traditional RSI commonly uses 70 and 30.
That convention does not need to apply to a percentile-rank oscillator.
A rank above 90 means the current observation is in approximately the upper tail of the recent empirical sample, while a reading below 10 represents the lower tail.
Using more extreme default zones makes them intentionally selective.
Users who want broader zones can move the boundaries toward values such as 80 and 20.
Signal line
The white Moving Average line is an EMA of the final oscillator:
Signal = EMA(Percentile Rank Oscillator, Signal Length)
This provides a slower reference against which short-term rank movement can be compared.
Oscillator above signal
The percentile rank is strengthening relative to its own recent smoothed level.
Oscillator below signal
The rank is weakening.
Crossovers can be used to identify changes in short-term momentum within the broader percentile regime.
For example:
A bullish crossover below the oversold zone can indicate rank beginning to recover from an extreme.
A bearish crossover above the overbought zone can indicate deterioration from an upper-tail reading.
A crossover near 50 may represent a more neutral momentum transition.
Signal crosses should not be interpreted independently from oscillator location.
Stepped oscillator colouring
The oscillator uses stepped colour intensity based on its position relative to the 50 midline.
Above 50, colours progressively strengthen as the percentile reaches higher levels.
Below 50, bearish intensity progressively strengthens as the percentile falls.
The main regions are approximately:
50–62.5: modest positive rank.
62.5–75: strengthening positive rank.
75–90: strong positive rank.
90–99: upper-tail extreme.
99–100: exceptional upper-tail rank.
The lower half mirrors this concept:
37.5–50: modest negative rank.
25–37.5: weakening relative state.
10–25: strong negative rank.
1–10: lower-tail extreme.
0–1: exceptional lower-tail rank.
These colours do not introduce additional calculations or signals.
They visually communicate how far the oscillator has moved into its empirical distribution.
Column presentation
The percentile oscillator is plotted as columns around a histogram base of 50.
This means:
Values above 50 extend upward.
Values below 50 extend downward from the midline.
Although the numerical scale remains 0–100, this presentation visually emphasises deviation from the centre of the distribution.
The 50 level therefore functions as the oscillator’s equilibrium reference.
Price mode versus Momentum mode
The two modes answer different questions and should not be treated interchangeably.
Price Mode
Asks:
Where is price relative to its recent distribution?
This makes it useful for:
Range position.
Breakout context.
Relative price extremes.
Stochastic-like analysis.
Momentum Mode
Asks:
Where is current price change relative to the recent distribution of price changes?
This makes it useful for:
Momentum expansion.
Momentum exhaustion.
Relative impulse analysis.
Trend-strength transitions.
Momentum mode can identify weakening momentum before price itself leaves the upper part of its distribution.
Price mode can remain elevated simply because the market is still trading near recent highs.
Example: strong uptrend
Suppose price has been rising steadily.
Price Mode may remain above 90 because current price continually sits near the upper edge of its recent range.
Momentum Mode may behave differently:
It can rise toward 100 during acceleration.
Fall back toward 50 when the trend continues at a more ordinary pace.
Drop below 50 if momentum deteriorates significantly even while price remains relatively high.
This distinction can help separate price location from momentum condition .
Example: volatility regime change
Suppose a market normally changes by only small amounts, then suddenly produces a large directional move.
Raw momentum alone shows a large number.
The percentile rank provides additional context by showing whether that movement is unusual relative to the recent distribution.
If the current momentum is greater than nearly every recent observation, the oscillator moves toward 100.
If the market has already experienced many similarly large moves, the same absolute momentum may receive a much less extreme rank.
The indicator therefore adapts automatically to changing empirical behaviour without requiring fixed momentum thresholds.
Midline crossings
A crossover above 50 indicates the ranked series has moved into the upper half of its recent distribution.
A cross below 50 indicates movement into the lower half.
In Momentum mode, these crossings can be used as a simple relative momentum regime:
Above 50 = comparatively stronger momentum state.
Below 50 = comparatively weaker momentum state.
In Price mode, they indicate whether price is above or below the central portion of its recent rank distribution.
These crossings also control the optional main-chart candle colours.
Extreme-zone crossings
The indicator provides alerts when:
The oscillator crosses upward into the overbought zone.
The oscillator crosses downward into the oversold zone.
These alerts identify entry into an extreme percentile area.
They do not indicate that the extreme has ended.
For reversal-oriented analysis, a trader may instead monitor:
A subsequent exit from the zone.
A signal-line crossover.
Divergence with price.
A break in market structure.
Divergence interpretation
Because Momentum mode ranks momentum rather than price, it can also be useful for examining momentum divergence.
For example:
Price may make a higher high while the oscillator produces a lower percentile peak.
This indicates that the latest momentum observation is less exceptional relative to its recent history than it was during the previous price high.
The reverse can occur at lows.
As with conventional divergence, this is evidence of changing momentum characteristics, not confirmation that price must reverse.
How to use the indicator
1. Relative momentum regime
In Momentum mode, use the 50 midline as a simple regime reference:
Above 50 = positive relative momentum state.
Below 50 = negative relative momentum state.
2. Momentum extremes
Use the configurable zones to identify unusually high or low momentum ranks.
Rather than automatically fading these conditions, determine whether the market is:
Trending.
Exhausting.
Breaking out.
Returning toward equilibrium.
3. Signal-line transitions
Oscillator and signal-line crosses can help identify shorter-term changes in rank direction.
The location of the crossover matters.
A bullish crossover at 5 carries different context from one at 95.
4. Price-distribution analysis
Switch to Price mode when the objective is to measure where the current market sits within its recent price distribution.
This can be useful for:
Breakout analysis.
Range positioning.
Relative high/low detection.
5. Trend confirmation
Momentum remaining consistently above 50 can support an existing bullish trend.
Momentum remaining below 50 can support a bearish trend.
Repeated oscillation around 50 indicates that relative momentum is changing sides frequently.
6. Candle regime colouring
The optional overlay candles make the oscillator’s midline state visible directly on the main price chart.
This can be useful when the oscillator pane is being used primarily for extremes and signal-line analysis.
Input guide
Rank Target
Selects what is percentile-ranked.
Price ranks the source itself.
Momentum ranks its change over the selected Momentum Length.
Rank Window
Controls the empirical comparison sample.
Longer values are smoother and statistically broader. Shorter values adapt more quickly.
Momentum Length
Controls the displacement horizon in Momentum mode.
It has no effect in Price mode.
Output Smoothing
Applies optional EMA smoothing to the percentile rank.
1 produces the raw rank.
Signal Length
Controls the EMA signal line.
Shorter values follow the oscillator more closely. Longer values produce slower crossover signals.
Overbought Zone
Sets the lower boundary of the upper extreme area.
Oversold Zone
Sets the upper boundary of the lower extreme area.
How this differs from RSI
Traditional RSI:
Separates gains and losses.
Smooths their magnitude.
Calculates a relative-strength ratio.
Transforms that ratio onto a 0–100 scale.
Nonparametric Relative Momentum:
Calculates price or momentum directly.
Ranks the current observation against historical observations.
Uses no gain/loss ratio.
Uses no assumed distribution.
The identical 0–100 scale therefore represents a different statistical concept.
How this differs from Stochastic
A conventional stochastic oscillator measures where current price lies between the highest high and lowest low of a window.
Its basic concept is:
(Current - Lowest) / (Highest - Lowest)
Nonparametric Price mode instead asks how many historical observations are below the current price.
This distinction matters because the rank considers the entire empirical ordering of the sample, not only its two extreme endpoints.
Two windows can have identical highs, lows and current price but different internal distributions.
A stochastic calculation can return the same value in both cases, while percentile rank can differ because the number of observations above and below the current price is different.
How this differs from a Z-score
A Z-score measures deviation from a mean in standard-deviation units:
Z = (Current Value - Mean) / Standard Deviation
That calculation depends directly on the sample mean and dispersion.
Percentile rank depends only on ordering.
As a result, an extreme outlier can heavily alter a mean and standard deviation but has much less influence on the ordering of the remaining observations.
This is one of the reasons rank statistics can be useful when financial data contains skew, fat tails or isolated extreme moves.
Strengths
Uses a nonparametric empirical ranking process.
Requires no assumption of normality.
Produces an intuitive bounded 0–100 scale.
Adapts naturally to the recent behaviour of each market.
Supports both price-location and momentum-ranking modes.
Uses mid-ranks for tied observations.
Normalises momentum extremes without relying on fixed point or percentage thresholds.
Includes configurable smoothing and signal analysis.
Provides direct midline regime colouring on the main chart.
Limitations
A percentile rank measures relative position, not absolute magnitude.
A reading of 100 does not indicate how much larger the current observation is than the rest of the sample.
Persistent trends can remain at extreme ranks for extended periods.
Short Rank Windows can generate rapid percentile changes.
Long Rank Windows adapt more slowly to regime shifts.
Momentum mode uses absolute source change rather than percentage return, although ranking substantially reduces scale dependence within a single instrument.
Extreme readings are not automatic reversal signals.
Signal-line crosses can whipsaw in noisy conditions.
The oscillator is reactive and does not forecast future price.
Alerts
The indicator provides alerts for:
Cross Up 50: oscillator enters the upper half of its distribution.
Cross Down 50: oscillator enters the lower half.
Overbought: oscillator crosses upward through the selected upper-zone boundary.
Oversold: oscillator crosses downward through the selected lower-zone boundary.
Bull: oscillator crosses above its signal EMA.
Bear: oscillator crosses below its signal EMA.
Summary
Nonparametric Relative Momentum converts either price or momentum into an empirical percentile rank.
Instead of asking how far an observation is from a moving average, how many standard deviations it sits from a mean, or what ratio of gains to losses produced it, the indicator asks where that observation ranks relative to its own recent history.
In Price mode, it measures the relative location of price within its historical distribution.
In Momentum mode, it first calculates price displacement across a chosen horizon and then measures how exceptional that momentum is relative to recent momentum observations.
A mid-rank procedure handles tied values, optional EMA smoothing controls visual responsiveness, and a separate signal average provides crossover analysis. The 50 midline separates the upper and lower halves of the empirical distribution, while configurable overbought and oversold zones highlight the tails.
The result is a distribution-free relative momentum framework that adapts to the observed behaviour of the market rather than relying on fixed magnitude thresholds or an assumed statistical distribution.
指标

MACD Momentum Phase & Acceleration ObservatoryMACD Momentum Phase & Acceleration Observatory is a current-chart momentum research indicator that extends the familiar MACD line, Signal line, and Histogram into a structured view of separation, expansion, contraction, equilibrium, relative magnitude, and crossover-cycle behavior.
The script is designed for users who want to study how MACD momentum changes rather than rely only on a line crossover. It is a descriptive context tool. It does not generate Buy or Sell instructions, predict future price movement, estimate win rate, or manage risk.
WHAT IT SHOWS
- A configurable MACD line, Signal line, and state-colored Histogram.
- Five descriptive momentum phases.
- A noise-aware expansion and contraction model.
- An adaptive Near Equilibrium state with separate entry and exit boundaries.
- Three display scales: Raw MACD, Percent of Slow Average, and ATR Units.
- A robust rolling Histogram magnitude score.
- A subdued-to-reactivated magnitude sequence.
- Cross-cycle peak retention.
- MACD path efficiency.
- A compact or detailed context readout.
- Optional factual event markers and alert conditions.
WHY THIS IS MORE THAN A STANDARD MACD
A standard MACD primarily shows the relationship between a fast moving average, a slow moving average, and a smoothed Signal line. This script keeps that familiar structure, but its main contribution is a coordinated lifecycle model built around the MACD Histogram.
The distinguishing design consists of:
- separating the raw analytical engine from display normalization;
- classifying the Histogram into five momentum phases;
- filtering small expansion/contraction changes with an adaptive noise deadband;
- reducing equilibrium-boundary flapping with entry/exit hysteresis;
- measuring relative Histogram magnitude with rank-based methods;
- tracking reactivation after a sustained subdued sequence;
- measuring how much Histogram separation remains inside the active crossover cycle; and
- measuring whether the MACD path has been direct or rotational over a selected lookback.
These components are designed to describe different parts of one MACD separation lifecycle. They are not independent indicators combined without a shared purpose.
CORE MACD ENGINE
The raw calculations are:
Raw MACD = Fast Moving Average - Slow Moving Average
Raw Signal = Moving Average of Raw MACD
Raw Histogram = Raw MACD - Raw Signal
The Fast, Slow, and Signal calculations can each use one of the following moving-average methods:
- EMA
- SMA
- RMA
- WMA
- HMA
The source and all lengths are configurable. Fast Length must remain lower than Slow Length. If the configuration is invalid or the selected scale is unavailable, the context readout reports the condition instead of presenting a normal Ready state.
RAW ANALYTICAL CORE AND DISPLAY SCALE
The analytical state is calculated from the raw MACD structure. Display normalization is handled separately.
Available display modes are:
Raw MACD
Shows the MACD components in their native chart-price units.
Percent of Slow Average
Divides MACD, Signal, and Histogram by one percent of the absolute Slow Average value.
ATR Units
Divides MACD, Signal, and Histogram by the current ATR value using the selected ATR length.
The same positive divisor is applied to all three displayed components on each bar. More importantly, crossover events, zero crossings, phase classification, magnitude scoring, path efficiency, and cycle retention are calculated from the raw series. Changing the display mode therefore changes the visual unit, but it does not rewrite the underlying analytical event history.
FIVE-STATE MOMENTUM PHASE MODEL
The Histogram is classified into five descriptive states:
Positive Expansion
The raw Histogram is above zero and its absolute magnitude is expanding beyond the adaptive noise deadband.
Positive Contraction
The raw Histogram is above zero and its absolute magnitude is contracting.
Negative Expansion
The raw Histogram is below zero and its absolute magnitude is expanding.
Negative Contraction
The raw Histogram is below zero and its absolute magnitude is contracting.
Near Equilibrium
The absolute raw Histogram is inside the adaptive equilibrium boundary.
Expansion and contraction are based on the smoothed one-bar change in absolute Histogram magnitude. The script also estimates ordinary recent one-bar magnitude movement. That estimate creates an adaptive deadband. When the current magnitude change is too small to distinguish clearly from recent noise, the prior motion state is retained instead of forcing another Expansion/Contraction switch.
ADAPTIVE EQUILIBRIUM WITH HYSTERESIS
The equilibrium entry boundary is calculated from an EMA of the absolute raw Histogram multiplied by the Equilibrium Band Multiplier.
Once Near Equilibrium is active, the exit boundary is wider than the entry boundary:
Exit Boundary = Entry Boundary x Equilibrium Exit Hysteresis
Using separate entry and exit boundaries reduces rapid state changes when the Histogram repeatedly moves just above and below one threshold.
HISTOGRAM ACCELERATION
Histogram Acceleration is the smoothed one-bar change of the Histogram. The detailed readout can display the current value and direction. Optional acceleration-turn markers and alerts identify factual zero crossings in the raw acceleration measure.
The acceleration value shown in the readout follows the selected display unit. The five-state phase model remains based on the raw Histogram structure.
ROBUST HISTOGRAM MAGNITUDE SCORE
The Magnitude field measures the current absolute raw Histogram relative to its own recent history. It is bounded from 0 to 100 and offers three methods:
Percent Rank
Ranks the current absolute Histogram among observations in the selected lookback. This method is less dominated by one isolated extreme value.
Range Rank
Locates the current absolute Histogram between the rolling minimum and rolling maximum.
Hybrid Rank
Combines 65 percent Percent Rank with 35 percent Range Rank. This is the default method.
The score is classified as:
- Subdued
- Typical
- Extended
These labels describe relative recent magnitude only. They are not probabilities, confidence levels, overbought/oversold signals, or forecasts.
MAGNITUDE REACTIVATION
Magnitude Reactivation is a stateful sequence, not a directional trade signal.
The sequence works as follows:
1. The Magnitude score remains at or below the Subdued threshold for at least the selected Minimum Subdued Bars.
2. The reactivation condition becomes armed.
3. A reactivation event is recorded when the score reaches the Magnitude Reactivation threshold.
The default visual marker is a small yellow dot at the top of the pane. It indicates that relative Histogram magnitude has re-emerged after a sustained subdued sequence. It does not specify bullish or bearish direction.
CROSS-CYCLE PEAK RETENTION
A cross cycle begins whenever the raw MACD line crosses the raw Signal line.
During the active cycle, the script records the largest absolute raw Histogram magnitude. Cross-Cycle Peak Retention is calculated as:
Current Absolute Histogram / Active-Cycle Peak Absolute Histogram x 100
A value near 100 means the current separation is near the largest separation recorded in that crossover cycle. A lower value means more of that cycle's peak separation has contracted. This measurement is descriptive and does not determine whether price will continue or reverse.
MACD PATH EFFICIENCY
MACD Path Efficiency compares the net displacement of the raw MACD line with the total distance traveled by the raw MACD line over the selected lookback:
Absolute Net MACD Displacement / Sum of Absolute One-Bar MACD Changes x 100
A higher value describes a more direct MACD path. A lower value describes a more rotational or back-and-forth path. It is not a measure of profitability, trend quality, or future reliability.
CONTEXT READOUT
The Context Readout can be disabled or shown in Compact or Detailed mode.
Compact mode shows:
- Phase
- Location relative to zero
- Histogram value
- Magnitude score and state
- Configuration status
Detailed mode additionally shows:
- Histogram Acceleration
- Phase Age
- Bars in the active cross cycle and Peak Retention
- MACD Path Efficiency
- Confirmed or Live bar status
The table position, text size, header size, background, border, and row presentation are configurable.
VISUAL DESIGN
The default palette separates the line family from the Histogram family:
- MACD line: ice white
- Signal line: electric blue
- Positive Expansion: bright green
- Positive Contraction: teal
- Negative Expansion: magenta
- Negative Contraction: orange
- Near Equilibrium: vivid purple
- Magnitude Reactivation: yellow
The Histogram uses a depth layer and a narrower core layer. The MACD and Signal lines can use optional glow and separation fill. The adaptive equilibrium band, zero guide, phase rail, and background tint can be enabled or disabled independently.
EVENT MARKERS AND ALERTS
Default factual markers are:
- a small upward arrow at the pane bottom when MACD crosses above Signal;
- a small downward arrow at the pane top when MACD crosses below Signal; and
- a small yellow dot at the pane top when Magnitude Reactivation occurs.
Optional markers are available for:
- Histogram Acceleration turning positive or negative; and
- MACD crossing above or below zero.
Alert conditions are available for the same events and for each phase transition. These events describe calculated state changes. They are not trade-entry or trade-exit recommendations.
REALTIME AND CONFIRMED-BAR BEHAVIOR
Confirmed Bars Only is enabled by default.
With the default setting:
- markers and alert conditions trigger after the chart bar closes;
- stateful Magnitude Reactivation updates are committed on confirmed realtime bars; and
- the committed cross-cycle peak is updated on confirmed realtime bars.
The MACD lines, Histogram, phase display, and context readout can still change while the current bar is forming because their inputs change with live price. This is normal realtime behavior. Users who disable Confirmed Bars Only intentionally allow intrabar events, which can change before the bar closes.
The script uses the current chart timeframe only. It does not request another symbol or timeframe, use lookahead, access future data, or apply a future plot offset.
HOW TO USE THE INDICATOR
1. Start with Location and Phase.
Location shows whether raw MACD is above or below zero. Phase shows whether Histogram magnitude is expanding, contracting, or near equilibrium.
2. Add Magnitude context.
Use Subdued, Typical, and Extended as rolling relative-magnitude descriptions. Do not interpret them as probabilities.
3. Observe reactivation after subdued conditions.
A yellow dot identifies a transition from a sustained subdued sequence to a higher relative magnitude. Read its direction from the Histogram sign and phase, not from the dot itself.
4. Use Detailed mode for lifecycle context.
Phase Age shows duration. Cross-Cycle Peak Retention shows how much separation remains relative to the active cycle peak. Path Efficiency shows whether the MACD path has been direct or rotational.
5. Select a suitable display unit.
Raw MACD preserves native units. Percent of Slow Average and ATR Units can make the pane easier to read on symbols with different price or volatility scales. Analytical states remain based on raw MACD.
DEFAULT CONFIGURATION
The default core uses 12-period EMA, 26-period EMA, and a 9-period EMA Signal line with Close as the source.
The default research settings use:
- Raw MACD display
- 3-bar acceleration smoothing
- 8-bar phase-noise estimation
- 0.25 phase-noise multiplier
- 34-bar adaptive equilibrium basis
- 0.28 equilibrium entry multiplier
- 1.25 equilibrium exit hysteresis
- 120-bar Hybrid Magnitude Rank
- 20 / 35 / 80 Subdued, Reactivation, and Extended thresholds
- 3 Minimum Subdued Bars
- 20-bar MACD Path Efficiency
- Compact Context Readout
- Confirmed Bars Only enabled
The defaults are general starting points, not optimized settings for a specific symbol or timeframe.
LIMITATIONS
- MACD is derived from moving averages and therefore contains lag.
- Expansion, contraction, equilibrium, magnitude, retention, and efficiency describe the current and historical calculation state; they do not forecast price.
- Results depend on the selected source, moving-average methods, lengths, smoothing, lookbacks, and thresholds.
- Rank-based measurements are relative to a rolling window and can change as old observations leave that window.
- Frequent MACD/Signal crossings create shorter cross cycles and can make Peak Retention change quickly.
- Low-liquidity symbols, gaps, abrupt price changes, and very short timeframes can produce rapid state transitions.
- The open bar remains fluid until it closes.
- The script does not include position sizing, stop placement, targets, backtesting, or risk management.
Use the indicator as one transparent source of momentum context alongside independent price analysis and risk controls. 指标

指标

指标

VWAP-MACD with Volume ConfirmationVWAP-MACD with Volume Confirmation
VWAP-MACD+ replaces the price series inside a classic MACD calculation with an anchored VWAP series, then adds a volume-strength filter so that crossover signals are only flagged as "confirmed" when they occur on above-average volume. The result is a momentum oscillator that reflects shifts in the volume-weighted average price rather than raw closing price, with a built-in sanity check against low-conviction crosses.
How it works
Anchored VWAP — VWAP is calculated from hlc3 * volume, accumulated and reset at the start of each new period based on the selected anchor (Session, Week, or Month). This is the same anchoring logic as TradingView's native VWAP, just computed manually so it can feed into the MACD below.
VWAP-based MACD — instead of EMA-ing close like a standard MACD, this script EMAs the VWAP series itself (fast length default 12, slow length default 26). The difference between the fast and slow EMAs of VWAP is the MACD line; a further EMA of that (default 9) is the signal line; their difference is the histogram. Because VWAP is smoother and volume-weighted, the resulting MACD reacts to shifts in the "fair value" price rather than every tick of noise in the close.
Volume Momentum Filter — each bar's volume is compared to its moving average (default 20-period SMA) to get a relative volume ratio. Bars are classified as strong (≥1.5x average), weak (<0.75x average), or normal, and the histogram's color intensity reflects this — brighter columns mean the current move is backed by stronger volume, faded columns mean it's on thin volume.
Volume-Confirmed Crossovers — a standard MACD/signal-line crossover only becomes a plotted "confirmed" signal when relative volume is at or above average (≥1.0x). This is meant to filter out crossovers that happen on quiet, low-conviction bars.
Reading the indicator
Blue line — VWAP-based MACD line.
Orange line — signal line (EMA of the MACD line).
Histogram columns — MACD minus signal, colored green above zero / red below zero, with intensity scaled by relative volume (bright = strong volume, faded = weak volume, mid = normal).
Green up-triangle — bullish crossover confirmed by volume.
Red down-triangle — bearish crossover confirmed by volume.
Zero line — dashed gray reference; crosses of the MACD line through zero can also be used as a secondary trend-context read, though this script's plotted signals are specifically the signal-line crossovers.
Suggested use
This is a trend/momentum tool built around volume-weighted price rather than raw close, intended for:
Traders who already use VWAP as an intraday or swing fair-value reference and want a momentum oscillator derived from that same series instead of close price
Filtering out MACD crossovers that occur on low-volume, low-conviction bars by relying on the "confirmed" triangle markers rather than every raw crossover
Combining with the anchor period that matches your trading horizon — Session for intraday, Week or Month for swing/position context
As with any momentum oscillator, it works best alongside broader trend or structure context (e.g., higher-timeframe trend, support/resistance) rather than as a standalone signal — volume confirmation reduces noise but doesn't guarantee follow-through.
Inputs
Fast Length / Slow Length / Signal Smoothing — EMA lengths for the VWAP-MACD calculation
VWAP Anchor Period — Session, Week, or Month
Volume MA Lookback — averaging period for the relative volume filter
Enable Volume Confirmation Shading — toggles both the histogram's volume-based color intensity and the volume requirement on confirmed crossover signals
Alerts
Two alert conditions are built in:
VWAP-MACD Bullish Cross (Vol Confirmed)
VWAP-MACD Bearish Cross (Vol Confirmed) 指标

Bollinger Sweeps & Dynamic Trendline Matrix PROBollinger Sweeps & Dynamic Trendline Matrix PRO
Bollinger Sweeps & Dynamic Trendline Matrix PRO is a modern, high definition technical analysis indicator optimized specifically for clean charting and high visibility across both light and dark themes. It seamlessly combines customized Bollinger Band volatility tracking, liquidity sweep detection, high confluence trendlines, market structure analysis, and outer neon glowing candlesticks.
Key Features Overview
1. Optimized Bollinger Bands Engine
Features lightweight, low opacity Bollinger Bands with fully customizable length, multiplier, line styles (Solid, Dashed, Dotted), line thickness, and transparency controls.
2. Bollinger Liquidity Sweeps (ITH & ITL Badges)
Identifies liquidity sweep points where price action pierces or touches the outer bands and sharply reverses, marking valid Intermediate Term Highs (ITH) and Intermediate Term Lows (ITL).
3. High Confluence Auto Trendlines
Draws precise trendlines anchored strictly across high confluence swing points, avoiding clutter. Includes full customization for line style, thickness, and color.
4. True Outer Neon Glowing Candlesticks
Uses multi layered rendering to project an outer glowing halo around price candlesticks, making trend direction pop cleanly on white or dark backgrounds.
5. Clean Split Line Market Structure Signals
Detects Break of Structure (BOS) and Change of Character (CHoCH) levels. Structure lines split cleanly around centered text labels with an automatic gap for maximum chart legibility.
6. Triangle Pattern Consolidation Engine
Detects volatility squeezes and marks triangle breakout and breakdown confirmations right as volatility expands.
Settings Overview
Bollinger Bands Settings
- Show Bollinger Bands Engine: Toggle display of bands.
- Band Transparency & Thickness: Adjust opacity and line width.
Bollinger Sweep Settings
- Show BB Sweep Pivots: Toggle ITH and ITL liquidity badges.
Smart Trendline Settings
- Show Smart Trendlines: Toggle trendline overlays.
- Custom Styles: Adjust line style (Solid, Dashed, Dotted), thickness, and colors.
Market Structure Settings
- Show BOS & CHoCH Signals: Toggle structure lines and labels.
Outer Glow Settings
- Enable Outer Glowing Theme: Toggle multi layered candlestick halo effects.
Disclaimer
This script is built strictly for educational, analytical, and charting enhancement purposes. It does not provide financial advice, automated trade signals, or guaranteed results. Always practice strict risk management. 指标

指标

指标
