Adaptive Z-Score Oscillator [QuantAlgo]🟢 Overview
The Adaptive Z-Score Oscillator transforms price action into statistical significance measurements by calculating how many standard deviations the current price deviates from its moving average baseline, then dynamically adjusting threshold levels based on historical distribution patterns. Unlike traditional oscillators that rely on fixed overbought/oversold levels, this indicator employs percentile-based adaptive thresholds that automatically calibrate to changing market volatility regimes and statistical characteristics. By offering both adaptive and fixed threshold modes alongside multiple moving average types and customizable smoothing, the indicator provides traders and investors with a robust framework for identifying extreme price deviations, mean reversion opportunities, and underlying trend conditions through the visualization of price behavior within a statistical distribution context.
🟢 How It Works
The indicator begins by establishing a dynamic baseline using a user-selected moving average type applied to closing prices over the specified length period, then calculates the standard deviation to measure price dispersion:
basis = ma(close, length, maType)
stdev = ta.stdev(close, length)
The core Z-Score calculation quantifies how many standard deviations the current price sits above or below the moving average basis, creating a normalized oscillator that facilitates cross-asset and cross-timeframe comparisons:
zScore = stdev != 0 ? (close - basis) / stdev : 0
smoothedZ = ma(zScore, smooth, maType)
The adaptive threshold mechanism employs percentile calculations over a historical lookback period to determine statistically significant extreme zones. Rather than using fixed levels like ±2.0, the indicator identifies where a specified percentage of historical Z-Score readings have fallen, automatically adjusting to market regime changes:
upperThreshold = adaptive ? ta.percentile_linear_interpolation(smoothedZ, percentilePeriod, upperPercentile) : fixedUpper
lowerThreshold = adaptive ? ta.percentile_linear_interpolation(smoothedZ, percentilePeriod, lowerPercentile) : fixedLower
The visualization architecture creates a four-tier coloring system that distinguishes between extreme conditions (beyond the adaptive thresholds) and moderate conditions (between the midpoint and threshold levels), providing visual gradation of statistical significance through opacity variations and immediate recognition of distribution extremes.
🟢 How to Use This Indicator
▶ Overbought and Oversold Identification:
The indicator identifies potential overbought conditions when the smoothed Z-Score crosses above the upper threshold, indicating that price has deviated to a statistically extreme level above its mean. Conversely, oversold conditions emerge when the Z-Score crosses below the lower threshold, signaling statistically significant downward deviation. In adaptive mode (default), these thresholds automatically adjust to the asset's historical behavior, i.e., during high volatility periods, the thresholds expand to accommodate wider price swings, while during low volatility regimes, they contract to capture smaller deviations as significant. This dynamic calibration reduce false signals that plague fixed-level oscillators when market character shifts between volatile and ranging conditions.
▶ Mean Reversion Trading Applications:
The Z-Score framework excels at identifying mean reversion opportunities by highlighting when price has stretched too far from its statistical equilibrium. When the oscillator reaches extreme bearish levels (below the lower threshold with deep red coloring), it suggests price has become statistically oversold and may snap back toward the mean, presenting potential long entry opportunities for mean reversion traders. Symmetrically, extreme bullish readings (above the upper threshold with bright green coloring) indicate potential short opportunities or long exit points as price becomes statistically overbought. The moderate zones (lighter colors between midpoint and threshold) serve as early warning areas where traders can prepare for potential reversals, while exits from extreme zones (crossing back inside the thresholds) often provide confirmation that mean reversion is underway.
▶ Trend and Distribution Analysis:
Beyond discrete overbought/oversold signals, the histogram's color pattern and shape reveal the underlying trend structure and distribution characteristics. Sustained periods where the Z-Score oscillates primarily in positive territory (green bars) indicate a bullish trend where price consistently trades above its moving average baseline, even if not reaching extreme levels. Conversely, predominant negative readings (red bars) suggest bearish trend conditions. The distribution shape itself provides insight into market behavior, e.g., a narrow, centered distribution clustering near zero indicates tight ranging conditions with price respecting the mean, while a wide distribution with frequent extreme readings reveals volatile trending or choppy conditions. Asymmetric distributions skewed heavily toward one side demonstrate persistent directional bias, whereas balanced distributions suggest equilibrium between bulls and bears.
▶ Built-in Alerts:
Seven alert conditions enable automated monitoring of statistical extremes and trend transitions. Enter Overbought and Enter Oversold alerts trigger when the Z-Score crosses into extreme zones, providing early warnings of potential reversal setups. Exit Overbought and Exit Oversold alerts signal when price begins reverting from extremes, offering confirmation that mean reversion has initiated. Zero Cross Up and Zero Cross Down alerts identify transitions through the neutral line, indicating shifts between above-mean and below-mean price action that can signal trend changes. The Extreme Zone Entry alert fires on any extreme threshold penetration regardless of direction, allowing unified monitoring of both overbought and oversold opportunities.
▶ Color Customization:
Six visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and aesthetic preferences, ensuring optimal contrast and readability across trading platforms. The bar transparency control (0-90%) allows fine-tuning of visual prominence, with minimal transparency creating bold, attention-grabbing bars for primary analysis, while higher transparency values produce subtle background context when using the oscillator alongside other indicators. The extreme and moderate zone coloring system uses automatic opacity variation to create instant visual hierarchy, with darkest colors highlight the most statistically significant deviations demanding immediate attention, while lighter shades mark developing conditions that warrant monitoring but may not yet justify action. Optional candle coloring extends the Z-Score color scheme directly to the price candles on the main chart, enabling traders to instantly recognize statistical extremes and trend conditions without needing to reference the oscillator panel, creating a unified visual experience where both price action and statistical analysis share the same color language.
M-oscillator
Buying Opportunity Score V2.1Overview
A composite scoring system (0-100) that identifies high-probability buying opportunities during market pullbacks. Validated through backtesting on SPY from 2010-2024.
How It Works
The indicator combines multiple fear and oversold signals into a single actionable score. When fear is elevated and the market is oversold, the score rises. Higher scores historically correlate with better forward returns.
Scoring Components
VIX Level (30 pts) - Market fear gauge
Drawdown (30 pts) - Distance from 52-week high
RSI 14 (12 pts) - Oversold confirmation
Bollinger Band (13 pts) - Statistical extreme
VIX Timing (15 pts) - Bonus when VIX declining from peak
Signal Levels
80+ = STRONG BUY (high conviction)
70-79 = BUY (consider entry)
60-69 = WATCH (monitor closely)
Below 60 = No signal
Backtest Results (SPY, 2010-2024)
70+ Signals: 85% win rate, 7.5% average 20-day return
80+ Signals: 100% win rate, 14% average 20-day return
Features
Statistics table showing 1Y, 3Y, 5Y rolling performance
Signal markers (green triangles) on buy signals
Outcome labels showing WIN/LOSS after measurement period
Multiple alert options
Works on SPY, QQQ, IWM (use VIX for all)
How To Use
Add to SPY, QQQ, or IWM (daily timeframe)
Wait for score to reach 70+ or 80+
Green triangle marks signal day
Check statistics table for recent performance
Set alerts for notifications
Alerts Available
STRONG BUY Signal (80+)
BUY Signal (70+)
Moderate Signal (60+)
Score Crossed 80/70
Score Dropped Below 70
Important Notes
Designed for daily timeframe on broad market ETFs
Signals confirm at end of day (bar close)
Statistics table shows rolling windows based on loaded data
Past performance does not guarantee future results
Dipy the MFT Super OscillatorDipy the MFT Super Oscillator
A multi-timeframe bandpass oscillator for mean-reversion and "buy the dip" strategies.
🎯 What It Does
Isolates market cycles within a specific frequency range to identify overbought/oversold conditions and reversal points.
⏱️ Multi-Timeframe
Set Signal Timeframe to calculate signals on higher TF while viewing lower TF chart. Example: 5min chart + 1H signals = noise reduction with precise timing.
⚙️ Key Settings
Bandwidth/BandEdge: Define the cycle range to capture
Cloud Type: None for thresholds, others for consensus cloud
Thresholds: Overbought/oversold levels for signals
💡 Best Use
Combine with trend indicator (only buy dips in uptrend)
Higher Signal Timeframe = cleaner signals
Cloud mode = more conservative entries
🔔 Alerts
Create ONE alert for all signals.
Derived from TASC 2025.04 Ultimate Oscillator by John Ehlers.
FVG MTF Consensus OscillatorFVG MTF Consensus Oscillator
A multi-timeframe, multi-component oscillator that combines momentum, deviation, and slope analysis across multiple timeframes using Zeiierman's Chebyshev-filtered trend calculation. This indicator identifies potential turning points with zone-based signal classification and timeframe consensus filtering.
Backed by ML/Deep Learning evaluation on ES Futures data from 2015-2024.
🎯 Concept
Traditional oscillators suffer from two major weaknesses:
Single measurement - relying on one metric makes them susceptible to noise
Single timeframe - missing the bigger picture leads to fighting the trend
The FVG MTF Consensus Oscillator addresses both issues by combining three independent measurements across three timeframes into a weighted consensus signal.
The Three Components
Momentum - How fast is the trend moving?
Deviation - How far has price stretched from the trend?
Slope - What is the short-term directional bias?
The Three Timeframes
TF1 (Chart) - Your current chart timeframe (lowest weight)
TF2 (Medium) - Typically 1H or 4H (medium weight)
TF3 (High) - Typically 4H or Daily (highest weight)
By requiring agreement across multiple components AND multiple timeframes, the oscillator filters out noise while capturing meaningful, high-probability market movements.
🔧 How It Works
The Core: Chebyshev Type 1 Filter
At its heart, this indicator uses a Chebyshev Type 1 low-pass filter (inspired by Zeiierman's FVG Trend) to extract a clean trend line from price action. Unlike simple moving averages, the Chebyshev filter offers:
Sharper cutoff between trend and noise
Minimal lag for a given smoothness level
Controlled overshoot via the ripple parameter
Three Oscillator Components
1. Momentum Component
Momentum = Current Trend Value - Previous Trend Value
Measures the velocity of the trend. High positive values indicate strong upward acceleration, while high negative values show downward acceleration.
2. Deviation Component
Deviation = Close Price - Trend Value
Measures how far price has stretched away from the trend line. Useful for identifying overextended conditions and mean reversion opportunities.
3. Slope Component
Slope = Change in Trend over 3 bars
Captures the short-term directional bias of the trend itself, helping confirm trend changes.
Normalization & Component Consensus
Each component is individually normalized to a -100 to +100 scale using adaptive scaling. The oscillator output is a weighted average of all three components, allowing you to emphasize different aspects based on your trading style.
Multi-Timeframe Weighting
The final oscillator value combines all three timeframes using configurable weights:
Combined = (TF1 × Weight1 + TF2 × Weight2 + TF3 × Weight3) / Total Weight
Default weights (1, 2, 3) ensure higher timeframes have more influence, keeping you aligned with the dominant trend while timing entries on lower timeframes.
📊 Zone System
The oscillator uses a fuzzy zone system to classify market conditions:
ZoneRangeInterpretationSignal ColorNeutral-5 to +5No clear bias, avoid tradingGrayContinuation±5 to ±25Trend pullback, continuation setupsAquaDeep Swing±25 to ±50Extended move, stronger setupsGreenReversalBeyond ±50Extreme extension, reversal potentialOrange
When "Show Zone Background" is enabled, the background shading darkens as the oscillator moves into more extreme zones, providing instant visual feedback.
📈 Signal Interpretation
Turn Signals
The indicator plots triangular markers when the oscillator changes direction:
▲ Triangle Up (bottom): Oscillator turning up from a low
▼ Triangle Down (top): Oscillator turning down from a high
Signal Quality by Zone
Not all signals are equal. The signal color indicates which zone the turn occurred in:
ColorZoneProbabilityBest UseGrayNeutralLowAvoid or use very tight stopsAquaContinuationModerateTrend continuation entriesGreenDeep SwingHigherSwing trade entriesOrangeReversalHighestCounter-trend with caution
Timeframe Consensus Filter
Signals only fire when the required number of timeframes agree on direction. With default settings (TF Consensus = 2), at least 2 of 3 timeframes must be moving in the same direction for a signal to trigger.
This prevents:
Taking longs when higher timeframes are bearish
Taking shorts when higher timeframes are bullish
Whipsaws during timeframe disagreement
Trend Coloring
The combined oscillator line changes color based on trend direction:
Light purple (RGB 240, 174, 252): Majority of timeframes trending up
Dark purple (RGB 84, 19, 95): Majority of timeframes trending down
Info Table
When MTF is enabled, a table in the top-right corner displays:
Current oscillator values for each timeframe (TF1, TF2, TF3)
Combined value (CMB)
Color coding: Green = rising, Red = falling
⚙️ Settings Guide
Timeframe Settings
SettingDefaultDescriptionEnable Multi-TimeframeOnMaster switch for MTF functionalityTF1 (Chart)"" (current)First timeframe, typically your chart TFTF2 (Medium)60Second timeframe, typically 1HTF3 (High)240Third timeframe, typically 4HTF1/TF2/TF3 Weight1 / 2 / 3Influence of each TF on combined signal
Timeframe Tips:
Keep TF1 ≤ TF2 ≤ TF3 (ascending order)
For day trading: 5m / 15m / 1H
For swing trading: 1H / 4H / Daily
For position trading: 4H / Daily / Weekly
Display Settings
SettingDefaultDescriptionShow All TimeframesOffDisplay individual TF oscillator linesShow Combined LineOnDisplay the weighted combined oscillatorShow Zone BackgroundOffShade background based on current zone
Trend Filter Settings
SettingDefaultDescriptionTrend Ripple4.0Filter responsiveness (1-10). Higher = faster but more overshootTrend Cutoff0.1Cutoff frequency (0.01-0.5). Lower = smoother trendNormalization Length50Lookback for scaling. Longer = more stable
Component Weights
SettingDefaultDescriptionMomentum Weight1.0Emphasis on trend speedDeviation Weight1.0Emphasis on price stretch from trendSlope Weight1.0Emphasis on short-term trend direction
Component Tips:
For trend-following: Increase Momentum and Slope weights
For mean reversion: Increase Deviation weight
Set any weight to 0 to disable that component
Zone Thresholds
SettingDefaultDescriptionNeutral Zone5Inner boundary (±5 = neutral)Continuation Zone25Middle boundary for continuation setupsDeep Swing Zone50Outer boundary for reversal zone
Adjust based on instrument volatility. More volatile instruments may need wider zones.
Signal Filters
SettingDefaultDescriptionSignal Cooldown3Minimum bars between signalsMin Turn Size2.0Minimum oscillator change for valid turnTF Consensus Required2Minimum TFs agreeing for signal (1-3)
💡 Usage Examples
Example 1: Trend Continuation (Dip Buying)
Setup: Uptrend confirmed by higher timeframes
Check the info table - TF2 and TF3 should show green (rising)
Wait for TF1 to pull back, oscillator enters Continuation zone
Enter on Aqua ▲ signal (turn up with TF consensus)
Stop below recent swing low
Target: Previous high or next resistance
Why it works: You're buying a dip in an established uptrend with multi-timeframe confirmation.
Example 2: Deep Swing Entry
Setup: Extended move showing exhaustion
Oscillator reaches Deep Swing zone (±25 to ±50)
At least 2 TFs start showing the same direction
Enter on Green signal indicating momentum exhaustion
Use tighter stop as the move is already extended
Target: Return to Continuation zone or trend line
Why it works: Extended moves tend to mean-revert. The zone system identifies these opportunities.
Example 3: Reversal Setup (Advanced)
Setup: Extreme extension with diverging timeframes
Oscillator reaches Reversal zone (beyond ±50)
Watch for TF1 to turn while TF3 is still extended
Enter on Orange signal - this is counter-trend!
Use smaller position size and wider stops
Target: Return to Deep Swing or Continuation zone
Why it works: Extreme extensions eventually correct. The orange signal marks high-probability reversal points.
Example 4: Avoiding Bad Trades
What to avoid:
Gray signals in Neutral zone - No edge, random noise
Signals against TF3 direction - Fighting the dominant trend
Signals without TF consensus - Timeframe disagreement = choppy market
Multiple signals in quick succession - Let cooldown filter work
🔬 Multi-Timeframe Analysis Tips
Reading the Info Table
The info table shows real-time oscillator values:
| TF1 | TF2 | TF3 | CMB |
| 23.5 | 45.2 | 67.8 | 52.1 |
All green: Strong uptrend across all timeframes
All red: Strong downtrend across all timeframes
Mixed colors: Potential transition or consolidation
Timeframe Alignment States
TF1TF2TF3Interpretation↑↑↑Strong bull - look for long entries↓↓↓Strong bear - look for short entries↑↑↓Pullback in downtrend - caution on longs↓↓↑Pullback in uptrend - caution on shorts↑↓↑Choppy - reduce position size↓↑↓Choppy - reduce position size
The Power of Consensus
With TF Consensus = 2, signals only fire when 2+ timeframes agree. This single filter eliminates most whipsaws and keeps you aligned with the dominant trend.
For more conservative trading, set TF Consensus = 3 (all timeframes must agree).
⚠️ Important Notes
This indicator does not predict the future. It measures current market conditions and momentum across multiple timeframes.
Always use proper risk management. No indicator is 100% accurate.
Combine with price action. The oscillator works best when confirmed by support/resistance, candlestick patterns, or other confluence factors.
Respect the higher timeframe. When TF3 disagrees, trade smaller or sit out.
Zone signals are probabilistic. Orange (reversal) signals have higher probability but aren't guaranteed reversals.
Adjust settings per instrument. Default settings are optimized for ES Futures but may need tuning for other markets.
🧪 ML/Deep Learning Background
The default parameters and zone thresholds were evaluated using machine learning techniques on ES Futures data spanning 2015-2024. This included:
Optimization of component weights
Zone threshold calibration
Timeframe weight balancing
Signal filter tuning
While past performance doesn't guarantee future results, the parameters represent a data-driven starting point rather than arbitrary defaults.
🙏 Credits
This indicator is inspired by Zeiierman's Multitimeframe Fair Value Gap (FVG) indicator, specifically utilizing concepts from his Chebyshev Type 1 filter implementation for trend calculation.
Original indicator: Multitimeframe Fair Value Gap – FVG (Zeiierman)
📝 Changelog
v1.0
Initial release
Three-component consensus oscillator (Momentum, Deviation, Slope)
Multi-timeframe support with weighted combination
Fuzzy zone classification system
Configurable component and timeframe weights
TF consensus filter for signal quality
Signal cooldown and minimum turn size filters
Real-time info table with TF values
Optional zone background shading
ADX Trend IndicatorThe Average Directional Index (ADX) is commonly known in English as the "Trend Strength Indicator" or "ADX Trend Strength Indicator".It measures the strength of a trend (regardless of direction: up or down), not the direction itself. Traders often call it a "trending ADX" or simply "ADX for trend" when focusing on its role in identifying strong trending markets (typically when ADX > 25).Quick Overview in English:ADX > 25 — Strong trend (good for trend-following strategies).
ADX < 20 — Weak or no trend (ranging/sideways market; avoid trend trades).
It combines with +DI (positive directional indicator) and -DI (negative directional indicator) to also show trend direction.
USD Liquidity Regime for BTC Perps (Dual) V1USD Liquidity Regime for BTC Perps (Dual)
This intents to be a BTC Perps USD Liquidity Regime macro indicator.
As it names states it is designed for BTCUSDT perpetual futures traders.
It attempts to tracks USD strength (DXY, UUP, yields, VIX composite) as liquidity proxy:
Lower index = weak USD = Risk-On (green background/histogram = long tailwind for BTC).
Higher = strong USD = Risk-Off (red = caution longs, shorts favor).
How to use:
Green background/histogram: Favor longs — rallies likely, dips bought.
Red: Caution longs — corrections hurt, short bias possible.
Blue line (index) vs red SMA: Crosses signal regime shifts.
Histogram strength: Bigger bars = stronger bias.
This is not intended as financial advise or trigger signal tool.
This is a work in progress
Its value is limited, if you do not understand any or some of the words above please do not use this indicator. If you did, then you understand you are not supposed to use this alone to make decisions.
Feel free to ask any questions, this is a work in progress.
Feel free to suggest improvements.
Educational macro context tool — not signals/advice.
Ok for avoiding going against the USD trend dominance by following liquidity.
By @frank_vergaram
Microstructure Participation & Acceptance Indicator📊 Microstructure Participation & Acceptance Indicator
An advanced participation-based filter combining VWAP distance analysis, volume delta detection, and real-time acceptance/rejection state identification—designed for smaller timeframe trading.
📊 FEATURES
VWAP Distance Normalization
Context-aware fair value measurement:
Automatically resets based on selected anchor (Session/Week/Month)
ATR-normalized distance calculation for universal application
Identifies when price is extended or compressed relative to equilibrium
Configurable extreme distance threshold (default: 1.5 ATR)
Adjustable source input (default: HLC3)
Volume Delta Proxy
Bull vs Bear participation tracking:
Calculates volume imbalance between bullish and bearish candles
EMA smoothing for cleaner signal generation (default: 9 periods)
Delta ratio measurement to identify dominant side
Expansion/compression detection to gauge momentum commitment
Configurable expansion threshold (default: 1.3x)
Acceptance/Rejection State Machine
Real-time market regime identification with six distinct states:
🟢 Accepted Long
Price moving away from VWAP with expanding bullish delta
Distance from VWAP increasing
Volume confirming the move
Indicates real buying pressure—trade WITH the move
🟢 Accepted Short
Price moving away from VWAP with expanding bearish delta
Distance from VWAP increasing
Volume confirming the move
Indicates real selling pressure—trade WITH the move
🟠 Fade Long
Price extended beyond threshold (>1.5 ATR above VWAP)
Delta not supporting the extension
Volume participation absent or diminishing
Potential mean-reversion short setup
🟠 Fade Short
Price extended beyond threshold (>1.5 ATR below VWAP)
Delta not supporting the extension
Volume participation absent or diminishing
Potential mean-reversion long setup
⚪ Chop
Price compressed near VWAP
Bollinger Bands tight (width compressed)
Delta neutral—no clear commitment
NO TRADE ZONE—wait for expansion
⚪ Neutral
Transitional state between regimes
Momentum shifting but not yet confirmed
Monitor for next acceptance signal
Bollinger Bands
Standard volatility measurement with TradingView default styling:
Adjustable period length (default: 20)
Configurable standard deviation multiplier (default: 2.0)
Visual fill between bands for volatility context
Used internally for chop/compression detection
Live Dashboard
Real-time metrics display (top-right corner):
Current market state with color coding
VWAP distance in ATR units
Delta ratio (bull/bear volume balance)
Delta state (Expanding/Compressing)
High-contrast design for instant readability
🎯 HOW TO USE
For Trend Trading:
Accepted Long/Short backgrounds indicate confirmed participation—stay with the trend
Strong moves typically travel 1-1.5 ATR from VWAP with delta support
Use VWAP as dynamic support/resistance
Combine with momentum indicators (MACD, RSI) for confluence
Price above VWAP + Accepted Long state = bullish bias
Price below VWAP + Accepted Short state = bearish bias
For Mean Reversion:
Fade Long/Short states signal overextension without participation
Price beyond 1.5 ATR from VWAP with weak delta = potential reversal
Look for price return to VWAP when extended
Bollinger Band extremes + Fade state = high-probability mean reversion setup
VWAP acts as mean reversion anchor during range-bound sessions
For Risk Management:
Chop state = avoid new entries
Bollinger Band compression + Chop = pre-expansion zone (wait for breakout)
Delta compression after strong move = early exhaustion warning
State transitions (Accepted → Neutral → Fade) = tighten stops
Signal Confirmation:
Strongest setups occur when multiple factors align:
BB breakout + Accepted state + price above/below VWAP
Price rejection at BB bands + Fade state
VWAP support/resistance hold + state transition
Delta expansion + distance increasing + trend direction
⚙️ SETTINGS
All components are fully customizable through organized input groups:
VWAP Distance Group:
VWAP source (default: HLC3)
Anchor period (Session/Week/Month)
ATR length for normalization (default: 14)
Extreme distance threshold in ATR multiples (default: 1.5)
Volume Delta Group:
Delta EMA length (default: 9)
Delta expansion threshold (default: 1.3)
Acceptance Logic Group:
Acceptance lookback period (default: 5)
Chop threshold in VWAP/ATR units (default: 0.3)
Bollinger Bands Group:
BB length (default: 20)
Standard deviation multiplier (default: 2.0)
Display Group:
Toggle state backgrounds
Toggle state change labels
Toggle VWAP line
Toggle Bollinger Bands
💡 EDUCATIONAL VALUE
This indicator teaches important concepts:
How institutional money identifies fair value (VWAP)
The difference between price movement and market acceptance
Why volume participation matters more than price action alone
How to distinguish between noise and committed directional moves
The relationship between volatility compression and expansion cycles
Why distance from equilibrium predicts mean reversion probability
⚠️ IMPORTANT NOTES
This indicator is for educational and informational purposes only
This is a filter, not a standalone trading system
No indicator is perfect—always use proper risk management
Past performance does not guarantee future results
Combine with your own analysis and risk tolerance
Test thoroughly on historical data before live trading
This is not financial advice—use at your own risk
🔧 TECHNICAL DETAILS
Pine Script Version 6
Overlay indicator (displays on price chart)
All calculations use standard, well-documented formulas
No repainting—all signals are confirmed on bar close
Compatible with all timeframes and instruments
Optimized for smaller timeframes (1-5 minute charts)
Minimal computational overhead
📝 CHANGELOG
Version 1.0
Initial release
VWAP distance normalization with ATR scaling
Volume delta proxy system (bull/bear EMA)
6-state acceptance/rejection state machine
Bollinger Bands integration
Real-time dashboard with live metrics
State change labels and background coloring
Full customization options
Developed for traders who need objective participation filters to distinguish high-probability setups from low-quality noise—without cluttering their charts with multiple indicator panels.
SMI Trigger System - Lower - NPR21/ChatGPTSMI Trigger System (Lower) — Buy Low / Hrugu (Modified)
This indicator is a modified version of the original SMI Trigger System created by Buy Low, with later enhancements by Hrugu, published with permission.
The script is a lower-pane Smoothed Stochastic Momentum Index (SMI) designed to deliver clear, visually intuitive momentum signals without unnecessary clutter. This version focuses exclusively on SMI behavior and removes auxiliary indicators to keep signals clean, readable, and consistent across timeframes.
Key Features
Smoothed SMI line with dynamic color changes based on momentum direction
Raw SMI line for additional reference
Zero-line split cloud shading for quick bullish/bearish momentum identification
Upper and lower SMI reference levels for overbought/oversold context
Exact-bar SMI color-flip triangle markers for immediate visual confirmation
Adjustable triangle size and offset so markers do not overlap the SMI line
Fully customizable colors for:
Zero line
Smoothed SMI (up/down)
Raw SMI
Cloud above and below zero
Upper and lower SMI levels
How to Use
This indicator is designed to highlight momentum shifts, not to predict price. It works best when combined with price structure, trend context, or higher-timeframe bias.
1. SMI Line & Color Changes
The smoothed SMI line changes color based on momentum direction:
Up color → momentum strengthening
Down color → momentum weakening
A color change often signals a potential momentum shift.
2. SMI Color-Flip Triangles
Green ▲ triangle below the SMI
Appears when the smoothed SMI turns upward (bearish → bullish momentum).
Red ▼ triangle above the SMI
Appears when the smoothed SMI turns downward (bullish → bearish momentum).
Triangles are plotted on the same bar the SMI changes color and are offset so they do not overlap the SMI line.
These markers are intended as visual confirmations, not standalone trade signals.
3. Zero Line & Cloud
The zero line separates bullish and bearish momentum regimes.
Cloud above zero → bullish momentum bias
Cloud below zero → bearish momentum bias
Stronger signals often occur when SMI flips in the direction of the cloud.
4. Upper & Lower SMI Levels
Upper and lower reference levels help identify extended momentum.
Momentum flips near or beyond these levels may indicate:
Exhaustion
Potential pullbacks
Trend continuation setups when aligned with higher-timeframe direction
5. Best Practices
Use this indicator as a confirmation tool, not a prediction tool.
Combine with:
Market structure
Support and resistance
Trend direction
Volume or price action
Works well on tick charts, intraday timeframes, and higher-timeframe analysis.
Additional Notes
Triangles do not repaint
All visual elements are user-configurable
No ADX or Awesome Oscillator components
Designed for clarity, speed, and ease of interpretation
This script is intended for analytical and educational purposes only and does not constitute trading advice.
Amihud Illiquidity Ratio [MarkitTick]💡This indicator implements the Amihud Illiquidity Ratio, a financial metric designed to measure the price impact of trading volume. It assesses the relationship between absolute price returns and the volume required to generate that return, providing traders with insight into the "stress" levels of the market liquidity.
Concept and Originality
Standard volume indicators often look at volume in isolation. This script differentiates itself by contextualizing volume against price movement. It answers the question: "How much did the price move per unit of volume?" Furthermore, unlike static indicators, this implementation utilizes dynamic percentile zones (Linear Interpolation) to adapt to the changing volatility profile of the specific asset you are viewing.
Methodology
The calculation proceeds in three distinct steps:
1. Daily Return: The script calculates the absolute percentage change of the closing price relative to the previous close.
2. Raw Ratio: The absolute return is divided by the volume. I have introduced a standard scaling factor (1,000,000) to the calculation. This resolves the issue of the values being astronomically small (displayed as roughly 0) without altering the fundamental logic of the Amihud ratio (Absolute Return / Volume).
- High Ratio: Indicates that price is moving significantly on low volume (Illiquid/Thin Order Book).
- Low Ratio: Indicates that price requires massive volume to move (Liquid/Deep Order Book).
3. Dynamic Regimes: The script calculates the 75th and 25th percentiles of the ratio over a lookback period. This creates adaptive bands that define "High Stress" and "Liquid" zones relative to recent history.
How to Use
Traders can use this tool to identify market fragility:
- High Stress Zone (Red Background): When the indicator crosses above the 75th percentile, the market is in a High Illiquidity Regime. Price is slipping easily. This is often observed during panic selling or volatile tops where the order book is thin.
- Liquid Zone (Green Background): When the indicator drops below the 25th percentile, the market is in a Liquid Regime. The market is absorbing volume well, which is often characteristic of stable trends or accumulation phases.
- Dashboard: A visual table on the chart displays the current Amihud Ratio and the active Market Regime (High Stress, Normal, or Liquid).
Inputs
- Calculation Period: The lookback length for the average illiquidity (Default: 20).
- Smoothing Period: The length of the additional moving average to smooth out noise (Default: 5).
- Show Quant Dashboard: Toggles the visibility of the on-screen information table.
● How to read this chart
• Spike in Illiquidity (Red Zones)
Price is moving on "thin air." Expect high volatility or potential reversals.
• Low Illiquidity (Green/Stable Zones)
The market is deep and liquid. Trends here are more sustainable and reliable.
• Divergence
Watch for price making new highs while liquidity is drying up—a classic sign of an exhausted trend.
Example:
● Chart Overview
The chart displays the Amihud Illiquidity indicator applied to a Gold (XAUUSD) 4-hour timeframe.
Top Pane: Price action with manual text annotations highlighting market reversals relative to liquidity zones.
Bottom Pane: The specific technical indicator defined in the logic. It features a Blue Line (Raw Illiquidity), a Red Line (Signal/Smoothed), and dynamic background coloring (Red and Green vertical strips).
● Deep Visual Analysis
• High Stress Regime (Red Zones)
Visual Event: In the bottom pane, the background periodically shifts to a translucent red.
Technical Logic: This event is triggered when the amihudAvg (the smoothed illiquidity ratio) exceeds the 75th percentile ( hZone ) of the lookback period.
Forensic Interpretation: The logic calculates the absolute price change relative to volume. A spike into the red zone indicates that price is moving significantly on relatively lower volume (high price impact). Visually, the chart shows these red zones aligning with local price peaks (volatility expansion), leading to the bearish reversal marked by the red box in the top pane.
• Liquid Regime (Green Zones)
Visual Event: The background shifts to a translucent green in the bottom pane.
Technical Logic: This triggers when the amihudAvg falls below the 25th percentile ( lZone ).
Forensic Interpretation: This state represents a period where large volumes are absorbed with minimal price impact (efficiency). On the chart, this green zone corresponds to the consolidation trough (green box, top pane), validating the annotated accumulation phase before the bullish breakout.
• Indicator Lines
Blue Line: This is the illiquidityRaw value. It represents the raw daily return divided by volume.
Red Line: This is the smoothedVal , a Simple Moving Average (SMA) of the raw data, used to filter out noise and define the trend of liquidity stress.
● Anomalies & Critical Data
• The Reversal Pivot
The transition from the "High Stress" (Red) background to the "Liquid" (Green) background serves as a visual proxy for market regime change. The chart shows that as the Red zones dissipate (volatility contraction), the market enters a Green zone (efficient liquidity), which acted as the precursor to the sustained upward trend on the right side of the chart.
● About Yakov Amihud
Yakov Amihud is a leading researcher in market liquidity and asset pricing.
• Brief Background
Professor of Finance, affiliated with New York University (NYU).
Specializes in market microstructure, liquidity, and quantitative finance.
His work has had a major impact on both academic research and practical investment models.
● The Amihud (2002) Paper
In 2002, he published his influential paper: “Illiquidity and Stock Returns: Cross-Section and Time-Series Effects” .
• Key Contributions
Introduced the Amihud Illiquidity Measure, a simple yet powerful proxy for market liquidity.
Demonstrated that less liquid stocks tend to earn higher expected returns as compensation for liquidity risk.
The measure became one of the most widely used liquidity metrics in finance research.
● Why It Matters in Practice
Used in quantitative trading models.
Applied in portfolio construction and risk management.
Helpful as a liquidity filter to avoid assets with excessive price impact.
In short: Yakov Amihud established a practical and robust link between liquidity and returns, making his 2002 work a cornerstone in modern financial economics.
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. I 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.
JK Scalp - Nishith RajwarJK Scalp Nishith Rajwar
Multi-Stochastic Rotation & Momentum Scalping Framework
JK Scalp is a rule-based momentum and rotation oscillator designed for short-term scalping and intraday execution.
It focuses on how momentum rotates across multiple stochastic speeds, instead of relying on a single oscillator or lagging averages.
This is an execution aid, not a predictive indicator.
🧠 Concept & Originality
Unlike standard stochastic tools, JK Scalp uses four synchronized stochastic layers:
• Fast (9,3) → execution timing
• Medium (14,3) → structure confirmation
• Slow (44,3) → swing context
• Trend (60,10,10) → dominant momentum regime
The core idea is quad-rotation:
High-probability trades occur when all momentum layers rotate together after reaching an extreme.
This script combines:
• Momentum rotation
• Divergence logic
• Flag continuation logic
• Trend-state filtering
into a single cohesive framework, not a simple indicator mashup.
📊 How to Use (Step-by-Step)
1️⃣ Best Timeframes
• Scalping: 1m – 3m
• Intraday: 5m – 15m
• Avoid higher timeframes (not designed for swing holding)
Works best on:
• Index options
• Index futures
• Highly liquid stocks
• Crypto majors
2️⃣ Understanding the Signals
🔁 Quad Rotation (Core Signal)
A valid rotation requires:
• Fast, Medium, Slow, and Trend stochastic moving in the same direction
• Momentum exiting Overbought / Oversold zones
• Trend stochastic supporting the move
This filters out random oscillator noise.
3️⃣ Entry Conditions
🟢 LONG Setup
• Bullish quad rotation
• Either:
– Bullish divergence OR
– Bullish flag pullback
• Fast stochastic turning up
🔴 SHORT Setup
• Bearish quad rotation
• Either:
– Bearish divergence OR
– Bearish flag pullback
• Fast stochastic turning down
⚠️ Signals are confirmation-based, not anticipatory.
4️⃣ SUPER LONG / SUPER SHORT
These appear only when:
• Quad rotation
• Divergence confirmation
They represent high-confidence momentum inflection zones, not guaranteed reversals.
5️⃣ Stop-Loss Visualization
Optional SL zones are plotted using:
• Recent swing high / low
• ATR-based buffer (configurable)
This helps traders visualize risk, not automate exits.
🎨 Visual System (Why It Looks Different)
• Multi-layer glow effects → momentum strength
• Dynamic cloud → fast vs trend dominance
• Color-shifting fast line → acceleration vs decay
• Chart overlays → execution clarity without clutter
Everything is designed for speed and readability during live trading.
⭐ Unique Selling Points (USP)
✅ Multi-speed stochastic rotation (not single-line signals)
✅ Context-first, not signal spam
✅ Built-in divergence + continuation logic
✅ Non-repainting logic
✅ Designed for scalpers, not hindsight analysis
✅ Works across indices, options, crypto, and futures
⚠️ Important Notes
• Not a standalone trading system
• Best combined with:
– Market structure
– Key levels
– Session timing
• Avoid low-liquidity or news-spike candles
This indicator guides execution, it does not replace discretion.
👤 Who This Is For
• Scalpers & intraday traders
• Options traders needing precise timing
• Traders who understand momentum & structure
• Users who want fewer but higher-quality signals
🏁 Summary
JK Scalp helps you trade momentum rotation, not overbought/oversold myths.
Wait for alignment. Execute with discipline.
Momentum Signal StripesInspired by Kodi Kai Trades (Formerly known as "K2 Trades") www.youtube.com
Pine script generated by Gemini (thanks!)
SVE Compression Mirror (Companion)Why This Tool Exists
Intraday markets are driven not only by direction, but by volatility state and energy dynamics. Periods of compression, expansion, and transition often determine whether price behavior favors patience, rotation, or acceleration.
The SVE Compression Mirror (Companion) was created to make volatility compression and release conditions visible in real time, helping traders understand what type of market environment is currently present before forming directional conviction.
This indicator displays a two-state compression condition consistent with that referenced by the SVE Volatility Engine, exposed here as a standalone lower-pane context display.
________________________________________
How the Indicator Is Intended to Be Used
This indicator is designed strictly as a context layer, independent of trade direction or bias.
It highlights:
• Volatility compression versus expansion
• Transitions between compressed and released states
• Momentum behavior as energy builds or dissipates
The purpose is to support environment awareness, not to predict outcomes or generate signals.
________________________________________
What Appears on the Chart
When applied, the indicator displays:
• A lower-pane histogram representing momentum behavior
• Visual markers indicating whether volatility is compressed or released
• A clean, uncluttered presentation optimized for intraday use
The display is intentionally minimal and designed to pair with other structural or decision-support tools.
________________________________________
Intended Users
This indicator is designed for:
• Intraday traders seeking clearer volatility context
• Discretionary traders who value regime awareness
• Professionals and advanced retail traders who prioritize environment over prediction
________________________________________
Disclaimer
This indicator is provided for informational and analytical purposes only and does not constitute investment advice.
Market Potential EstimatorWhat this indicator shows
This indicator measures how much potential movement the market still has, not direction.
It answers the question:
“Does the market still have room to move, or is it already exhausted?”
Red zone (Low potential)
Exhaustion / slowdown zone.
The market has used most of its available range.
Expect:
consolidation
pullbacks
reduced follow-through
⚠️ Red does NOT mean reversal
How to use it correctly
Use it as a filter, not a trigger
Avoid opening new trades in red zones
Reduce targets when potential is low
Combine with:
direction/bias
momentum
structure
All-in-One Momentum Composite The Four Components (and Why They're Chosen)
RSI (Relative Strength Index) – Classic overbought/oversold oscillator (14-period default). Measures speed and change of price movements.
Stochastic (%D line) – Smoothened momentum indicator that compares closing price to the price range over a period. Excellent at spotting reversals in ranging markets.
WaveTrend – Very popular in crypto and forex communities (originally by LazyBear). It’s essentially a momentum oscillator based on overbought/oversold channels, similar to a faster, smoother RSI/Stochastic hybrid. Known for early divergence signals and clean crossovers.
MACD Histogram – Captures momentum changes and trend strength via the difference between fast and slow EMAs. The histogram shows acceleration/deceleration.
SMI Trigger System The SMI Trigger System is a lower-pane momentum indicator based on a Hull-smoothed Stochastic Momentum Index (SMI). It is designed to assist in identifying potential momentum shifts by highlighting signal alignment and level interactions.
This indicator is intended to be used as part of a broader analysis framework. Confluence between trend, structure, and higher-timeframe context defines the setup, while SMI signal behavior may be used for confirmation.
The script can be applied across multiple timeframes and markets. It does not generate trade signals on its own and should be used alongside additional analysis and risk management techniques.
For educational purposes only. Not financial advice.
USD Liquidity Regime IndexTrack global risk regimes with this USD Liquidity Composite —
It aims to be a daily macro indicator blending normalised DXY (50%), UUP (20%), 10Y Treasury yields (20%), and VIX (10%).
How to read:
When the blue index is above its red SMA: Strong USD, tightening liquidity → Risk-Off mode (often bearish for Nasdaq, BTC, and risk assets).
When the line is below: Weak USD, abundant liquidity → Risk-On (bullish environment).
Example: In 2022's bear market, the index stayed high above SMA most of the year, signalling persistent Risk-Off as USD surged.
Features on-chart table, regime background colors, and crossover alerts.
Great contextual tool for macro traders IMO.
Educational only — not financial advice.
Use at your own risk.
By @frank_vergaram
Adaptive RSI Pro# Adaptive RSI Pro / 自适应RSI专业版
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](www.tradingview.com)
[! (img.shields.io)](opensource.org)
Dynamic overbought/oversold thresholds + Multi-Timeframe analysis + Divergence detection + Signal statistics.
根据每个标的实际历史分布动态计算超买/超卖阈值,结合多时间框架分析、背离检测和信号统计。
**Pine Script v6** | **Last Update: 2025-12-17** | **v6.2**
---
## Emoji Legend / 信号图例
### Chart Signals / 图表信号
#### Buy Signals / 买入信号 (底部显示)
| Emoji | Signal Name | Condition | Priority | Action |
|-------|-------------|-----------|----------|--------|
| 🌟 | MTF + Extreme | 3+ timeframes oversold + Z<−2σ | ★★★★★ | **STRONG BUY** 强力买入 |
| 💎 | Divergence + Extreme | Bullish divergence in Z<−2σ zone | ★★★★☆ | **BUY** 买入 |
| 🔥 | Extreme Oversold | Z-Score crosses below −2σ (≈P2) | ★★★☆☆ | **BUY** 买入 |
| ⬆️ | Normal Oversold | Z-Score crosses below −1.5σ (≈P7) | ★★☆☆☆ | Consider buy 考虑买入 (默认隐藏) |
| ↗️ | Bullish Divergence | Price↓ RSI↑ (not in extreme zone) | ★☆☆☆☆ | Watch 观察 (潜在底部) |
#### Sell Signals / 卖出信号 (顶部显示)
| Emoji | Signal Name | Condition | Priority | Action |
|-------|-------------|-----------|----------|--------|
| 🌟 | MTF + Extreme | 3+ timeframes overbought + Z>+2σ | ★★★★★ | **STRONG SELL** 强力卖出 |
| 💎 | Divergence + Extreme | Bearish divergence in Z>+2σ zone | ★★★★☆ | **SELL** 卖出 |
| ❄️ | Extreme Overbought | Z-Score crosses above +2σ (≈P98) | ★★★☆☆ | **SELL** 卖出 |
| ⬇️ | Normal Overbought | Z-Score crosses above +1.5σ (≈P93) | ★★☆☆☆ | Consider sell 考虑卖出 (默认隐藏) |
| ↘️ | Bearish Divergence | Price↑ RSI↓ (not in extreme zone) | ★☆☆☆☆ | Watch 观察 (潜在顶部) |
> **Priority System / 优先级系统**: Only the highest priority signal is shown to prevent overlapping.
> 只显示最高优先级信号,避免叠加。
---
### Dashboard Status / 仪表盘状态
| Emoji | Status | Meaning |
|-------|--------|---------|
| 🟢 | EXTREME OVERSOLD | Z-Score < −2σ (≈P2.3), strong buy zone / 极端超卖区,强买区 |
| 🟡 | OVERSOLD | Z-Score < −1.5σ (≈P6.7), oversold / 超卖 |
| ⚪ | NEUTRAL | −1.5σ ≤ Z-Score ≤ +1.5σ, no signal / 中性,无信号 |
| 🟠 | OVERBOUGHT | Z-Score > +1.5σ (≈P93.3), overbought / 超买 |
| 🔴 | EXTREME OVERBOUGHT | Z-Score > +2σ (≈P97.7), strong sell zone / 极端超买区,强卖区 |
### MTF Status / 多周期状态
| Emoji | Meaning |
|-------|---------|
| 🟢 | Timeframe oversold / 该周期超卖 |
| 🔴 | Timeframe overbought / 该周期超买 |
| ⚪ | Timeframe neutral / 该周期中性 |
### Divergence Status / 背离状态
| Emoji | Meaning |
|-------|---------|
| 🟢 BULL DIV | Bullish divergence detected / 检测到看涨背离 |
| 🔴 BEAR DIV | Bearish divergence detected / 检测到看跌背离 |
| — | No divergence / 无背离 |
---
### Alert Emojis / 警报图标
| Emoji | Alert Type | Description |
|-------|------------|-------------|
| 🎯 | Smart Alert | V6 Unified Alert System / V6统一警报系统 |
---
## Overview / 概述
Traditional RSI uses fixed 30/70 thresholds, but different assets have different volatility characteristics.
传统RSI使用固定的30/70阈值,但不同标的有不同的波动特性。
**Solution**: Calculate thresholds using historical percentiles (P5-P95) + advanced features.
**解决方案**:使用历史百分位(P5-P95)计算阈值 + 高级功能。
---
## Features / 功能特性
### 🎯 Adaptive Thresholds / 自适应阈值
- **Z-Score Based Signals**: Uses statistical Z-Score (±2σ for extreme, ±1.5σ for normal) for consistent cross-asset performance
使用统计Z-Score(极端±2σ,普通±1.5σ)实现跨资产一致性
- **Percentile Lines**: Display P5/P10/P25/P50/P75/P90/P95 for visual reference
百分位线(P5-P95)作为视觉参考
- **Dual Display Modes**: Show Z-Score lines, Percentile lines, or both
双重显示模式:可选择显示Z值线、百分位线或两者
### 🔬 Auto-Adaptive Lookback / 自动自适应回看期
- **Statistical Formula**: Uses `n = (Z × σ / E)²` for optimal sample size calculation
统计公式:使用样本量公式自动计算最优回看期
- **Dual Volatility System**: Combines short-term (4× RSI length) and long-term volatility (configurable: 6M/1Y/2Y)
双重波动率系统:结合短期和长期波动率动态调整
- **Precision Control**: Choose High/Normal/Low precision (adjusts acceptable error margin)
精度控制:高/普通/低精度可选(调整统计误差容忍度)
- **Health Indicators**: Real-time validation of sample coverage, distribution spread, and statistical validity
健康度指标:实时验证样本覆盖率、分布宽度和统计有效性
### 📈 Auto-Adaptive Trend Filter / 自动自适应趋势过滤
- **Auto Mode**: Automatically selects optimal filter based on RSI volatility percentiles
自动模式:根据RSI波动率百分位自动选择最优过滤器
- **5 Filter Modes**: Fixed 50, Adaptive P50, SMA(RSI), BB(RSI), or Auto
5种过滤模式:固定50、自适应P50、RSI均线、布林带或自动
- **Smart Selection**: Low volatility → Fixed 50, Medium → Adaptive P50, High → BB(RSI)
智能选择:低波动→固定50,中波动→自适应P50,高波动→布林带
### 🌍 Multi-Timeframe RSI / 多时间框架RSI
- **3 Configurable Timeframes**: View RSI status across multiple timeframes (default: 1h/4h/D)
3个可配置时间框架:跨周期查看RSI状态(默认:1小时/4小时/日线)
- **Auto-Skip Duplicates**: Automatically detects and skips timeframes matching current chart
自动跳过重复:自动检测并跳过与当前图表相同的时间框架
- **Resonance Detection**: Triggers when 3+ valid timeframes agree (oversold/overbought)
共振检测:当3个以上有效时间框架一致时触发强信号
>
> **MTF Signal Confirmation Timing / 信号确认时机**
>
> - Current timeframe signals update in real-time, confirmed on bar close
> - Higher timeframe signals (e.g., Daily on 1H chart) only update after that timeframe's bar closes
> - **Best Practice**: Wait for current timeframe bar close before acting on MTF resonance signals
>
> - 当前图表周期的信号:实时更新,K线收盘确认
> - 高周期信号(如日线):仅在该周期K线收盘后更新
> - **最佳实践**:MTF共振信号建议在当前周期K线收盘后再做交易决策
### 💎 Auto-Adaptive Divergence Detection / 自动自适应背离检测
- **Auto Mode**: Automatically selects parameters based on asset volatility (using ATR)
自动模式:基于资产波动率(ATR)自动选择参数
- **4 Preset Modes**: Low Vol (3/40), Normal (5/60), High Vol (7/80), Crypto (10/120)
4种预设模式:低波动/普通/高波动/加密货币,分别对应不同的回看/范围参数
- **Extreme Zone Detection**: Distinguishes divergence in extreme zones (💎) vs normal zones (↗️↘️)
极端区域检测:区分极端区域背离(💎)和普通背离(↗️↘️)
- **Bullish/Bearish Divergence**: Price lower low + RSI higher low / Price higher high + RSI lower high
看涨/看跌背离:价格新低+RSI未新低 / 价格新高+RSI未新高
### 📊 Layered Signal Statistics / 分层信号统计
- **4-Tier Classification**: MTF Resonance (🌟) > Divergence+Extreme (💎) > Extreme Only (🔥❄️) > Normal (⬆️⬇️)
四层分级:多周期共振 > 背离+极端 > 仅极端 > 普通信号
- **Independent Tracking**: Each signal tier has separate count, average return, and win rate
独立跟踪:每层信号独立统计次数、平均收益、胜率
- **Signal Cooldown**: Optional cooldown period (default 5 bars) to prevent duplicate counting
信号冷却:可选冷却期(默认5根K线)防止重复计数
- **Real Forward Testing**: Calculates actual returns N bars after signal (configurable 5-100 bars)
真实前瞻测试:计算信号后N根K线的实际收益(可配置5-100)
---
## Z-Score 与 百分位:双重视角 / Dual Perspective
This indicator displays **both Z-Score and Percentile** to provide complementary views of the same RSI distribution.
本指标**同时显示Z-Score和百分位**,为同一RSI分布提供互补视角。
### Why Both? / 为什么同时显示?
**Fundamental Connection / 本质关联**:
两者都是描述RSI在历史分布中位置的统计方法。
Both are statistical methods describing RSI's position in historical distribution.
- **Z-Score(标准分数)**: `(RSI - 均值) / 标准差` - 基于正态分布假设
Based on normal distribution assumption.
- **百分位(Percentile)**: RSI在历史数据中的排名位置 - 不假设分布类型
RSI's ranking position in historical data - no distribution assumption.
**Complementary Advantages / 互补优势**:
| Dimension 维度 | Z-Score | Percentile 百分位 |
|------|---------|------------|
| **Cross-asset Consistency / 跨资产一致性** | ✅ Excellent 优秀 - BTC和SPY都用±2σ | ⚠️ Varies by volatility 因波动率不同而异 |
| **Statistical Rigor / 统计学严谨性** | ✅ Confidence intervals 置信区间、假设检验 | ⚠️ Non-parametric 非参数统计 |
| **Intuitive / 直观易懂** | ⚠️ Stats knowledge needed 需要统计学知识 | ✅ "Below 95% of history" "低于95%历史值" |
| **Use Case / 适用场景** | 📊 Quant backtesting 量化回测、信号触发 | 📈 Visualization 可视化、用户理解 |
### Conversion Reference / 转换对照表
**Quick Reference / 快速对照**(Assuming normal distribution / 假设正态分布):
| Z-Score | Percentile 百分位 | Meaning 含义 | Signal 信号类型 |
|---------|--------|---------------|----------|
| **±2.5σ** | **P0.6 / P99.4** | Extreme anomaly (outside 99% CI) / 极端异常(99%置信区间外) | Rare opportunity 罕见机会 |
| **±2.0σ** | **P2.3 / P97.7** | Extreme OB/OS (outside 95% CI) / 极端超买/超卖(95%置信区间外) | 🔥❄️ Extreme 极端信号 |
| ±1.5σ | P6.7 / P93.3 | Notable deviation / 显著偏离 | ⬆️⬇️ Normal 普通信号(默认) |
| ±1.0σ | P15.9 / P84.1 | Mildly strong/weak / 轻度偏强/偏弱 | — |
| 0σ | P50 | Median / 中位数 | — |
### Dashboard Dual Display / 仪表盘双重显示
**新版Dashboard已实现自动转换**:
```
┌─────────────────────────────────┐
│ ADAPTIVE RSI PRO 28.5 │
├─────────────────────────────────┤
│ Z-Score −2.15σ (≈P2) │ ← Z值 + 近似百分位
│ Percentile P5 (−1.5σ ~ −2σ) │ ← 百分位 + 对应Z值范围
│ Status 🟢 EXTREME OVERSOLD │
└─────────────────────────────────┘
```
**理解方式**:
- **从Z值看**:−2.15σ 表示超过95%置信区间,统计异常 → 对应约P2
- **从百分位看**:P5 表示低于95%历史值,极端超卖 → 对应约−1.5σ到−2σ之间
### Threshold Line Modes / 阈值线模式
**Unified Mode (Recommended) / Unified模式(推荐)** - Balances rigor and intuitiveness / 兼顾严谨性和直观性:
- Draws: Z-Score threshold lines (±2σ, ±1.5σ) / 绘制:Z-Score阈值线(±2σ、±1.5σ)
- Labels: Corresponding percentiles (≈P98, ≈P93, ≈P7, ≈P2) / 标注:对应百分位(≈P98、≈P93、≈P7、≈P2)
- Advantage: Instantly understand statistical meaning and historical position / 优势:一眼看懂统计意义和历史位置
**Other Modes / 其他模式**:
- `Z-Score`: Statistical threshold lines only / 仅显示统计学阈值线
- `Percentile`: Percentile lines only / 仅显示百分位线
- `Both`: Display both types (denser) / 同时显示两类线(较密集)
### Practical Examples / 实际应用示例
**Scenario 1: Identifying Extreme Opportunities / 场景1:识别极端机会**
```
Current RSI / 当前RSI: 25.3
Dashboard shows / Dashboard显示:
Z-Score: −2.35σ (≈P1)
Percentile: P5 (< −2σ)
Status: 🟢 EXTREME OVERSOLD
Interpretation / 解读:
• Statistical perspective / 统计学视角: Beyond 99% confidence interval (|Z| > 2.3) / 超过99%置信区间,极端异常
• Intuitive perspective / 直观视角: Lower than 99% of historical values / 低于99%的历史值都低,罕见超卖
• Conclusion / 结论: Strong buy signal 🔥 / 强力买入信号 🔥
```
**Scenario 2: Normal Signal Judgment / 场景2:普通信号判断**
```
Current RSI / 当前RSI: 63.8
Dashboard shows / Dashboard显示:
Z-Score: +1.52σ (≈P94)
Percentile: P90 (+1.5σ ~ +2σ)
Status: 🟠 OVERBOUGHT
Interpretation / 解读:
• Statistical perspective / 统计学视角: ~1.5 std dev, notably high but not extreme / 约1.5倍标准差,显著偏高但未极端
• Intuitive perspective / 直观视角: Higher than 90% of historical values / 高于90%的历史值,轻度超买
• Conclusion / 结论: Consider reducing position, not forced sell ⬇️ / 考虑减仓,非强制卖出 ⬇️
```
### Dashboard Display Logic / Dashboard显示逻辑
**Z-Score Row Display / Z-Score行显示**:
- Always shows current Z-value (2 decimal places) / 始终显示当前Z值(精确到2位小数)
- Auto-calculates approximate percentile: `≈P ` / 自动计算对应的近似百分位:`≈P `
- Uses Error Function for precise conversion / 使用误差函数(Error Function)精确转换
**Percentile Row Display / Percentile行显示**:
- Shows RSI's percentile range (P5, P10, P25, etc.) / 显示RSI所处的百分位区间(P5, P10, P25等)
- Labels corresponding Z-value range (e.g., `−1.5σ ~ −2σ`) / 标注对应的Z值范围(如:`−1.5σ ~ −2σ`)
- Helps understand what "P10" means statistically / 帮助理解"P10"的统计意义
**Color Association / 颜色关联**:
- Both rows use same status color (green/yellow/white/orange/red) / 两行使用相同的状态颜色(绿/黄/白/橙/红)
- Visually reinforces "same indicator, different expressions" / 视觉上强化"同一指标的不同表达"概念
---
### Dashboard Setups / 仪表盘配置
#### Full Mode (PC/Tablet)
Shows detailed stats, MTF status, and divergence info.
显示详细统计、MTF状态和背离信息。
#### Mobile Mode (Phone) / 手机模式
Simplified 3-row layout optimized for small screens.
极简3行布局,专为手机屏幕优化。
- Row 1: RSI Value / 第1行:RSI数值
- Row 2: Signal Status (Emoji) / 第2行:信号状态 (Emoji)
- Row 3: Trend/Filter Status / 第3行:趋势/过滤状态
### 📈 Dashboard Example / 面板示例
```
┌─────────────────────────────────┐
│ ADAPTIVE RSI PRO 35.2 │
├─────────────────────────────────┤
│ Status 🟢 EXTREME OVERSOLD │
│ Percentile P10 ↓ DOWN │
│ Lookback 456 ✅✅✅ │
├─────────────────────────────────├ (Full Mode Only)
│ ── MTF ── │
│ 1h | 4h | D 🟢 | ⚪ | 🟢 │
│ Resonance 🟢 3/4 OVERSOLD │
├─────────────────────────────────┤
│ Divergence 🟢 BULL (5/60) │
├─────────────────────────────────┤
│ ── STATS ── (20 bars) │
│ 🌟 MTF Buy(12) +4.2% | 83% │
│ 🌟 MTF Sell(8) +3.8% | 75% │
│ 💎 Div Buy(15) +3.5% | 80% │
│ 💎 Div Sell(11) +2.9% | 73% │
│ 🔥 Ext Buy(45) +2.1% | 67% │
│ ❄️ Ext Sell(38) +1.8% | 63% │
└─────────────────────────────────┘
```
**Health Indicators / 健康度指标**:
- ✅✅✅ = All healthy (所有健康): Sample coverage ≥ 80%, Distribution spread ≥ 15, Statistical validity ≥ 90%
- ⚠️ present = Warning (警告): One or more health checks failed, consider using Custom mode with larger lookback
---
## Chart Lines Guide / 图表线条指南
! (images/annotated_rsi_indicator.png)
### 📊 主要线条 / Main Lines
| 线条 | 颜色/样式 | 含义 | 作用 |
|------|----------|------|------|
| **RSI主线** | 黄色粗线 | 当前RSI值 | 实时跟踪相对强弱指标 |
| **P50 自适应中位数** | 白色阶梯线 | 动态中线 | 根据历史数据自动调整的中位数,比固定50更准确 |
### 🔴 超买阈值线 / Overbought Thresholds (上方红色)
| 线条 | Z-Score | 百分位 | 样式 | 信号 |
|------|---------|--------|------|------|
| **极端超买线** | +2σ | ≈P98 | 实线 | 触发 ❄️ 极端超买信号(强卖出) |
| **普通超买线** | +1.5σ | ≈P93 | 圆点虚线 | 触发 ⬇️ 普通超买信号(考虑卖出) |
### 🟢 超卖阈值线 / Oversold Thresholds (下方绿色)
| 线条 | Z-Score | 百分位 | 样式 | 信号 |
|------|---------|--------|------|------|
| **极端超卖线** | -2σ | ≈P2 | 实线 | 触发 🔥 极端超卖信号(强买入) |
| **普通超卖线** | -1.5σ | ≈P7 | 圆点虚线 | 触发 ⬆️ 普通超卖信号(考虑买入) |
### ⚪ 固定参考线 / Fixed Reference Lines
| 线条 | 位置 | 样式 | 作用 |
|------|------|------|------|
| **0线** | 底部 | 灰色点线 | RSI下边界 |
| **50线** | 中间 | 灰色点线 | 传统固定中线参考 |
| **100线** | 顶部 | 灰色点线 | RSI上边界 |
### 🎨 渐变填充区域 / Gradient Fill Zones
- **红色渐变**(上方):超买区域,颜色越深表示越极端
- P95-P90(深红)> P90-P75(中红)> P75-P50(浅红)
- **绿色渐变**(下方):超卖区域,颜色越深表示越极端
- P10-P5(深绿)> P25-P10(中绿)> P50-P25(浅绿)
### 💡 关键要点 / Key Points
**线条样式区分 / Line Style Distinction:**
- **实线** = 极端信号(±2σ),优先级高,统计上95%置信区间外
- **圆点虚线** = 普通信号(±1.5σ),优先级较低,显著偏离但未极端
**动态 vs 固定 / Dynamic vs Fixed:**
- **彩色线**(红/绿)= 根据历史波动动态调整,适应不同资产特性
- **灰色虚线** = 固定不变的参考线,用于传统RSI对比
**视觉层次 / Visual Hierarchy:**
- 线条粗细:RSI主线(最粗)> 极端阈值(粗)> 普通阈值(细)> 参考线(最细)
- 透明度:核心线条(不透明)> 百分位线(半透明)> 填充区(高透明)
---
## Settings / 设置
### RSI Settings / RSI设置
| Setting | Default | Description |
|---------|---------|-------------|
| RSI Length | 14 | RSI calculation period / RSI计算周期 |
| RSI Source | Close | Price source / 价格源 |
### Adaptive Settings / 自适应设置
| Setting | Default | Description |
|---------|---------|-------------|
| Lookback Mode | Auto | Auto (statistical formula) / Custom / 自动/自定义 |
| Custom Lookback | 252 | Only used in Custom mode / 仅自定义模式使用 |
| Precision | Normal | High/Normal/Low: Adjusts error tolerance / 精度等级 |
| History Depth | 1 Year | 6 Months / 1 Year / 2 Years for volatility calculation / 波动率历史深度 |
### Visual Settings / 视觉设置
| Setting | Default | Description |
|---------|---------|-------------|
| Threshold Line Mode | **Unified** | Unified(推荐)/Z-Score/Percentile/Both / 阈值线模式 |
| Show Gradient Fill | ON | Display background gradients / 显示背景渐变 |
| Show Dashboard | ON | Display dashboard panel / 显示仪表盘面板 |
| Dashboard Mode | Full | Full/Lite/Mobile(Phone) / 面板模式 |
| Dashboard Size | Normal | Tiny/Small/Normal/Large / 面板大小 |
| Dashboard Transparency | 30 | 0-100% transparency level / 透明度 |
| Bullish Color | #00E676 | Custom color for bullish signals / 牛市信号颜色 |
| Bearish Color | #FF5252 | Custom color for bearish signals / 熊市信号颜色 |
| RSI Line Color | #FFEB3B | RSI line color / RSI主线颜色 |
### Trend Filter / 趋势过滤
| Setting | Default | Description |
|---------|---------|-------------|
| Enable Trend Filter | OFF | Only trigger signals in trend direction / 趋势方向过滤 |
| Filter Mode | Auto | Auto/Fixed 50/Adaptive P50/SMA(RSI)/BB(RSI) / 过滤模式 |
### Alert Settings / 警报设置
| Setting | Default | Description |
|---------|---------|-------------|
| **🎯 Smart Alert** | **ON** | **V6 Unified Alert System** / V6统一警报系统 |
| Show Normal Signals | OFF | Display ⬆️⬇️ on chart / 图表显示普通信号 |
| Normal Signal Threshold | 1.5σ | Z-Score threshold (1.0-2.0σ) / 普通信号阈值 |
| Enable Signal Cooldown | ON | Prevent duplicate signal counting / 防止重复信号 |
| Cooldown Period | 5 bars | Bars between same signal type / 冷却K线数 |
### Multi-Timeframe / 多时间框架
| Setting | Default | Description |
|---------|---------|-------------|
| Enable | ON | Show MTF analysis / 显示MTF分析 |
| MTF Mode | **Auto** | **Auto** (Fractal Breakdown) / **Manual** (Fixed) / 自动/手动模式 |
| TF1/TF2/TF3 | 60/240/D | Timeframes (Manual mode only) / 时间框架(仅手动模式)|
### Signal Statistics / 信号统计
| Setting | Default | Description |
|---------|---------|-------------|
| Enable | ON | Track performance / 跟踪表现 |
| Forward Bars | 20 | Bars for return calculation / 收益计算K线数 |
### Divergence Detection / 背离检测
| Setting | Default | Description |
|---------|---------|-------------|
| Enable Detection | ON | Detect divergences / 检测背离 |
| Divergence Mode | Auto | Auto/Low Vol/Normal/High Vol/Crypto/Custom / 背离模式 |
| Custom Lookback | 5 | Only in Custom mode / 仅自定义模式使用 |
| Custom Range | 60 | Only in Custom mode / 仅自定义模式使用 |
**Auto Mode Presets / 自动模式预设**:
- Low Vol (蓝筹/ETF): Lookback 3, Range 40
- Normal (一般股票): Lookback 5, Range 60
- High Vol (成长股): Lookback 7, Range 80
- Crypto (加密货币): Lookback 10, Range 120
---
## Alerts / 警报
### 🎯 Smart Alert (V6 Unified System)
**The only alert method / 唯一的警报方式** - 自动聚合所有信号到一条富文本消息
Automatically aggregates all signals into a single rich-text message.
**Setup Steps / 设置方法**:
1. Keep "🎯 Smart Alert" enabled in indicator settings (default) / 指标设置中保持 "🎯 Smart Alert" 开启(默认)
2. When creating alert, select **"Any alert() function call"** / 创建警报时选择 **"Any alert() function call"**
3. Done! You'll receive real-time aggregated alerts / 完成!您会收到实时的聚合警报
**Message Example / 消息示例**:
```
AAPL: 🟢 BUY SIGNALS → 🌟MTF共振 💎背离 🔥极端 | RSI:25.3 Z:-2.1σ (≈P2)
AAPL: 🔴 SELL SIGNALS → ❄️极端 | RSI:78.5 Z:2.3σ (≈P98)
```
**Features / 特性**:
- ✅ **Real-time trigger / 实时触发** - Sends when condition met within bar / K线运行中触发条件即发送
- ✅ **Anti-flicker / 防闪烁** - Uses `varip` to prevent duplicate alerts from signal flickering within same bar / 使用 `varip` 防止信号闪烁导致同一K线内重复警报
- ✅ **Signal upgrade detection / 信号升级检测** - Alerts when stronger signal appears (e.g., 🔥Extreme → 🌟MTF) even on same bar / 同一K线内出现更强信号时也会触发(如:🔥极端 → 🌟MTF共振)
- ✅ **Full context / 完整上下文** - Includes RSI value, Z-Score, approximate percentile / 包含RSI值、Z-Score、近似百分位
- ✅ **Auto-aggregation / 自动聚合** - One message contains all triggered signals / 一条消息包含所有触发的信号
- ✅ **Buy/Sell independent tracking / 买卖独立追踪** - Buy and Sell alerts tracked separately / 买入和卖出警报独立追踪,互不干扰
**Signal Priority Levels / 信号优先级**:
| Level 等级 | Signal 信号 | Description 描述 |
|------------|-------------|------------------|
| 4 (Highest) | 🌟 MTF Resonance | Multi-timeframe agreement / 多周期共振 |
| 3 | 💎 Divergence | Divergence + Extreme zone / 背离+极端区 |
| 2 | 🔥❄️ Extreme | Extreme oversold/overbought / 极端超卖/超买 |
| 1 (Lowest) | ⬆️⬇️ Normal | Normal oversold/overbought / 普通超卖/超买 |
---
## Usage Tips / 使用建议
| Timeframe | Lookback | Use Case |
|-----------|----------|----------|
| Daily | 252 | Swing trading / 波段交易 |
| 4H | 1000 | Short-term / 短线 |
| 1H | 2000 | Day trading / 日内交易 |
**Best Practices / 最佳实践:**
1. Focus on 🌟 and 💎 signals (highest priority) / 优先关注 🌟 和 💎 信号(最高优先级)
2. Use MTF resonance for high-confidence entries / 使用 MTF 共振确认高置信度入场
3. Check win rate in stats before trading / 交易前查看统计胜率
---
## Changelog / 更新日志
### v6.2 - Smart Alert Anti-Flicker / 智能防抖警报 (Current / 当前版本)
- 🛡️ **Anti-flicker Mechanism / 防闪烁机制**: Fixed issue where signal flickering caused multiple duplicate alerts within same bar. Now uses `varip` to track alert status per bar. / 修复信号闪烁导致同一K线内发送多次重复警报的问题,使用 `varip` 追踪每根K线的警报状态。
- 📈 **Signal Upgrade Detection / 信号升级检测**: Tracks signal priority level (MTF=4, Divergence=3, Extreme=2, Normal=1). Sends new alert when stronger signal appears on same bar. / 追踪信号优先级等级。同一K线内出现更强信号时会发送新警报。
- 🔄 **Independent Buy/Sell Tracking / 买卖独立追踪**: Buy and Sell alerts are tracked independently, allowing direction changes within same bar. / 买入和卖出警报独立追踪,允许同一K线内捕捉方向变化。
### v6.1 - Mobile Experience / 移动端体验
- 📱 **Mobile Dashboard / 手机端面板**: Added simplified "Mobile" mode optimized for phone screens (RSI + Signal Emoji only). / 新增简化的"Mobile"模式,针对手机屏幕优化(仅显示RSI+信号Emoji)。
- 🔥 **Persistent Zone Status / 持续区域状态**: Mobile Dashboard now shows persistent extreme zone indicators when no new signal but RSI remains in zone: `🔥持续` (Extreme Oversold), `❄️持续` (Extreme Overbought), `⬆️区` (Oversold), `⬇️区` (Overbought). / 手机端面板现在显示持续极端区域指示器:无新信号但RSI仍在区域内时显示持续状态。
- 🔧 **UX Improvements / 用户体验优化**: Optimized font sizes and layout for small screens. / 优化字体大小和小屏幕布局。
### v6.0 - Alert System Simplification & V6 Optimization / 警报系统简化与V6优化
- 🎯 **Smart Alert System / 智能警报系统简化**:
- **Unified entry / 唯一警报入口**: Removed all legacy alertcondition, unified to V6 Smart Alert / 移除所有legacy alertcondition,统一为V6 Smart Alert
- **Real-time trigger / 实时触发**: Changed to `alert.freq_once_per_bar` for intra-bar response / 改为 `alert.freq_once_per_bar` 实现K线内实时响应
- **Smart dedup / 智能去重**: Rising edge detection (`signal and not signal `) / 上升沿检测,只在新信号出现时触发
- **Auto-aggregation / 自动聚合**: Single message with all signals + RSI + Z-Score + Percentile / 单条消息包含所有触发信号 + RSI + Z-Score + 百分位
- **Simplified settings / 简化设置**: Removed "Extreme Alerts" and "Normal Alerts", only Smart Alert toggle / 移除 "Extreme Alerts" 和 "Normal Alerts",只保留Smart Alert开关
- 🛠 **Performance Optimization / 性能优化**:
- Reduced `request.security` calls by 50% using Tuple Requests / 使用元组请求减少50%的`request.security`调用
- Implemented `str.format()` for cleaner and faster string processing / 实现`str.format()`使字符串处理更简洁高效
- 🧹 **Code Cleanup / 代码清理**:
- Refactored timeframe display and alert logic / 重构时间框架显示和警报逻辑
- Fixed plot limit issues and tuple assignment syntax / 修复绑点限制问题和元组赋值语法
- Unified plot titles with percentile annotations / 统一绑点标题与百分位标注
### v5.0 - Adaptive Fractal MTF / 自适应分形MTF
- 🧠 **Adaptive Fractal MTF / 自适应分形MTF**: New "Auto" mode automatically selects lower timeframes for precision structure analysis (Internal Fractal Resonance). / 新增"Auto"模式,自动选择更低时间框架进行精确结构分析(内部分形共振)。
- Daily Chart → Analyzes 1H & 4H / 日线图 → 分析1小时和4小时
- 1H Chart → Analyzes 5m & 15m / 1小时图 → 分析5分钟和15分钟
- 15m Chart → Analyzes 1m & 5m / 15分钟图 → 分析1分钟和5分钟
- 🛠 **Code Refactoring / 代码重构**: Implemented Pine Script v6 UDTs (Objects) and Methods for robust signal statistics. / 实现Pine Script v6 UDT(对象)和方法,增强信号统计的健壮性。
- 🎨 **Dashboard Optimization / 面板优化**: Enhanced string formatting using `str.format` for cleaner display. / 使用`str.format`优化字符串格式,显示更简洁。
### v4.0 - Pine Script v6 Upgrade / Pine Script v6升级
- 🚀 Upgraded entire codebase to **Pine Script v6** engine / 将整个代码库升级到 **Pine Script v6** 引擎
- ⚡ Optimization for better performance and future-proofing / 性能优化,面向未来
- 🛠 Maintenance updates for latest TradingView standards / 维护更新以符合最新TradingView标准
### v3.0 - Auto-Adaptive Systems / 自动自适应系统
- ✨ Auto-adaptive lookback using formula `n = (Z × σ / E)²` / 使用统计公式 `n = (Z × σ / E)²` 自动计算回看期
- ✨ Auto-adaptive trend filter with 5 modes / 5种模式的自动自适应趋势过滤器
- ✨ Auto-adaptive divergence detection with 4 presets / 4种预设的自动自适应背离检测
- ✨ Layered statistics (MTF/Divergence/Extreme/Normal) / 分层统计系统(MTF/背离/极端/普通)
- ✨ Signal cooldown to prevent duplicate counting / 信号冷却机制防止重复计数
- ✨ Health indicators for lookback validation / 回看期健康度指标验证
- ✨ Dashboard modes (Lite/Full) with customization / 面板模式(Lite/Full)支持自定义大小和透明度
- ✨ Dual volatility system (short + long-term) / 双重波动率系统(短期+长期)
### v2.1 - Signal Optimization / 信号优化
- ✨ Consolidated signals with priority system / 信号合并与优先级系统(无重叠)
- ✨ Emoji-based signal display / 基于Emoji的信号显示
- ✨ MTF timeframe auto-skip for duplicates / MTF时间框架自动跳过重复
### v2.0 - Pro Edition / 专业版
- ✨ Added Trend Filter, MTF RSI, Statistics, Divergence / 新增趋势过滤、MTF RSI、统计、背离检测
- ✨ Z-Score based signal triggering / 基于Z-Score的信号触发
### v1.0 - Initial Release / 初始发布
- ✨ Adaptive percentile-based thresholds / 自适应百分位阈值
---
## License
MIT License - Feel free to use, modify, and share.
MACD + Divergence Indicator [Dynamic Filter]Title: MACD + Divergence
Description: This is an enhanced momentum analysis suite based on the classic Moving Average Convergence Divergence (MACD). It addresses the common weakness of the standard MACD—false signals during low-volatility consolidation—by integrating a Dynamic Volatility Filter and a Multi-Timeframe (MTF) Dashboard.
The Problem It Solves: Standard MACD indicators often generate "whipsaw" crossovers when the market is ranging (moving sideways). Traders often struggle to identify these consolidation zones until it is too late. This script solves this by calculating a dynamic "Consolidation Zone" based on Standard Deviation, visually warning traders when momentum is too weak to be reliable.
Key Features:
1. Dynamic Consolidation Filter (The Grey Zone)
The script calculates Upper and Lower bands around the MACD line using Standard Deviation (Volatility).
Grey Fill: When the MACD line is inside the grey bands, the market is in a "Squeeze" or low-volatility consolidation. Crossovers in this zone are often lower probability.
Breakout: When the MACD line exits the bands, it indicates a volatility expansion and a potentially stronger trend.
2. Automated Divergence Detection
Automatically scans for both Regular (Reversal) and Hidden (Continuation) divergences between Price and Momentum.
Bullish: Marked with Green lines/labels.
Bearish: Marked with Red lines/labels.
Customization: You can choose to calculate divergence based on the MACD Line or the Histogram via settings.
3. Multi-Timeframe (MTF) Dashboard
A customizable information table (optional) displays the MACD state across 4 different timeframes (e.g., 15m, 1H, 4H, Daily).
It checks for Trend Alignment (e.g., are all timeframes Bullish?) to help you trade in the direction of the higher timeframes.
4. Enhanced Visuals
4-Color Histogram: Visualizes momentum growing (bright) vs. momentum fading (pale) for both bullish and bearish phases.
Line Highlights: The MACD and Signal lines are clearly distinct, with configurable smoothing options (EMA/SMA).
Settings Guide:
Consolidation Filter: Increase the Dynamic Filter Multiplier (Default: 0.5) to widen the grey zone if you want to filter out more noise.
Oscillator Source: Switch between "MACD Line" or "Histogram" for divergence detection depending on your strategy.
Table: You can toggle the dashboard on/off or change its position to fit your chart layout.
Credits: Base MACD logic derived from standard technical analysis concepts. Dynamic filtering logic adapted from volatility band theories.
Volume DI Diff + ADX Coloreado por AOInterpretationIf +DI > -DI (positive DI+ - DI- difference) → Upward trend pressure (bullish signal).
If -DI > +DI (negative DI+ - DI- difference) → Downward trend pressure (bearish signal).
Crossovers between +DI and -DI generate buy/sell signals, often filtered by ADX for reliability.
This setup is widely used in technical analysis to identify trending markets and avoid whipsaws in ranging conditions. It's part of the broader Average Directional Movement System (ADX/DMI).
Key ComponentsADX line: Measures overall trend strength (non-directional).
+DI line: Strength of upward movement.
-DI line: Strength of downward movement.
Trend direction is determined by which DI line is dominant:+DI > -DI: Bullish trend (upward pressure).
-DI > +DI: Bearish trend (downward pressure).
Crossovers between +DI and -DI can signal potential trend changes, but they are most reliable when ADX confirms sufficient strength.ADX Trend Strength Levels (Common Interpretations)ADX Value
Trend Strength
Recommendation
0–20
Weak or no trend (ranging/sideways market)
Avoid trend-following strategies; consider range-bound or oscillator-based trades.
20–25
Emerging or moderate trend (gray zone)
Monitor for confirmation; potential start of trend.
25–50
Strong trend
Ideal for trend-following strategies (e.g., moving averages, breakouts).
50–75
Very strong trend
High momentum; good for riding trends, but watch for exhaustion.
75–100
Extremely strong trend (rare)
Often overextended; risk of reversal or correction.
Rising ADX: Trend is strengthening.
Falling ADX: Trend is weakening (even if still high).
EMA13-EMA21 Difference Indicator# EMA13-EMA21 Difference Indicator
## Description
This indicator calculates the difference between the 13-period Exponential Moving Average (EMA13) and the 21-period Exponential Moving Average (EMA21), helping traders visually assess short-term market momentum.
**Core Logic:**
- When the difference is positive (green), the short-term EMA is above the long-term EMA, indicating a bullish trend
- When the difference is negative (red), the short-term EMA is below the long-term EMA, indicating a bearish trend
- Crossovers of the zero line can serve as potential trend reversal signals
**Use Cases:**
- Trend direction identification
- Momentum strength analysis
- Entry and exit timing assistance
**Disclaimer:**
This indicator is for reference only. It is recommended to combine it with other technical analysis tools for comprehensive judgment. This does not constitute investment advice.
VR Volume Ratio + Divergence (Pro)成交量比率 (Volume Ratio, VR) 是一項通過分析股價上漲與下跌日的成交量,來研判市場資金氣氛的技術指標。本腳本基於傳統 VR 公式進行了優化,增加了**「趨勢變色」與「自動背離偵測」**功能,幫助交易者更精準地捕捉量價轉折點。
Introduction
Volume Ratio (VR) is a technical indicator that measures the strength of a trend by comparing the volume on up-days versus down-days. This script enhances the classic VR formula with "Trend Color Coding" and "Auto-Divergence Detection", helping traders identify volume-price reversals more accurately.
核心功能與參數
公式原理: VR = (Qu + Qf/2) / (Qd + Qf/2) * 100
Qu: 上漲日成交量 (Up volume)
Qd: 下跌日成交量 (Down volume)
Qf: 平盤日成交量 (Flat volume)
參數 (Length):預設為 26 日,這是市場公認最有效的短中線參數。
關鍵水位線 (Key Levels):
< 40% (底部區):量縮極致,市場情緒冰點,常對應股價底部,適合尋找買點。
100% (中軸):多空分界線。
> 260% (多頭警戒):進入強勢多頭行情,但需注意過熱。
> 450% (頭部區):成交量過大,市場情緒亢奮,通常為頭部訊號。
視覺優化 (Visuals):
紅漲綠跌:當 VR 數值大於前一日顯示為紅色(動能增強);小於前一日顯示為綠色(動能退潮)。
背離訊號 (Divergence):自動標記量價背離。
▲ 底背離 (Bullish):股價創新低,但 VR 指標墊高(主力吸籌)。
▼ 頂背離 (Bearish):股價創新高,但 VR 指標走弱(買氣衰竭)。
Features & Settings
Formula Logic: Calculated as VR = (Qu + Qf/2) / (Qd + Qf/2) * 100.
Default Length: 26, widely regarded as the optimal setting for short-to-medium term analysis.
Key Zones:
< 40% (Oversold/Bottom): Extreme low volume, often indicating a market bottom and potential buying opportunity.
100% (Neutral): The balance point between bulls and bears.
> 260% (Bullish Zone): Strong uptrend, volume is expanding.
> 450% (Overbought/Top): Extreme high volume, often indicating a market top and potential reversal.
Visual Enhancements:
Color Coding: Line turns Red when VR rises (Momentum Up) and Green when VR falls (Momentum Down).
Divergence Signals: Automatically marks divergence points on the chart.
▲ Bullish Divergence: Price makes a lower low, but VR makes a higher low (Accumulation).
▼ Bearish Divergence: Price makes a higher high, but VR makes a lower high (Distribution).
應用策略建議
抄底策略:當 VR 跌破 40% 後,指標線由綠翻紅,或出現「▲底背離」訊號時,為極佳的波段進場點。
逃頂策略:當 VR 衝過 450% 進入高檔區,一旦指標線由紅翻綠,或出現「▼頂背離」訊號時,建議分批獲利了結。
Strategy Guide
Bottom Fishing: Look for entries when VR drops below 40% and turns red, or when a "▲ Bullish Divergence" label appears.
Taking Profit: Consider selling when VR exceeds 450% and turns green, or when a "▼ Bearish Divergence" label appears.
Disclaimer: This tool is for informational purposes only and does not constitute financial advice. / 本腳本僅供參考,不構成投資建議。
BTC - ALSI: Altcoin Season Index (Dynamic Eras)Title: BTC - ALSI: Altcoin Season Index (Dynamic Eras)
Overview & Philosophy
The Altcoin Season Index (ALSI) is a quantitative tool designed to answer the most critical question in crypto capital rotation: "Is it time to hold Bitcoin, or is it time to take risks on Altcoins?"
Most "Altseason" indicators suffer from Survivor Bias or Obsolescence. They either track a static list of coins that includes "dead" assets from previous cycles (ghosts of 2017), or they break completely when major tokens collapse (like LUNA or FTT).
This indicator solves this by using a Time-Varying Basket. The indicator automatically adjusts its reference list of Top 20 coins based on historical eras. This ensures the index tracks the winners of the moment—capturing the DeFi summer of 2020, the NFT craze of 2021, and the AI/Meme narratives of 2024/2025.
Methodology
The indicator calculates the percentage of the Top 20 Altcoins that are outperforming Bitcoin over a rolling window (Default: 90 Days).
The "Win" Count: For every major Altcoin performing better than BTC, the index adds a point.
Dynamic Eras: The basket of coins changes depending on the date:
2020 Era (DeFi Summer): Tracks the "Blue Chips" of the DeFi revolution like UNI, LINK, DOT, and early movers like VET and FIL.
2021 Era (Layer 1 Wars): Tracks the explosion of alternative smart contract platforms, adding winners like SOL, AVAX, MATIC, and ALGO.
2022 Era (The Survivors): Filters for resilience during the Bear Market, solidifying the status of established assets like SHIB and ATOM.
2023 Era (Infrastructure & Scale): Captures the rise of "Next-Gen" tech leading into the pre-halving year, introducing TON, APT (Aptos), and ARB (Arbitrum).
2024/25 Era (AI & Speed): Tracks the current Super-Cycle leaders, focusing on the AI narrative (TAO, RNDR), High-Performance L1s (SUI), and modern Memes (PEPE).
Chart Analysis & Strategy ( The "Alpha" )
As seen in the chart above, there is a strong correlation between ALSI Peaks and local tops in TOTAL3 (The Crypto Market Cap excluding BTC & ETH).
The Entry (Rotation): When the indicator rises above the neutral 50 line, it signals that capital is beginning to rotate out of Bitcoin and into Altcoins. This has historically been a strong confirmation signal to increase exposure to high-beta assets.
The Exit (Saturation): When the indicator hits 100 (or sustains in the Red Zone > 75), it means every single Altcoin is beating Bitcoin. Historically, this extreme exuberance often marks a local top in the TOTAL3 chart. This is the zone where smart money typically sells into strength, rather than opening new positions.
How to Read the Visuals
🚀 Altcoin Season (Red Zone > 75): Strong Altcoin dominance. The market is "Risk On."
🛡️ Bitcoin Season (Blue Zone < 25): Bitcoin dominance. Alts are bleeding against BTC. Historically, this is a defensive zone to hold BTC or Stablecoins.
Data Dashboard: A status table in the bottom-right corner displays the live Index Value, current Regime, and a System Check to ensure all 20 data feeds are active.
Settings
Lookback Period: Default 90 Days. Lowering this (e.g., to 30) makes the index faster but noisier.
Thresholds: Adjustable zones for Altcoin Season (Default: 75) and Bitcoin Season (Default: 25).
Credits & Attribution
This open-source indicator is built on the shoulders of giants. I acknowledge the original creators of the concept and the pioneers of its implementation on TradingView:
Original Concept: BlockchainCenter.net. - They established the industry standard definition: 75% of the Top 50 coins outperforming Bitcoin over 90 days = Altseason..
TradingView Implementation: Adam_Nguyen - He implemented the "Dynamic Era" logic (updating the coin list annually) on TradingView. Our code structure for the time-based switching is inspired by his methodology. See also his implementation in the chart. ( Altcoin Season Index - Adam) .
Comparison: Why use ALSI | RM?
While inspired by the above, ALSI introduces three key improvements:
Open Source: Unlike other popular TradingView versions (which are closed-source), this script is fully transparent. You can see exactly which coins are triggering the signal.
Sanitized History (Anti-Fragile): Historical Top 20 snapshots are not blindly used. "Dead" coins (like LUNA and FTT) from previous eras are manually filtered out. A raw index would crash during the Terra/FTX collapses, giving a false "Bitcoin Season" signal purely due to bad actors. The curated list preserves the integrity of the market structure signal.
Narrative Relevance: The 2024/25 basket was updated to include TAO (Bittensor) and RNDR, ensuring the index captures the dominant AI narrative, rather than tracking fading assets from the previous cycle.
You can compare the ALSI indicator with other available tradingview indicators in the chart: Different indicators for the same idea are shown in the 3 Pane window below the BTC and Total3 chart, whereas ALSI is the top pane indicator.
Important Note on Coin Selection Baskets are highly curated: Dead/irrelevant coins (FTT, LUNA, BSV) are excluded for clean signals. This prevents historical breaks and ensures Era T5 captures current narratives (AI, Memes) via TAO/RNDR. See above. Users are free to adjust the source code to test their own baskets.
Disclaimer
This script is for research and educational purposes only. Past correlations between ALSI and TOTAL3 do not guarantee future results. Market regimes can change, and "Altseasons" can be cut short by macro events.
Tags
bitcoin, btc, altseason, dominance, total3, rotation, cycle, index, alsi, Rob Maths






















