Top Crypto Above 28-Day AverageDescription
The “Top Crypto Above 28-Day Average” (CRYPTOTW) script scans a selectable universe of up to 120 top-capitalization cryptocurrencies (divided into customizable 40-symbol batches), then plots the count of those trading above their own 28-period simple moving average.  It helps you gauge broad market strength and identify which tokens are showing momentum relative to their recent trend.
Key Features
	•	Batch Selection: Choose among “Top40,” “Mid40,” or “Low40” market-cap groups, or set a custom batch size (up to 40 symbols) to keep within the API limit.
	•	Dynamic Plot: Displays a live line chart of how many cryptos are above their 28-day MA on each bar.
	•	Reference Lines: Automatic horizontal lines at 25%, 50%, and 75% of your batch to provide quick visual thresholds.
	•	Background Coloration: The chart background shifts green/yellow/red based on whether more than 70%, 50–70%, or under 50% of the batch is above the MA.
	•	Optional Table: On the final bar, show a sortable table of up to 28 tickers currently above their 28-day MA, including current price, percent above MA, and “Above” status color-coding.
	•	Alerts:
	•	Strong Batch Performance: Fires when >70% of the batch is above the MA.
	•	Weak Batch Performance: Fires when <10 cryptos (i.e. <25%) are above the MA.
Inputs
	•	Show Results Table (show_table): Toggle the detailed table on/off.
	•	Table Position (table_position): Select one of the four corners for your table overlay.
	•	Max Cryptos to Display (max_display): Limit the number of rows in the results table.
	•	Current Batch (current_batch): Pick “Top40,” “Mid40,” or “Low40.”
	•	Batch Size (batch_size): Define the number of symbols (1–40) you want to include from the chosen batch.
How to Use
	1.	Add the CRYPTOTW indicator to any chart.
	2.	Select your batch and size to focus on the segment of the crypto market you follow.
	3.	Watch the plotted line to see the proportion of tokens with bullish momentum.
	4.	(Optional) Enable the results table to see exactly which tokens are outperforming their 28-day average.
	5.	Set alerts to be notified when the batch either overheats (strong performance) or cools off significantly.
Why It Matters
By tracking the share of assets riding their 28-day trend, you gain a macro-level view of market breadth—crucial for spotting emerging rallies or early signs of broad weakness. Whether you’re swing-trading individual altcoins or assessing overall market mood, this tool distills complex data into an intuitive, actionable signal.
Sentiment
Diamond Peaks [EdgeTerminal]The Diamond Peaks indicator is a comprehensive technical analysis tool that uses a few mathematical models to identify high-probability trading opportunities. This indicator goes beyond traditional support and resistance identification by incorporating volume analysis, momentum divergences, advanced price action patterns, and market sentiment indicators to generate premium-quality buy and sell signals.
 Dynamic Support/Resistance Calculation 
The indicator employs an adaptive algorithm that calculates support and resistance levels using a volatility-adjusted lookback period. The base calculation uses ta.highest(length) and ta.lowest(length) functions, where the length parameter is dynamically adjusted using the formula: adjusted_length = base_length * (1 + (volatility_ratio - 1) * volatility_factor). The volatility ratio is computed as current_ATR / average_ATR over a 50-period window, ensuring the lookback period expands during volatile conditions and contracts during calm periods. This mathematical approach prevents the indicator from using fixed periods that may become irrelevant during different market regimes.
 Momentum Divergence Detection Algorithm 
The divergence detection system uses a mathematical comparison between price series and oscillator values over a specified lookback period. For bullish divergences, the algorithm identifies when recent_low < previous_low while simultaneously indicator_at_recent_low > indicator_at_previous_low. The inverse logic applies to bearish divergences. The system tracks both RSI (calculated using Pine Script's standard ta.rsi() function with Wilder's smoothing) and MACD (using ta.macd() with exponential moving averages). The mathematical rigor ensures that divergences are only flagged when there's a clear mathematical relationship between price momentum and the underlying oscillator momentum, eliminating false signals from minor price fluctuations.
 Volume Analysis Mathematical Framework 
The volume analysis component uses multiple mathematical transformations to assess market participation. The Cumulative Volume Delta (CVD) is calculated as ∑(buying_volume - selling_volume) where buying_volume occurs when close > open and selling_volume when close < open. The relative volume calculation uses current_volume / ta.sma(volume, period) to normalize current activity against historical averages. Volume Rate of Change employs ta.roc(volume, period) = (current_volume - volume ) / volume  * 100 to measure volume acceleration. Large trade detection uses a threshold multiplier against the volume moving average, mathematically identifying institutional activity when relative_volume > threshold_multiplier.
 Advanced Price Action Mathematics 
The Wyckoff analysis component uses mathematical volume climax detection by comparing current volume against ta.highest(volume, 50) * 0.8, while price compression is measured using (high - low) < ta.atr(20) * 0.5. Liquidity sweep detection employs percentage-based calculations: bullish sweeps occur when low < recent_low * (1 - threshold_percentage/100) followed by close > recent_low. Supply and demand zones are mathematically validated by tracking subsequent price action over a defined period, with zone strength calculated as the count of bars where price respects the zone boundaries. Fair value gaps are identified using ATR-based thresholds: gap_size > ta.atr(14) * 0.5.
 Sentiment and Market Regime Mathematics 
The sentiment analysis employs a multi-factor mathematical model. The fear/greed index uses volatility normalization: 100 - min(100, stdev(price_changes, period) * scaling_factor). Market regime classification uses EMA crossover mathematics with additional ADX-based trend strength validation. The trend strength calculation implements a modified ADX algorithm: DX = |+DI - -DI| / (+DI + -DI) * 100, then ADX = RMA(DX, period). Bull regime requires short_EMA > long_EMA AND ADX > 25 AND +DI > -DI. The mathematical framework ensures objective regime classification without subjective interpretation.
 Confluence Scoring Mathematical Model 
The confluence scoring system uses a weighted linear combination: Score = (divergence_component * 0.25) + (volume_component * 0.25) + (price_action_component * 0.25) + (sentiment_component * 0.25) + contextual_bonuses. Each component is normalized to a 0-100 scale using percentile rankings and threshold comparisons. The mathematical model ensures that no single component can dominate the score, while contextual bonuses (regime alignment, volume confirmation, etc.) provide additional mathematical weight when multiple factors align. The final score is bounded using math.min(100, math.max(0, calculated_score)) to maintain mathematical consistency.
 Vitality Field Mathematical Implementation 
The vitality field uses a multi-factor scoring algorithm that combines trend direction (EMA crossover: trend_score = fast_EMA > slow_EMA ? 1 : -1), momentum (RSI-based: momentum_score = RSI > 50 ? 1 : -1), MACD position (macd_score = MACD_line > 0 ? 1 : -1), and volume confirmation. The final vitality score uses weighted mathematics: vitality_score = (trend * 0.4) + (momentum * 0.3) + (macd * 0.2) + (volume * 0.1). The field boundaries are calculated using ATR-based dynamic ranges: upper_boundary = price_center + (ATR * user_defined_multiplier), with EMA smoothing applied to prevent erratic boundary movements. The gradient effect uses mathematical transparency interpolation across multiple zones.
 Signal Generation Mathematical Logic 
The signal generation employs boolean algebra with multiple mathematical conditions that must simultaneously evaluate to true. Buy signals require: (confluence_score ≥ threshold) AND (divergence_detected = true) AND (relative_volume > 1.5) AND (volume_ROC > 25%) AND (RSI < 35) AND (trend_strength > minimum_ADX) AND (regime = bullish) AND (cooldown_expired = true) AND (last_signal ≠ buy). The mathematical precision ensures that signals only generate when all quantitative conditions are met, eliminating subjective interpretation. The cooldown mechanism uses bar counting mathematics: bars_since_last_signal = current_bar_index - last_signal_bar_index ≥ cooldown_period. This mathematical framework provides objective, repeatable signal generation that can be backtested and validated statistically.
This mathematical foundation ensures the indicator operates on objective, quantifiable principles rather than subjective interpretation, making it suitable for algorithmic trading and systematic analysis while maintaining transparency in its computational methodology.
* for now, we're planning to keep the source code private as we try to improve the models used here and allow a small group to test them. My goal is to eventually use the multiple models in this indicator as their own free and open source indicators. If you'd like to use this indicator, please send me a message to get access.
 Advanced Confluence Scoring System 
Each support and resistance level receives a comprehensive confluence score (0-100) based on four weighted components:
 Momentum Divergences (25% weight) 
 
 RSI and MACD divergence detection
 Identifies momentum shifts before price reversals
 Bullish/bearish divergence confirmation
 
 Volume Analysis (25% weight) 
 
 Cumulative Volume Delta (CVD) analysis
 Volume Rate of Change monitoring
 Large trade detection (institutional activity)
 Volume profile strength assessment
 
Advanced Price Action (25% weight)
 
 Supply and demand zone identification
 Liquidity sweep detection (stop hunts)
 Wyckoff accumulation/distribution patterns
 Fair value gap analysis
 
Market Sentiment (25% weight)
 
 Fear/Greed index calculation
 Market regime classification (Bull/Bear/Sideways)
 Trend strength measurement (ADX-like)
 Momentum regime alignment
 
 Dynamic Support and Resistance Detection 
The indicator uses an adaptive algorithm to identify significant support and resistance levels based on recent market highs and lows. Unlike static levels, these zones adjust dynamically to market volatility using the Average True Range (ATR), ensuring the levels remain relevant across different market conditions.
 Vitality Field Background 
The indicator features a unique vitality field that provides instant visual feedback about market sentiment:
 
 Green zones: Bullish market conditions with strong momentum
 Red zones: Bearish market conditions with weak momentum
 Gray zones: Neutral/sideways market conditions
 
The vitality field uses a sophisticated gradient system that fades from the center outward, creating a clean, professional appearance that doesn't overwhelm the chart while providing valuable context.
 Buy Signals (🚀 BUY) 
Buy signals are generated when ALL of the following conditions are met:
 
 Valid support level with confluence score ≥ 80
 Bullish momentum divergence detected (RSI or MACD)
 Volume confirmation (1.5x average volume + 25% volume ROC)
 Bull market regime environment
 RSI below 35 (oversold conditions)
 Price action confirmation (Wyckoff accumulation, liquidity sweep, or large buying volume)
 Minimum trend strength (ADX > 25)
 Signal alternation check (prevents consecutive buy signals)
 Cooldown period expired (default 10 bars)
 
 Sell Signals (🔻 SELL) 
Sell signals are generated when ALL of the following conditions are met:
 
 Valid resistance level with confluence score ≥ 80
 Bearish momentum divergence detected (RSI or MACD)
 Volume confirmation (1.5x average volume + 25% volume ROC)
 Bear market regime environment
 RSI above 65 (overbought conditions)
 Price action confirmation (Wyckoff distribution, liquidity sweep, or large selling volume)
 Minimum trend strength (ADX > 25)
 Signal alternation check (prevents consecutive sell signals)
 Cooldown period expired (default 10 bars)
 
 How to Use the Indicator 
 1. Signal Quality Assessment 
Monitor the confluence scores in the information table:
 
 Score 90-100: Exceptional quality levels (A+ grade)
 Score 80-89: High quality levels (A grade)
 Score 70-79: Good quality levels (B grade)
 Score below 70: Weak levels (filtered out by default)
 
 2. Market Context Analysis 
Use the vitality field and market regime information to understand the broader market context:
 
 Trade buy signals in green vitality zones during bull regimes
 Trade sell signals in red vitality zones during bear regimes
 Exercise caution in gray zones (sideways markets)
 
 3. Entry and Exit Strategy 
For Buy Signals:
 
 Enter long positions when premium buy signals appear
 Place stop loss below the support confluence zone
 Target the next resistance level or use a risk/reward ratio of 2:1 or higher
 
For Sell Signals:
 
 Enter short positions when premium sell signals appear
 Place stop loss above the resistance confluence zone
 Target the next support level or use a risk/reward ratio of 2:1 or higher
 
 4. Risk Management 
 
 Only trade signals with confluence scores above 80
 Respect the signal alternation system (no overtrading)
 Use appropriate position sizing based on signal quality
 Consider the overall market regime before taking trades
 
 Customizable Settings 
Signal Generation Controls
 
 Signal Filtering: Enable/disable advanced filtering
 Confluence Threshold: Adjust minimum score requirement (70-95)
 Cooldown Period: Set bars between signals (5-50)
 Volume/Momentum Requirements: Toggle confirmation requirements
 Trend Strength: Minimum ADX requirement (15-40)
 
Vitality Field Options
 
 Enable/Disable: Control background field display
 Transparency Settings: Adjust opacity for center and edges
 Field Size: Control the field boundaries (3.0-20.0)
 Color Customization: Set custom colors for bullish/bearish/neutral states
 
Weight Adjustments
 
 Divergence Weight: Adjust momentum component influence (10-40%)
 Volume Weight: Adjust volume component influence (10-40%)
 Price Action Weight: Adjust price action component influence (10-40%)
 Sentiment Weight: Adjust sentiment component influence (10-40%)
 
Best Practices
 
 Always wait for complete signal confirmation before entering trades
 Use higher timeframes for signal validation and context
 Combine with proper risk management and position sizing
 Monitor the information table for real-time market analysis
 Pay attention to volume confirmation for higher probability trades
 Respect market regime alignment for optimal results
 
 Basic Settings 
Base Length (Default: 25)
 
 Controls the lookback period for identifying support and resistance levels
 Range: 5-100 bars
 Lower values = More responsive, shorter-term levels
 Higher values = More stable, longer-term levels
 Recommendation: 25 for intraday, 50 for swing trading
 
Enable Adaptive Length (Default: True)
 
 Automatically adjusts the base length based on market volatility
 When enabled, length increases in volatile markets and decreases in calm markets
 Helps maintain relevant levels across different market conditions
 
Volatility Factor (Default: 1.5)
 
 Controls how much the adaptive length responds to volatility changes
 Range: 0.5-3.0
 Higher values = More aggressive length adjustments
 Lower values = More conservative length adjustments
 
Volume Profile Settings
VWAP Length (Default: 200)
 
 Sets the calculation period for the Volume Weighted Average Price
 Range: 50-500 bars
 Shorter periods = More responsive to recent price action
 Longer periods = More stable reference line
 Used for volume profile analysis and confluence scoring
 
Volume MA Length (Default: 50)
 
 Period for calculating the volume moving average baseline
 Range: 10-200 bars
 Used to determine relative volume (current volume vs. average)
 Shorter periods = More sensitive to volume changes
 Longer periods = More stable volume baseline
 
 
High Volume Node Threshold (Default: 1.5)
 
 Multiplier for identifying significant volume spikes
 Range: 1.0-3.0
 Values above this threshold mark high-volume nodes with diamond shapes
 Lower values = More frequent high-volume signals
 Higher values = Only extreme volume events marked
 
Momentum Divergence Settings
Enable Divergence Detection (Default: True)
 
 Master switch for momentum divergence analysis
 When disabled, removes divergence from confluence scoring
 Significantly impacts signal generation quality
 
RSI Length (Default: 14)
 
 Period for RSI calculation used in divergence detection
 Range: 5-50
 Standard RSI settings apply (14 is most common)
 Shorter periods = More sensitive, more signals
 Longer periods = Smoother, fewer but more reliable signals
 
MACD Settings
 
 Fast (Default: 12): Fast EMA period for MACD calculation (5-50)
 Slow (Default: 26): Slow EMA period for MACD calculation (10-100)
 Signal (Default: 9): Signal line EMA period (3-20)
 Standard MACD settings for divergence detection
 
Divergence Lookback (Default: 5)
 
 Number of bars to look back when detecting divergences
 Range: 3-20
 Shorter periods = More frequent divergence signals
 Longer periods = More significant divergence signals
 
Volume Analysis Enhancement Settings
Enable Advanced Volume Analysis (Default: True)
 
 Master control for sophisticated volume calculations
 Includes CVD, volume ROC, and large trade detection
 Critical for signal accuracy
 
Cumulative Volume Delta Length (Default: 20)
 
 Period for CVD smoothing calculation
 Range: 10-100
 Tracks buying vs. selling pressure over time
 Shorter periods = More reactive to recent flows
 Longer periods = Broader trend perspective
 
Volume ROC Length (Default: 10)
 
 Period for Volume Rate of Change calculation
 Range: 5-50
 Measures volume acceleration/deceleration
 Key component in volume confirmation requirements
 
Large Trade Volume Threshold (Default: 2.0)
 
 Multiplier for identifying institutional-size trades
 Range: 1.5-5.0
 Trades above this threshold marked as large trades
 Lower values = More frequent large trade signals
 Higher values = Only extreme institutional activity
 
Advanced Price Action Settings
Enable Wyckoff Analysis (Default: True)
 
 Activates simplified Wyckoff accumulation/distribution detection
 Identifies potential smart money positioning
 Important for high-quality signal generation
 
Enable Supply/Demand Zones (Default: True)
 
 Identifies fresh supply and demand zones
 Tracks zone strength based on subsequent price action
 Enhances confluence scoring accuracy
 
Enable Liquidity Analysis (Default: True)
 
 Detects liquidity sweeps and stop hunts
 Identifies fake breakouts vs. genuine moves
 Critical for avoiding false signals
 
Zone Strength Period (Default: 20)
 
 Bars used to assess supply/demand zone strength
 Range: 10-50
 Longer periods = More thorough zone validation
 Shorter periods = Faster zone assessment
 
Liquidity Sweep Threshold (Default: 0.5%)
 
 Percentage move required to confirm liquidity sweep
 Range: 0.1-2.0%
 Lower values = More sensitive sweep detection
 Higher values = Only significant sweeps detected
 
Sentiment and Flow Settings
Enable Sentiment Analysis (Default: True)
 
 Master control for market sentiment calculations
 Includes fear/greed index and regime classification
 Important for market context assessment
 
Fear/Greed Period (Default: 20)
 
 Calculation period for market sentiment indicator
 Range: 10-50
 Based on price volatility and momentum
 Shorter periods = More reactive sentiment readings
 
 
Momentum Regime Length (Default: 50)
 
 Period for determining overall market regime
 Range: 20-100
 Classifies market as Bull/Bear/Sideways
 Longer periods = More stable regime classification
 
Trend Strength Length (Default: 30)
 
 Period for ADX-like trend strength calculation
 Range: 10-100
 Measures directional momentum intensity
 Used in signal filtering requirements
 
Advanced Signal Generation Settings
Enable Signal Filtering (Default: True)
 
 Master control for premium signal generation system
 When disabled, uses basic signal conditions
 Highly recommended to keep enabled
 
Minimum Signal Confluence Score (Default: 80)
 
 Required confluence score for signal generation
 Range: 70-95
 Higher values = Fewer but higher quality signals
 Lower values = More frequent but potentially lower quality signals
 
Signal Cooldown (Default: 10 bars)
 
 Minimum bars between signals of same type
 Range: 5-50
 Prevents signal spam and overtrading
 Higher values = More conservative signal spacing
 
Require Volume Confirmation (Default: True)
 
 Mandates volume requirements for signal generation
 Requires 1.5x average volume + 25% volume ROC
 Critical for signal quality
 
 
Require Momentum Confirmation (Default: True)
 
 Mandates divergence detection for signals
 Ensures momentum backing for directional moves
 Essential for high-probability setups
 
Minimum Trend Strength (Default: 25)
 
 Required ADX level for signal generation
 Range: 15-40
 Ensures signals occur in trending markets
 Higher values = Only strong trending conditions
 
Confluence Scoring Settings
 
 Minimum Confluence Score (Default: 70)
 Threshold for displaying support/resistance levels
 Range: 50-90
 Levels below this score are filtered out
 Higher values = Only strongest levels shown
 
Component Weights (Default: 25% each)
 
 Divergence Weight: Momentum component influence (10-40%)
 Volume Weight: Volume analysis influence (10-40%)
 Price Action Weight: Price patterns influence (10-40%)
 Sentiment Weight: Market sentiment influence (10-40%)
 Must total 100% for balanced scoring
 
Vitality Field Settings
Enable Vitality Field (Default: True)
 
 Controls the background gradient field display
 Provides instant visual market sentiment feedback
 Enhances chart readability and context
 
Vitality Center Transparency (Default: 85%)
 
 Opacity at the center of the vitality field
 Range: 70-95%
 Lower values = More opaque center
 Higher values = More transparent center
 
Vitality Edge Transparency (Default: 98%)
 
 Opacity at the edges of the vitality field
 Range: 95-99%
 Creates smooth fade effect from center to edges
 Higher values = More subtle edge appearance
 
Vitality Field Size (Default: 8.0)
 
 Controls the overall size of the vitality field
 Range: 3.0-20.0
 Based on ATR multiples for dynamic sizing
 Lower values = Tighter field around price
 Higher values = Broader field coverage
 
 Recommended Settings by Trading Style 
 Scalping (1-5 minutes) 
 
 Base Length: 15
 Volume MA Length: 20
 Signal Cooldown: 5 bars
 Vitality Field Size: 5.0
 Higher sensitivity for quick moves
 
 Day Trading (15-60 minutes) 
 
 Base Length: 25 (default)
 Volume MA Length: 50 (default)
 Signal Cooldown: 10 bars (default)
 Vitality Field Size: 8.0 (default)
 Balanced settings for intraday moves
 
Swing Trading (4H-Daily)
 
 Base Length: 50
 Volume MA Length: 100
 Signal Cooldown: 20 bars
 Vitality Field Size: 12.0
 Longer-term perspective for multi-day moves
 
Conservative Trading
 
 Minimum Signal Confluence: 85
 Minimum Confluence Score: 80
 Require all confirmations: True
 Higher thresholds for maximum quality
 
Aggressive Trading
 
 Minimum Signal Confluence: 75
 Minimum Confluence Score: 65
 Signal Cooldown: 5 bars
 Lower thresholds for more opportunities
RSI with 2-Pole FilterA momentum indicator that tells you if a stock is overbought or oversold.
RSI goes between 0 and 100.
70 = overbought (might fall)
<30 = oversold (might rise)
It often looks jagged or choppy on volatile days.
Think of this filter like a momentum smoother:
It still follows RSI closely,
But it doesn’t react to every little jiggle in price,
Which helps avoid false signals.
it keeps track of:
The current RSI,
The last 2 RSI values (inputs), and
The last 2 outputs (filtered RSIs).
It uses feedback to shape the output based on previous values, making it smoother than a simple moving average.
Info TableOverview
The Info Table V1 is a versatile TradingView indicator tailored for intraday futures traders, particularly those focusing on MESM2 (Micro E-mini S&P 500 futures) on 1-minute charts. It presents essential market insights through two customizable tables: the Main Table for predictive and macro metrics, and the New Metrics Table for momentum and volatility indicators. Designed for high-activity sessions like 9:30 AM–11:00 AM CDT, this tool helps traders assess price alignment, sentiment, and risk in real-time. Metrics update dynamically (except weekly COT data), with optional alerts for key conditions like volatility spikes or momentum shifts.
This indicator builds on foundational concepts like linear regression for predictions and adapts open-source elements for enhanced functionality. Gradient code is adapted from TradingView's Color Library. QQE logic is adapted from LuxAlgo's QQE Weighted Oscillator, licensed under CC BY-NC-SA 4.0. The script is released under the Mozilla Public License 2.0.
Key Features
Two Customizable Tables: Positioned independently (e.g., top-right for Main, bottom-right for New Metrics) with toggle options to show/hide for a clutter-free chart.
Gradient Coloring: User-defined high/low colors (default green/red) for quick visual interpretation of extremes, such as overbought/oversold or high volatility.
Arrows for Directional Bias: In the New Metrics Table, up (↑) or down (↓) arrows appear in value cells based on metric thresholds (top/bottom 25% of range), indicating bullish/high or bearish/low conditions.
Consensus Highlighting: The New Metrics Table's title cells ("Metric" and "Value") turn green if all arrows are ↑ (strong bullish consensus), red if all are ↓ (strong bearish consensus), or gray otherwise.
Predicted Price Plot: Optional line (default blue) overlaying the ML-predicted price for visual comparison with actual price action.
Alerts: Notifications for high/low Frahm Volatility (≥8 or ≤3) and QQE Bias crosses (bullish/bearish momentum shifts).
Main Table Metrics
This table focuses on predictive, positional, and macro insights:
ML-Predicted Price: A linear regression forecast using normalized price, volume, and RSI over a customizable lookback (default 500 bars). Gradient scales from low (red) to high (green) relative to the current price ± threshold (default 100 points).
Deviation %: Percentage difference between current price and predicted price. Gradient highlights extremes (±0.5% default threshold), signaling potential overextensions.
VWAP Deviation %: Percentage difference from Volume Weighted Average Price (VWAP). Gradient indicates if price is above (green) or below (red) fair value (±0.5% default).
FRED UNRATE % Change: Percentage change in U.S. unemployment rate (via FRED data). Cell turns red for increases (economic weakness), green for decreases (strength), gray if zero or disabled.
Open Interest: Total open MESM2 futures contracts. Gradient scales from low (red) to high (green) up to a hardcoded 300,000 threshold, reflecting market participation.
COT Commercial Long/Short: Weekly Commitment of Traders data for commercial positions. Long cell green if longs > shorts (bullish institutional sentiment); Short cell red if shorts > longs (bearish); gray otherwise.
New Metrics Table Metrics
This table emphasizes technical momentum and volatility, with arrows for quick bias assessment:
QQE Bias: Smoothed RSI vs. trailing stop (default length 14, factor 4.236, smooth 5). Green for bullish (RSI > stop, ↑ arrow), red for bearish (RSI < stop, ↓ arrow), gray for neutral.
RSI: Relative Strength Index (default period 14). Gradient from oversold (red, <30 + threshold offset, ↓ arrow if ≤40) to overbought (green, >70 - offset, ↑ arrow if ≥60).
ATR Volatility: Score (1–20) based on Average True Range (default period 14, lookback 50). High scores (green, ↑ if ≥15) signal swings; low (red, ↓ if ≤5) indicate calm.
ADX Trend: Average Directional Index (default period 14). Gradient from weak (red, ↓ if ≤0.25×25 threshold) to strong trends (green, ↑ if ≥0.75×25).
Volume Momentum: Score (1–20) comparing current to historical volume (lookback 50). High (green, ↑ if ≥15) suggests pressure; low (red, ↓ if ≤5) implies weakness.
Frahm Volatility: Score (1–20) from true range over a window (default 24 hours, multiplier 9). Dynamic gradient (green/red/yellow); ↑ if ≥7.5, ↓ if ≤2.5.
Frahm Avg Candle (Ticks): Average candle size in ticks over the window. Blue gradient (or dynamic green/red/yellow); ↑ if ≥0.75 percentile, ↓ if ≤0.25.
Arrows trigger on metric-specific logic (e.g., RSI ≥60 for ↑), providing directional cues without strict color ties.
Customization Options
Adapt the indicator to your strategy:
ML Inputs: Lookback (10–5000 bars) and RSI period (2+) for prediction sensitivity—shorter for volatility, longer for trends.
Timeframes: Individual per metric (e.g., 1H for QQE Bias to match higher frames; blank for chart timeframe).
Thresholds: Adjust gradients and arrows (e.g., Deviation 0.1–5%, ADX 0–100, RSI overbought/oversold).
QQE Settings: Length, factor, and smooth for fine-tuned momentum.
Data Toggles: Enable/disable FRED, Open Interest, COT for focus (e.g., disable macro for pure intraday).
Frahm Options: Window hours (1+), scale multiplier (1–10), dynamic colors for avg candle.
Plot/Table: Line color, positions, gradients, and visibility.
Ideal Use Case
Perfect for MESM2 scalpers and trend traders. Use the Main Table for entry confirmation via predicted deviations and institutional positioning. Leverage the New Metrics Table arrows for short-term signals—enter bullish on green consensus (all ↑), avoid chop on low volatility. Set alerts to catch shifts without constant monitoring.
Why It's Valuable
Info Table V1 consolidates diverse metrics into actionable visuals, answering critical questions: Is price mispriced? Is momentum aligning? Is volatility manageable? With real-time updates, consensus highlights, and extensive customization, it enhances precision in fast markets, reducing guesswork for confident trades.
Note: Optimized for futures; some metrics (OI, COT) unavailable on non-futures symbols. Test on demo accounts. No financial advice—use at your own risk.
The provided script reuses open-source elements from TradingView's Color Library and LuxAlgo's QQE Weighted Oscillator, as noted in the script comments and description. Credits are appropriately given in both the description and code comments, satisfying the requirement for attribution.
Regarding significant improvements and proportion:
The QQE logic comprises approximately 15 lines of code in a script exceeding 400 lines, representing a small proportion (<5%).
Adaptations include integration with multi-timeframe support via request.security, user-customizable inputs for length, factor, and smooth, and application within a broader table-based indicator for momentum bias display (with color gradients, arrows, and alerts). This extends the original QQE beyond standalone oscillator use, incorporating it as one of seven metrics in the New Metrics Table for confluence analysis (e.g., consensus highlighting when all metrics align). These are functional enhancements, not mere stylistic or variable changes.
The Color Library usage is via official import (import TradingView/Color/1 as Color), leveraging built-in gradient functions without copying code, and applied to enhance visual interpretation across multiple metrics.
The script complies with the rules: reused code is minimal, significantly improved through integration and expansion, and properly credited. It qualifies for open-source publication under the Mozilla Public License 2.0, as stated.
BitDoctor Risk Appetite DashboardBitDoctor Risk Appetite Dashboard 
The BitDoctor Risk Appetite Dashboard is a powerful tool for gauging market sentiment and risk appetite across major asset classes. It combines equity, credit, emerging markets, interest rates, and crypto signals into a single dashboard, giving traders a clear view of current market dynamics.
 What it does: 
- Calculates momentum for each key asset using a 14-day rate of change.
- Normalizes each signal and plots a composite Risk Appetite Strength Index (RASI) on the chart.
- Displays a dashboard table showing the momentum of each component in percentage terms alongside the composite RASI.
 How to use it: 
The plotted  RASI line  shows overall risk appetite:
- Positive readings suggest a stronger risk-on environment.
- Negative readings indicate risk-off sentiment.
The  dashboard table  (top-right corner by default) displays two columns:
-  Asset : The tracked asset symbol.
-  Momentum : The current 14-day rate of change as a percentage.
 Interpreting the table: 
Each row represents a component of market risk sentiment:
-  SPY : US equities.
-  HYG : High yield bonds (credit risk appetite).
-  EEM : Emerging markets.
-  1/UST10Y : Inverted 10-year Treasury yield (lower yields support risk appetite).
-  ETH : Ethereum (crypto risk proxy).
-  RASI : The average of the above signals, indicating overall market risk appetite.
Higher positive values in the table suggest rising momentum in that asset, which contributes positively to the composite RASI. Conversely, negative values signal declining momentum. You can use these individual readings to see which sectors are driving the current risk sentiment and to time entries and exits accordingly.
 Customization: 
The indicator allows you to adjust the table's background color, text color, text size, cell padding, and position so it remains readable and unobtrusive regardless of your chart theme.
Use the BitDoctor Risk Appetite Dashboard as part of a broader analysis to align your trades with prevailing risk conditions. It is not a standalone trading signal but a context tool to support better decision-making.
 Why these assets were chosen: 
The dashboard uses a carefully selected mix of widely-followed proxies for global risk sentiment:
-  SPY : Represents large-cap US equity market performance, a key barometer of investor confidence.
-  HYG : Tracks high-yield corporate bonds, reflecting credit risk appetite in fixed income markets.
-  EEM : Captures emerging market equities, which are highly sensitive to global risk-on/off dynamics.
-  1/UST10Y : The inverse of the US 10-year Treasury yield, as falling yields often accompany risk-on moves and vice versa.
-  ETH : Ethereum as a representative crypto asset, offering insight into speculative risk appetite in digital assets.
This mix provides a comprehensive view of sentiment across traditional and alternative markets, making the dashboard a robust tool for gauging overall risk appetite.
Fractal Pullback Market StructureFractal Pullback Market Structure 
 Author: The_Forex_Steward 
 License: Mozilla Public License 2.0 
The Fractal Pullback Market Structure indicator is a sophisticated price action tool designed to visualize internal structure shifts and break-of-structure (BoS) events with high accuracy. It leverages fractal pullback logic to identify market swing points and confirm whether a directional change has occurred.
This indicator detects swing highs and lows based on fractal behavior, drawing zigzag lines to connect these key pivot points. It classifies and labels each structural point as either a Higher High (HH), Higher Low (HL), Lower High (LH), or Lower Low (LL). Internal shifts are marked using triangle symbols on the chart, distinguishing bullish from bearish developments.
Break of Structure events are confirmed when price closes beyond the most recent swing high or low, and a horizontal line is drawn at the breakout level. This helps traders validate when a structural trend change is underway.
Users can configure the lookback period that defines the sensitivity of the pullback detection, as well as a timeframe multiplier to align the logic with higher timeframes such as 4H or Daily. There are visual customization settings for the zigzag lines and BoS markers, including color, width, and style (solid, dotted, or dashed).
Alerts are available for each key structural label—HH, HL, LH, LL—as well as for BoS events. These alerts are filtered through a selectable alert mode that separates signals by timeframe category: Low Timeframe (LTF), Medium Timeframe (MTF), and High Timeframe (HTF). Each mode allows the user to receive alerts only when relevant to their strategy.
This indicator excels in trend confirmation and reversal detection. Traders can use it to identify developing structure, validate internal shifts, and anticipate breakout continuation or rejection. It is particularly useful for Smart Money Concept (SMC) traders, swing traders, and those looking to refine entries and exits based on price structure rather than lagging indicators.
Visual clarity, adaptable timeframe logic, and precise structural event detection make this tool a valuable addition to any price action trader’s toolkit.
Economy RadarEconomy Radar — Key US Macro Indicators Visualized
A handy tool for traders and investors to monitor major US economic data in one chart.
Includes:
 
  Inflation: CPI, PCE, yearly %, expectations
  Monetary policy: Fed funds rate, M2 money supply
  Labor market: Unemployment, jobless claims, consumer sentiment
  Economy & markets: GDP, 10Y yield, US Dollar Index (DXY)
 
Options:
 
  Toggle indicators on/off
  Customizable colors
  Tooltips explain each metric (in Russian & English)
 
Perfect for spotting economic cycles and supporting trading decisions.
Add to your chart and get a clear macro picture instantly!
RISK ROTATION MATRIX ║ BullVision [3.0]🔍 Overview 
The Risk Rotation Matrix is a comprehensive market regime detection system that analyzes global market conditions across four critical domains: Liquidity, Macroeconomic, Crypto/Commodities, and Risk/Volatility. Through proprietary algorithms and advanced statistical analysis, it transforms 20+ diverse market metrics into a unified framework for identifying regime transitions and risk rotations.
This institutional-grade system aims to solve a fundamental challenge: how to synthesize complex, multi-domain market data into clear, actionable trading intelligence. By combining proprietary liquidity calculations with sophisticated cross-asset analysis.
 The Four-Domain Architecture 
 1. 💧 LIQUIDITY DOMAIN 
Our liquidity analysis combines standard metrics with proprietary calculations:
Proprietary Components:
 
 Custom Global Liquidity Index (GLI): Unique formula aggregating central bank assets, credit spreads, and FX dynamics through our weighted algorithm
 Federal Reserve Balance Proxy: Advanced calculation incorporating reverse repos, TGA fluctuations, and QE/QT impacts
 China Liquidity Proxy: First-of-its-kind metric combining PBOC operations with FX-adjusted aggregates
 Global M2 Composite: Custom multi-currency M2 aggregation with proprietary FX normalization
 
 2. 📈 MACRO DOMAIN 
Sophisticated integration of global economic indicators:
 
 S&P 500: Momentum and trend analysis with custom z-score normalization
 China Blue Chips: Asian market sentiment with correlation filtering
 MBA Purchase Index: Real estate market health indicator
 Emerging Markets (EEMS): Risk appetite measurement
 Global ETF (URTH): Worldwide equity exposure tracking
 
Each metric undergoes proprietary transformation to ensure comparability and regime-specific sensitivity.
 3. 🪙 CRYPTO/COMMODITIES DOMAIN 
Unique cross-asset analysis combining:
 
 Total Crypto Market Cap: Liquidity flow indicator with custom smoothing
 Bitcoin SOPR: On-chain profitability analysis with adaptive periods
 MVRV Z-Score: Advanced implementation with multiple MA options
 BTC/Silver Ratio: Novel commodity-crypto relationship metric
 
Our algorithms detect when crypto markets lead or lag traditional assets, providing crucial timing signals.
 4. ⚡ RISK/VOLATILITY DOMAIN 
Advanced volatility regime detection through:
 
 MOVE Index: Bond volatility with inverse correlation analysis
 VVIX/VIX Ratio: Volatility-of-volatility for regime extremes
 SKEW Index: Tail risk measurement with custom normalization
 Credit Stress Composite: Proprietary combination of credit spreads
 USDT Dominance: Crypto flight-to-safety indicator
 
All risk metrics are inverted and normalized to align with the unified scoring system.
  
 🧠 Advanced Integration Methodology 
 Multi-Stage Processing Pipeline 
 
 Data Collection: Real-time aggregation from 20+ sources
 Normalization: Custom z-score variants accounting for regime-specific volatility
 Domain Scoring: Proprietary weighting within each domain
 Cross-Domain Synthesis: Advanced correlation matrix between domains
 Regime Detection: State-transition model identifying four market phases
 Signal Generation: Composite score with adaptive smoothing
 
 🔁 Composite Smoothing & Signal Generation 
The user can apply smoothing (ALMA, EMA, etc.) to highlight trends and reduce noise. Smoothing length, type, and parameters are fully customizable for different trading styles.
  
 🎯 Color Feedback & Market Regimes 
Visual dynamics (color gradients, labels, trails, and quadrant placement) offer an at-a-glance interpretation of the market’s evolving risk environment—without forecasting or forward-looking assumptions.
  
 🎯 The Quadrant Visualization System 
Our innovative visual framework transforms complex calculations into intuitive intelligence:
 
 Dynamic Ehlers Loop: Shows current position and momentum
 Trailing History: Visual path of regime transitions
 Real-Time Animation: Immediate feedback on condition changes
 Multi-Layer Information: Depth through color, size, and positioning
 
  
 🚀 Practical Applications 
Primary Use Cases
 
 Multi-Asset Portfolio Management: Optimize allocation across asset classes based on regime
 Risk Budgeting: Adjust exposure dynamically with regime changes
 Tactical Trading: Time entries/exits using regime transitions
 Hedging Strategies: Implement protection before risk-off phases
 
Specific Trading Scenarios
 
 Domain Divergence: When liquidity improves but risk metrics deteriorate
 Early Rotation Detection: Crypto/commodity signals often lead broader markets
 Volatility Regime Trades: Position for mean reversion or trend following
 Cross-Asset Arbitrage: Exploit temporary dislocations between domains
 
 ⚙️ How It Works 
The Composite Score Engine
The system's intelligence emerges from how it combines domains:
 
 Each domain produces a normalized score (-2 to +2 range)
 Proprietary algorithms weight domains based on market conditions
 Composite score indicates overall market regime
 Smoothing options (ALMA, EMA, etc.) optimize for different timeframes
 
 Regime Classification 
 
 🟢 Risk-On (Green): Positive composite + positive momentum
 🟠 Weakening (Orange): Positive composite + negative momentum
 🔵 Recovery (Blue): Negative composite + positive momentum
 🔴 Risk-Off (Red): Negative composite + negative momentum
 
 Signal Interpretation Framework 
The indicator provides three levels of analysis:
 
 Composite Score: Overall market regime (-2 to +2)
 Domain Scores: Identify which factors drive regime
 Individual Metrics: Granular analysis of specific components
 
 🎨 Features & Functionality 
Core Components
 
 Risk Rotation Quadrant: Primary visual interface with Ehlers loop
 Data Matrix Dashboard: Real-time display of all 20+ metrics
 Domain Aggregation: Separate scores for each domain
 Composite Calculation: Unified score with multiple smoothing options
 
Customization Options
 
 Selective Metrics: Enable/disable individual components
 Period Adjustment: Optimize lookback for each metric
 Smoothing Selection: 10 different MA types including ALMA
 Visual Configuration: Quadrant scale, colors, trails, effects
 
Advanced Settings
 
 Pre-smoothing: Reduce noise before final calculation
 Adaptive Periods: Automatic adjustment during volatility
 Correlation Filters: Remove redundant signals
 Regime Memory: Hysteresis to prevent whipsaws
 
 📋 Implementation Guide 
Setup Process
 
 Add to chart (optimized for daily, works on all timeframes)
 Review default settings for your market focus
 Adjust domain weights based on trading style
 Configure visual preferences
 
Optimization by Trading Style
 
 Position Trading: Longer periods (60-150), heavy smoothing
 Swing Trading: Medium periods (20-60), balanced smoothing
 Active Trading: Shorter periods (10-40), minimal smoothing
 
Best Practices
 
 Monitor domain divergences for early signals
 Use extreme readings (-1.5/+1.5) for high-conviction trades
 Combine with price action for confirmation
 Adjust parameters during major events (FOMC, earnings)
 
 💎 What Makes This Unique 
Beyond Traditional Indicators
 
 Multi-Domain Integration: Only system combining liquidity, macro, crypto, and volatility
 Proprietary Calculations: Custom formulas for GLI, Fed, China, and M2 proxies
 Adaptive Architecture: Dynamically adjusts to market regimes
 Institutional Depth: 20+ integrated metrics vs typical 3-5
 
Technical Innovation
 
 Statistical Normalization: Custom z-score variants for cross-asset comparison
 Correlation Management: Prevents double-counting related signals
 Regime Persistence: Algorithms to identify sustainable vs temporary shifts
 Visual Intelligence: Information-dense display without overwhelming
 
 
 🔢 Performance Characteristics 
Strengths
 
 Early regime detection (typically 1-3 weeks ahead)
 Robust across different market environments
 Clear visual feedback reduces interpretation errors
 Comprehensive coverage prevents blind spots
 
 
Optimal Conditions
 
 Most effective with 100+ bars of history
 Best on daily timeframe (4H minimum recommended)
 Requires liquid markets for accurate signals
 Performance improves with more enabled components
 
 ⚠️ Risk Considerations & Limitations 
Important Disclaimers
 
 Probabilistic system, not predictive
 Requires understanding of macro relationships
 Signals should complement other analysis
 Past regime behavior doesn't guarantee future patterns
 
 
Known Limitations
 
 Black swan events may cause temporary distortions
 Central bank interventions can override signals
 Requires active management during regime transitions
 Not suitable for pure technical traders
 
 💎 Conclusion 
The Risk Rotation Matrix represents a new paradigm in market regime analysis. By combining proprietary liquidity calculations with comprehensive multi-domain monitoring, it provides institutional-grade intelligence previously available only to large funds. The system's strength lies not just in its individual components, but in how it synthesizes diverse market information into clear, actionable trading signals.
 ⚠️ Access & Intellectual Property Notice 
This invite-only indicator contains proprietary algorithms, custom calculations, and years of quantitative research. The mathematical formulations for our liquidity proxies, cross-domain correlation matrices, and regime detection algorithms represent significant intellectual property. Access is restricted to protect these innovations and maintain their effectiveness for serious traders who understand the value of comprehensive market regime analysis.
Monday Swing Box# Monday Swing Box Indicator - Trading Applications
This "Monday Swing Box" indicator can be very useful in trading for several strategic reasons:
## 1. **"Monday Effect" Analysis**
* **Concept**: Mondays often have particular characteristics in the markets (opening gaps, weekend catch-up, different volumes)
* **Utility**: Allows visualization and quantification of these Monday-specific movements
* **Application**: Helps identify recurring patterns in your strategy
## 2. **Relative Volatility Measurement with ATR**
* **The ATR percentage tells you**:
   * **< 50%**: Low volatility Monday (possible consolidation)
   * **50-100%**: Normal volatility
   * **> 100%**: Very volatile Monday (important event, potential breakout)
* **Advantage**: Contextualizes the movement relative to historical volatility
## 3. **Practical Trading Applications**
### **For Day Trading**:
* **Entry**: A Monday with >150% ATR may signal a strong movement to follow
* **Stop Loss**: Adjust stop sizes according to Monday's volatility
* **Targets**: Calibrate targets according to the movement's magnitude
### **For Swing Trading**:
* **Support/Resistance**: Monday's high/low often become key levels
* **Breakout**: Breaking above/below Monday's box may signal continuation
* **Retracement**: Return to Monday's box = support/resistance zone
### **For Risk Management**:
* **Sizing**: Adapt position sizes according to measured volatility
* **Timing**: Avoid trading abnormally volatile Mondays if you prefer stability
## 4. **Specific Possible Strategies**
### **"Monday Breakout"**:
* Wait for a break above/below Monday's box
* Enter in the direction of the breakout
* Stop at the other end of the box
### **"Monday Reversal"**:
* If Monday shows >200% ATR, look for a reversal
* The box becomes a resistance/support zone
### **"Monday Range"**:
* Trade bounces off the box limits
* Particularly effective if ATR % is normal (50-100%)
## 5. **Visualization Advantages**
* **Historical**: See past patterns across multiple Mondays
* **Comparison**: Compare current volatility to previous Mondays
* **Anticipation**: Prepare your strategy according to the type of Monday observed
## 6. **Limitations to Consider**
* Monday patterns can vary according to markets and periods
* Don't trade solely on this indicator, but use it as a complement
* Consider macroeconomic context and news
This indicator is therefore particularly useful for traders who want to exploit Monday's specificities and have an objective measure of this day's relative volatility compared to normal market conditions.
Intradayscanner – Institutional Interest (vs. RSP)This indicator measures volatility-adjusted Relative Residual Strength (RRS) of any symbol versus RSP (the Invesco S&P 500® Equal Weight ETF) to surface potential institutional interest overlooked by cap-weighted benchmarks.
Equal-weighted benchmark: Uses RSP instead of SPY, so each S&P 500 component carries equal influence—highlighting broad institutional flows beyond the largest names.
ATR normalization: Computes a “Divergence Index” by dividing RSP’s price move by its ATR(14), then adjusts the symbol’s move by that index and rescales by its own ATR(14). This isolates true outperformance.
Residual focus: RRS represents the portion of a symbol’s move unexplained by broad-market action, making it easier to spot when institutions rotate into specific stocks.
Visualization: Plots RRS as green/red histogram bars and overlays a 14-period EMA for trend smoothing.
Signalgo XSignalgo X
Signalgo X is a sophisticated indicator crafted for traders who demand a disciplined, multi-layered approach to market analysis and trade management. This overview will help you understand its capabilities, logic, and how it can elevate your trading.
Core Concept
Signalgo X is built to:
Scan multiple timeframes simultaneously for price, volume, and volatility patterns.
Filter out unreliable signals during periods of market hype or manipulation.
Automate trade management with dynamic take-profit (TP), stop-loss (SL), and trailing logic.
Deliver actionable, visual signals and alerts for timely, confident decisions.
Inputs & Controls
Preset System Parameters:
News Sensitivity: Determines how responsive the indicator is to price moves.
Hype Filter Strength: Sets how aggressively the system avoids volatile, manipulated, or news-driven periods.
User-Configurable:
Show TP/SL Logic: Turn on/off the display of take-profit and stop-loss levels directly on your chart.
How Signalgo X Works
1. Multi-Timeframe Market Analysis
Signalgo X continuously monitors:
Closing price
Trading volume
Volatility (ATR)
across six distinct timeframes, from 1 hour to 3 months. This layered approach ensures that signals are validated by both short-term momentum and long-term trends.
2. Price, Volume, and Volatility Synthesis
Price Change: The system tracks percentage changes over each timeframe to gauge momentum.
Volume Ratio: By comparing current volume to a moving average, it detects unusual spikes that may signal institutional activity or manipulation.
Volatility: Measures the intensity of price movements relative to average ranges, helping to identify breakout or exhaustion scenarios.
3. Proprietary Anti-Hype Filter
A unique scoring mechanism evaluates:
Volume spikes without corresponding price action
Sudden jumps in volatility
Conflicting signals across timeframes
Social hype proxies (e.g., sharp moves on low volume)
If the market is deemed “hyped,” all trading signals are suppressed and a clear warning is shown, keeping you out of unpredictable conditions.
4. Signal Classification & Mapping
Significant Moves: Only price actions that exceed a sensitivity threshold and are confirmed by volume/volatility are considered.
Bullish/Bearish Signals: Generated for each timeframe.
  
Signal Strength: Categorized as regular, or strong based on multi-timeframe agreement.
  
Entry & Exit Strategy
Entry Logic
Long (Buy) Entry: Triggered when bullish signals are detected (of any strength) and no hype is present.
Short (Sell) Entry: Triggered when bearish signals are detected and no hype is present.
Exit & Trade Management
  
Stop Loss (SL): Placed at a calculated distance from entry, adapting to recent volatility.
Take Profits (TP1, TP2, TP3): Three profit targets, each at a greater reward multiple.
Trailing Stop: After the first take-profit is hit, the stop-loss moves to breakeven and a trailing stop is activated to protect further gains.
Event Tracking: The indicator visually marks when each TP or SL is hit, providing real-time feedback.
Chart Plots: All relevant SL, TP, and trailing stop levels are clearly marked for both long and short trades.
Labels: Entry, exit, and signal strength events are color-coded and visually prominent.
  
Alerts: Built-in alert conditions allow you to set up TradingView notifications for strong/regular buy/sell signals and hype warnings.
Trading Strategy Application
Multi-Timeframe Confirmation: Only strong signals confirmed by several timeframes are acted upon, reducing false positives.
Volume & Volatility Awareness: The indicator avoids low-quality, “fakeout” signals by requiring confirmation from both price and volume/volatility.
Hype Avoidance: Keeps you out of the market during news-driven or manipulated periods, helping to protect your capital.
Automated Discipline: The TP/SL logic enforces a rules-based exit strategy, helping you lock in profits and limit losses without emotional interference.
Who Should Use Signalgo X?
Signalgo X is ideal for traders who want:
Systematic, high-confidence signals
Automated and disciplined trade management
Protection against unpredictable market events
Clear, actionable visuals and alerts
AD Line of S&P SectorsAdvance-Decline Line of S&P 500 Sectors
This indicator tracks the breadth strength of the S&P 500 by combining an unweighted Advance-Decline (A/D) Line and a market-cap weighted A/D Histogram across all 11 major S&P sectors.
Key Features
Sector A/D Histogram: Measures sector breadth based on whether each sector advanced or declined, then weights it by its current estimated market cap share.
Unweighted A/D Line: Smooth average of sectors equally weighted, giving an alternative breadth view that’s less biased by large sectors.
Top Weighted Stocks Tracker: Tracks the daily percentage change of the top 10 highest-weighted S&P 500 stocks, scaled by their index weights, and overlays them as a background area plot.
Zero Crossovers: Histogram and line crossing zero can help highlight broadening strength or weakness.
Customizable Sector Weights: Sector weights can be adjusted in the settings. It is recommended to review and update these periodically to reflect changes in S&P sector allocations.
Repaint Option: Uses a user-selectable repaint mode for flexible bar update logic.
How to Use
Trend Confirmation: When the weighted histogram and unweighted line are above zero together, it indicates broad sector strength; below zero suggests broad weakness.
Neutral Zone: Values between +0.5 and -0.5 (or your custom thresholds) may imply a ranging market or slower movement.
Top Names Context: The top-weighted stocks area shows how much the index’s largest components are pulling the market up or down, relative to the broader sector breadth.
⚠️ Disclaimer
This script is for educational and informational purposes only and does not constitute financial advice. Always do your own research and consult with a qualified financial professional before making trading decisions. Use at your own risk.
Delta Spike Detector [GSK-VIZAG-AP-INDIA]📌 Delta Spike Detector – Volume Imbalance Ratio
By GSK-VIZAG-AP-INDIA
📘 Overview
This indicator highlights aggressive buying or selling activity by analyzing the imbalance between estimated Buy and Sell volume per candle. It flags moments when one side dominates the other significantly — defined by user-selectable volume ratio thresholds (10x, 15x, 20x, 25x).
📊 How It Works
Buy/Sell Volume Estimation
Approximates buyer and seller participation using candle structure:
Buy Volume = Proximity of close to low
Sell Volume = Proximity of close to high
Delta & Delta Ratio
Delta = Buy Volume − Sell Volume
Delta Ratio = Ratio of dominant volume side to the weaker side
When this ratio exceeds a threshold, it’s classified as a spike.
Spike Labels
Labels are plotted on the chart:
10x B, 15x B, 20x B, 25x B → Buy Spike Labels (below candles)
10x S, 15x S, 20x S, 25x S → Sell Spike Labels (above candles)
The color of each label reflects the spike strength.
⚙️ User Inputs
Enable/Disable Buy or Sell Spikes
Set custom delta ratio thresholds (default: 10x, 15x, 20x, 25x)
🎯 Use Cases
Spotting sudden aggressive activity (e.g. smart money moves, traps, breakouts)
Identifying short-term market exhaustion or momentum bursts
Complementing other trend or volume-based tools
⚠️ Important Notes
The script uses approximated Buy/Sell Volume based on price position, not actual order flow.
This is not a buy/sell signal generator. It should be used in context with other confirmation indicators or market structure.
✍️ Credits
Developed by GSK-VIZAG-AP-INDIA
For educational and research use only.
Jags Dynamic S/R with Breakout & Weakness SignalsThis script is designed to automatically identify and display significant support and resistance levels on your chart. It then goes a step further by actively monitoring for potential breakouts and signs of support weakness.
Core Functionality: Identifying Key Levels
At its heart, the script uses a pivot logic to find recent price highs and lows, which it then plots as horizontal lines representing potential resistance and support, respectively. You have full control over how these levels are identified:
Timeframe: You can choose to find these pivot points on the current chart's timeframe or a higher one (e.g., daily pivots on an hourly chart).
Lookback Period: You can define how many bars to the left and right of a pivot point the script should consider, allowing you to fine-tune the significance of the levels it identifies.
Line Management: To keep your chart clean, you can set the maximum number of support and resistance lines to display. The script also has a clever "merge" feature that combines new pivot levels with existing ones if they are very close together, preventing clutter.
Breakout Detection
A key feature of this indicator is its ability to signal when the price breaks through one of these identified support or resistance levels. You can enable or disable this feature and choose from several confirmation methods to suit your trading style:
Simple Price Action: A breakout is confirmed simply by the price closing above a resistance level or below a support level.
ATR (Average True Range): For a breakout to be valid, the price must close a certain distance (based on the ATR) beyond the level, filtering out minor fluctuations.
Volume: This option adds another layer of confirmation by requiring a significant increase in trading volume during the breakout, suggesting strong conviction behind the move.
Momentum: This method uses the RSI (Relative Strength Index) to confirm that the breakout is supported by strong underlying momentum.
Quantitative: A more advanced option that uses a combination of the Rate of Change (ROC) and a Volume-Weighted Moving Average (VWMA) to provide a robust, multi-faceted confirmation of the breakout.
When a confirmed breakout occurs, the script will:
Color the breakout bar green for a bullish breakout (upward) or red for a bearish breakout (downward).
Place an arrow below a bullish breakout or above a bearish breakout.
Trigger an alert to notify you of the event.
Support Weakness Detection
To provide an early warning of a potential breakdown, the script includes a unique "Support Weakness Detection" feature. When enabled, it looks for a specific confluence of bearish signals as the price approaches a support level:
The price is hovering just above a key support level.
The short-term trend has already turned bearish (based on a moving average).
Momentum is fading (indicated by a falling RSI).
If all these conditions are met, a blue down-arrow will appear above the price bar, signalling that the nearby support may not hold.
Multi SMA AnalyzerMulti SMA Analyzer with Custom SMA Table & Advanced Session Logic
A feature-rich SMA analysis suite for traders, offering up to 7 configurable SMAs, in-depth trend detection, real-time table, and true session-aware calculations.
Ideal for those who want to combine intraday, swing, and higher-timeframe trend analysis with maximum chart flexibility.
Key Features
📊 Multi-SMA Overlay
- 7 SMAs (default: 5, 20, 50, 100, 200, 21, 34)—individually configurable (period, source, color, line style)
- Show/hide each SMA, custom line style (solid, stepline, circles), and color logic
- Dynamic color: full opacity above SMA, reduced when below
⏰ Session-Aware SMAs
- Each SMA can be calculated using only user-defined session hours/days/timezone
- “Ignore extended hours” option for accurate intraday trend
📋 Smart Data Table
- Live SMA values, % distance from price, and directional arrows (↑/↓/→)
- Bull/Bear/Sideways trend classification
- Custom table position, size, colors, transparency
- Table can run on chart or custom (higher) timeframe for multi-TF analysis
🎯 Golden/Death Cross Detection
- Flexible crossover engine: select any two from (5, 10, 20, 50, 100, 200) for fast/slow SMA cross signals
- Plots icons (★ Golden, 💀 Death), optional crossover labels with custom size/colors
🏷️ SMA Labels
- Optional on-chart SMA period labels
- Custom placement (above/below/on line), size, color, offset
🚨 Signal & Trend Engine
- Bull/Bear/Sideways logic: price vs. multiple SMAs (not just one pair)
- Volume spike detection (2x 20-period SMA)
- Bullish engulfing candlestick detection
- All signals can use chart or custom table timeframe
🎨 Visual Customization
- Dynamic background color (Bull: green, Bear: red, Neutral: gray)
- Every visual aspect is customizable: label/table colors, transparency, size, position
🔔 Built-in Alerts
- Crossovers (SMA20/50, Golden/Death)
- Bull trend, volume spikes, engulfing pattern—all alert-ready
How It Works
- Session Filtering:
 - SMAs can be set to count only bars from your chosen market session, for true intraday/trading-hour signals
Dynamic Table & Signals:
- Table and all signal logic run on your selected chart or custom timeframe
Flexible Crossover:
- Choose any pair (5, 10, 20, 50, 100, 200) for cross detection—SMA 10 is available for crossover even if not shown as an SMA line
Everything is modular:
- Toggle features, set visuals, and alerts to your workflow
🚨 How to Use Alerts 
- All key signals (crossovers, trend shifts, volume spikes, engulfing patterns) are available as alert conditions.
To enable:
- Click the “Alerts” (clock) icon at the top of TradingView.
- Select your desired signal (e.g., “Golden Cross”) from the condition dropdown.
- Set your alert preferences and create the alert.
- Now, you’ll get notified automatically whenever a signal occurs!
Perfect For
- Multi-timeframe and swing traders seeking higher timeframe SMA confirmation
- Intraday traders who want to ignore pre/post-market data
- Anyone wanting a modern, powerful, fully customizable multi-SMA overlay
// P.S: Experiment with Golden Cross where Fast SMA is 5 and Slow SMA is 20.
// Set custom timeframe for 4 hr while monitoring your chart on 15 min time frame.
// Enable Background Color and Use Table Timeframe for Background.
// Uncheck Pine labels in Style tab.
Clean, open-source, and loaded with pro features—enjoy!
Like, share, and let me know if you'd like any new features added.
Floor and Roof Indicator with SignalsFloor and Roof Indicator with Trading Signals
A comprehensive support and resistance indicator that identifies premium and discount zones with automated signal generation.
Key Features:
Dynamic Support/Resistance Zones: Calculates floor (support) and roof (resistance) levels using price action and volatility
Premium/Discount Zone Identification: Highlights areas where price may find resistance or support
Customizable Signal Frequency: Control how often signals are displayed (every Nth occurrence)
Visual Signal Table: Optional table showing the last 5 long and short signal prices
Multiple Timeframe Compatibility: Works across all timeframes
Technical Details:
Uses ATR-based calculations for dynamic zone width adjustment
Combines Bollinger Bands with highest/lowest price analysis
Smoothing options for cleaner signal generation
Fully customizable colors and display options
How to Use:
Floor Zones (Blue): Potential support areas where long positions may be considered
Roof Zones (Pink): Potential resistance areas where short positions may be considered
Signal Crosses: Visual markers when price interacts with key levels
Signal Table: Track recent signal prices for analysis
Settings:
Length: Period for calculations (default: 200)
Smooth: Smoothing factor for cleaner signals
Zone Width: Adjust the thickness of support/resistance zones
Signal Frequency: Control signal display frequency
Visual Options: Customize colors and table position
Alerts Available:
Long signal alerts when price touches discount zones
Short signal alerts when price reaches premium zones
Educational Purpose: This indicator is designed to help traders identify potential support and resistance areas. Always combine with proper risk management and additional analysis.
This description focuses on the technical aspects and educational value while avoiding any language that could be interpreted as financial advice or guaranteed profits.
THE HISTORY By [VXN]
THE HISTORY By   - Monthly Seasonal Analysis Indicator
 Development Status: This indicator is currently in the development phase and is not yet finished. Features and functionality may change as development continues.
Overview:
This indicator provides comprehensive historical analysis of monthly price patterns, designed to help traders identify recurring seasonal behaviors and market tendencies for the current month across multiple years of data.
Key Features:
Historical Data Analysis:
- Analyzes up to 10 years of historical performance for the current month
- Calculates monthly returns, win rates, and statistical metrics
- Tracks maximum drawdowns and runups for risk assessment
- Requires daily timeframe for accurate monthly calculations
Pattern Recognition:
- Implements a three-period classification system that breaks each month into segments
- Uses visual indicators (🟢🔴🟡) to represent bullish, bearish, and neutral periods
- Helps identify recurring intra-month behavior patterns
Statistical Display:
- Presents historical data in an organized table format
- Shows year-by-year performance comparisons
- Calculates average returns, best/worst performance, and confidence levels
- Displays overall market bias (bullish/bearish tendency) for the current month
Dynamic Zone Overlays:
- Projects Fibonacci-based support/resistance levels based on historical volatility
- Adjusts zone positioning based on the month's historical bias
- Provides visual reference points for potential price targets or reversal areas
Practical Applications:
- Seasonal trading strategy development
- Risk management through historical context
- Understanding market cyclicality and recurring patterns
- Educational tool for studying price behavior over time
Note: This indicator is designed for analysis and education purposes, helping traders understand historical market patterns rather than providing direct trading signals. The data should be used in conjunction with other forms of analysis and proper risk management. As this is still under development, please expect updates and refinements to functionality.
xGhozt Wickless Candle Streak ProbabilityThe xGhozt Wickless Candle Streak Probability is a custom Pine Script indicator designed to identify and quantify the occurrence of consecutive "wickless" candles of the same trend (either bullish or bearish).
Key Features:
Wickless Candle Detection: It first identifies candles that lack an upper or lower wick (meaning their open/close is equal to their high/low, respectively).
Consecutive Streak Tracking: The indicator tracks how many wickless bullish candles occur in a row, and similarly for wickless bearish candles.
User-Defined Streak Length: You can specify a Streak Length in the indicator's settings. This defines how many consecutive wickless candles are needed to register a "streak."
Probability Calculation: For the chosen Streak Length, the indicator calculates the historical probability (as a percentage) of encountering such a streak for both bullish and bearish wickless candles. This is done by dividing the number of times a streak of that length has occurred by the total number of candles scanned.
On-Chart Display: The results, including the total wickless candles, total scanned candles, and the calculated streak probabilities, are displayed in a convenient table directly on your chart.
Purpose:
This indicator helps traders and analysts understand the historical likelihood of sustained, strong directional moves as indicated by consecutive wickless candles. By quantifying these probabilities, it can provide insights into potential continuation patterns or extreme market conditions, which might be useful for developing trading strategies or confirming market biases.
BANKNIFTY Contribution Table [GSK-VIZAG-AP-INDIA]1. Overview
This indicator provides a real-time visual contribution table of the 12 constituent stocks in the BANKNIFTY index. It displays key metrics for each stock that help traders quickly understand how each component is impacting the index at any given moment.
2. Purpose / Trading Use Case
The tool is designed for intraday and short-term traders who rely on index movement and its internal strength or weakness. By seeing which stocks are contributing positively or negatively, traders can:
Confirm trend strength or divergence within the index.
Identify whether a BANKNIFTY move is broad-based or driven by a few heavyweights.
Detect reversals when individual components decouple from index direction.
3. Key Features and Logic
Live LTP: Current price of each BANKNIFTY stock.
Price Change: Difference between current LTP and previous day’s close.
% Change: Percentage move from previous close.
Weight %: Static weight of each stock within the BANKNIFTY index (user-defined).
This estimates how much each stock contributes to the BANKNIFTY’s point change.
Sorted View: The stocks are sorted by their weight (descending), so high-impact movers are always at the top.  
4. User Inputs / Settings
Table Position (tableLocationOpt):
Choose where the table appears on the chart:
top_left, top_right, bottom_left, or bottom_right.
This helps position the table away from your price action or indicators.
5. Visual and Plotting Elements
Table Layout: 6 columns
Stock | Contribution | Weight % | LTP | Change | % Change
Color Coding:
Green/red for positive/negative price changes and contributions.
Alternating background rows for better visibility.
BANKNIFTY row is highlighted separately at the top.
Text & Background Colors are chosen for both readability and direction indication.
6. Tips for Effective Use
Use this table on 1-minute or 5-minute intraday charts to see near real-time market structure.
Watch for:
A few heavyweight stocks pulling the index alone (can signal weak internal breadth).
Broad green/red across all rows (signals strong directional momentum).
Combine this with price action or volume-based strategies for confirmation.
Best used during market hours for live updates.
7. What Makes It Unique
Unlike other contribution tables that show only static data or require paid feeds, this script:
Updates in real time.
Uses dynamic calculated contributions.
Places BANKNIFTY at the top and presents the entire internal structure clearly.
Doesn’t repaint or rely on lagging indicators.
8. Alerts / Additional Features
No alerts are added in this version.
(Optional: Alerts can be added to notify when a certain stock contributes above/below a threshold.)
9. Technical Concepts Used
request.security() to pull both 1-minute and daily close data.
Conditional color formatting based on price change direction.
Dynamic table rendering using table.new() and table.cell().
Static weights assigned manually for BANKNIFTY stocks (can be updated if index weights change).
10. Disclaimer
This script is intended for educational and informational purposes only. It does not constitute financial advice or a buy/sell recommendation.
Users should test and validate the tool on paper or demo accounts before applying it to live trading.
📌 Note: Due to internet connectivity, data delays, or broker feeds, real-time values (LTP, change, contribution, etc.) may slightly differ from other platforms or terminals. Use this indicator as a supportive visual tool, not a sole decision-maker.
Script Title: BANKNIFTY Contribution Table -  
Author: GSK-VIZAG-AP-INDIA
Version: Final Public Release
Momentum Regression [BackQuant]Momentum Regression  
The  Momentum Regression  is an advanced statistical indicator built to empower quants, strategists, and technically inclined traders with a robust visual and quantitative framework for analyzing  momentum effects  in financial markets. Unlike traditional momentum indicators that rely on raw price movements or moving averages, this tool leverages a  volatility-adjusted linear regression model (y ~ x)  to uncover and validate momentum behavior over a user-defined lookback window.
 Purpose & Design Philosophy 
Momentum is a core anomaly in quantitative finance — an effect where assets that have performed well (or poorly) continue to do so over short to medium-term horizons. However, this effect can be noisy, regime-dependent, and sometimes spurious.
The  Momentum Regression  is designed as a  pre-strategy analytical tool  to help you filter and verify whether statistically meaningful and tradable momentum exists in a given asset. Its architecture includes:
 Volatility normalization  to account for differences in scale and distribution.
 Regression analysis  to model the relationship between past and present standardized returns.
 Deviation bands  to highlight overbought/oversold zones around the predicted trendline.
 Statistical summary tables  to assess the reliability of the detected momentum.
 Core Concepts and Calculations 
The model uses the following:
 Independent variable (x):  The volatility-adjusted return over the chosen momentum period.
 Dependent variable (y):  The 1-bar lagged log return, also adjusted for volatility.
A  simple linear regression  is performed over a large lookback window (default: 1000 bars), which reveals the slope and intercept of the momentum line. These values are then used to construct:
A  predicted momentum trendline  across time.
 Upper and lower deviation bands , representing ±n standard deviations of the regression residuals (errors).
These visual elements help traders judge how far current returns deviate from the modeled momentum trend, similar to Bollinger Bands but derived from a regression model rather than a moving average.
 Key Metrics Provided 
On each update, the indicator dynamically displays:
 Momentum Slope (β₁):  Indicates trend direction and strength. A higher absolute value implies a stronger effect.
 Intercept (β₀):  The predicted return when x = 0.
 Pearson’s R:  Correlation coefficient between x and y.
 R² (Coefficient of Determination):  Indicates how well the regression line explains the variance in y.
 Standard Error of Residuals:  Measures dispersion around the trendline.
 t-Statistic of β₁:  Used to evaluate statistical significance of the momentum slope.
These statistics are presented in a top-right summary table for immediate interpretation. A bottom-right signal table also summarizes key takeaways with visual indicators.
 Features and Inputs 
✅  Volatility-Adjusted Momentum : Reduces distortions from noisy price spikes.
✅  Custom Lookback Control : Set the number of bars to analyze regression.
✅  Extendable Trendlines : For continuous visualization into the future.
✅  Deviation Bands : Optional ±σ multipliers to detect abnormal price action.
✅  Contextual Tables : Help determine strength, direction, and significance of momentum.
✅  Separate Pane Design : Cleanly isolates statistical momentum from price chart.
 How It Helps Traders 
📉  Quantitative Strategy Validation: 
Use the regression results to confirm whether a momentum-based strategy is worth pursuing on a specific asset or timeframe.
🔍  Regime Detection: 
Track when momentum breaks down or reverses. Slope changes, drops in R², or weak t-stats can signal regime shifts.
📊  Trade Filtering: 
Avoid false positives by entering trades only when momentum is both statistically significant and directionally favorable.
📈  Backtest Preparation: 
Before running costly simulations, use this tool to pre-screen assets for exploitable return structures.
 When to Use It 
 Before building or deploying a momentum strategy : Test if momentum exists and is statistically reliable.
 During market transitions : Detect early signs of fading strength or reversal.
 As part of an edge-stacking framework : Combine with other filters such as volatility compression, volume surges, or macro filters.
 Conclusion 
The  Momentum Regression  indicator offers a powerful fusion of statistical analysis and visual interpretation. By combining volatility-adjusted returns with real-time linear regression modeling, it helps quantify and qualify one of the most studied and traded anomalies in finance: momentum.
Tsallis Entropy Market RiskTsallis Entropy Market Risk Indicator 
 What Is It? 
The Tsallis Entropy Market Risk Indicator is a market analysis tool that measures the degree of randomness or disorder in price movements. Unlike traditional technical indicators that focus on price patterns or momentum, this indicator takes a statistical physics approach to market analysis.
 Scientific Foundation 
The indicator is based on Tsallis entropy, a generalization of traditional Shannon entropy developed by physicist Constantino Tsallis. The Tsallis entropy is particularly effective at analyzing complex systems with long-range correlations and memory effects—precisely the characteristics found in crypto and stock markets. 
The indicator also borrows from Log-Periodic Power Law (LPPL).
 Core Concepts 
 1. Entropy Deficit 
The primary measurement is the "entropy deficit," which represents how far the market is from a state of maximum randomness:
 
 Low Entropy Deficit (0-0.3): The market exhibits random, uncorrelated price movements typical of efficient markets
 Medium Entropy Deficit (0.3-0.5): Some patterns emerging, moderate deviation from randomness
 High Entropy Deficit (0.5-0.7): Strong correlation patterns, potentially indicating herding behavior
 Extreme Entropy Deficit (0.7-1.0): Highly ordered price movements, often seen before significant market events
 
 2. Multi-Scale Analysis 
The indicator calculates entropy across different timeframes:
 
 Short-term Entropy (blue line): Captures recent market behavior (20-day window)
 Long-term Entropy (green line): Captures structural market behavior (120-day window)
 Main Entropy (purple line): Primary measurement (60-day window)
 
 3. Scale Ratio 
This measures the relationship between long-term and short-term entropy. A healthy market typically has a scale ratio above 0.85. When this ratio drops below 0.85, it suggests abnormal relationships between timeframes that often precede market dislocations.
 How It Works  
 
 Data Collection: The indicator samples price returns over specific lookback periods
 Probability Distribution Estimation: It creates a histogram of these returns to estimate their probability distribution
 Entropy Calculation: Using the Tsallis q-parameter (typically 1.5), it calculates how far this distribution is from maximum entropy
 Normalization: Results are normalized against theoretical maximum entropy to create the entropy deficit measure
 Risk Assessment: Multiple factors are combined to generate a composite risk score and classification
 
 Market Interpretation 
 
 Low Risk Environments (Risk Score < 25) 
 Market is functioning efficiently with reasonable randomness
 Price discovery is likely effective
 Normal trading and investment approaches appropriate
 Medium Risk Environments (Risk Score 25-50) 
 Increasing correlation in price movements
 Beginning of trend formation or momentum
 Time to monitor positions more closely
 High Risk Environments (Risk Score 50-75) 
 Strong herding behavior present
 Market potentially becoming one-sided
 Consider reducing position sizes or implementing hedges
 Extreme Risk Environments (Risk Score > 75) 
 Highly ordered market behavior
 Significant imbalance between buyers and sellers
 Heightened probability of sharp reversals or corrections
 
 Practical Application Examples 
 
 Market Tops: Often characterized by gradually increasing entropy deficit as momentum builds, followed by extreme readings near the actual top
 Market Bottoms: Can show high entropy deficit during capitulation, followed by normalization
 Range-Bound Markets: Typically display low and stable entropy deficit measurements
 Trending Markets: Often show moderate entropy deficit that remains relatively consistent
 
 Advantages Over Traditional Indicators 
 
 Forward-Looking: Identifies changing market structure before price action confirms it
 Statistical Foundation: Based on robust mathematical principles rather than empirical patterns
 Adaptability: Functions across different market regimes and asset classes
 Noise Filtering: Focuses on meaningful structural changes rather than price fluctuations
 Limitations
 Not a Timing Tool: Signals market risk conditions, not precise entry/exit points
 Parameter Sensitivity: Results can vary based on the chosen parameters
 Historical Context: Requires some historical perspective to interpret effectively
 Complementary Tool: Works best alongside other analysis methods
 
Enjoy :)
Intra-bar Close/Open Gap [YuL]Just checking one idea: look at gaps between close and open bars on lower timeframe to try to estimate how much slippage exists there that may be a result of buying or selling pressure.
Perhaps it only useful in real time to see if situation of the current bar is changing.
Open to ideas and suggestions.
Better MACD📘 Better MACD – Adaptive Momentum & Divergence Suite
Better MACD is a comprehensive momentum-trend tool that evolves the traditional MACD into a multi-dimensional, divergence-aware oscillator. It leverages exponential smoothing across logarithmic rate-of-change of OHLC data, adaptive signal processing, and intelligent divergence detection logic to provide traders with earlier, smoother, and more reliable momentum signals.
This indicator is built for professional-level analysis, suitable for scalping, swing trading, and trend-following systems.
🧬 Core Concept
Unlike the classic MACD which subtracts two EMAs of price, Better MACD constructs a signal by:
Applying logarithmic transformation on the change between OHLC components (Close, High, Low, Open).
Using double EMA smoothing to filter noise and volatility, Triangular method. 1st to 2nd Smoothing.
Averaging and de-biasing the results through a custom linear regression model, 4th Smoothing.
Subtracting a fast SMA and slow SMA response to yield a dynamic MACD value, 3rd Smoothing.
The result is a smooth, adaptive, and high-resolution MACD-style oscillator that responds more naturally to trend conditions and price geometry.
🧠 Features Breakdown
1. 📈 Multi-Layer MACD Engine
Src1: Smoothed Log Rate-of-Change on Close
Src2: Smoothed Log Rate-of-Change on High
Src3: Smoothed Log Rate-of-Change on Low
Src4: Smoothed Log Rate-of-Change on Open
These are blended using highest high, lowest low, and average Close price over a configurable window for more complete trend detection. The open-based Src4 is subtracted using SMA.
2. 🧮 Signal Line
A fast EMA (signalLength) of the Better MACD value is used for crossover logic.
Crossovers of MACD and Signal line signal potential entries or exits.
3. 📊 MACD Histogram
Visualizes the difference between MACD and Signal line.
Dynamically color-coded:
Green/Light Green for bullish impulse
Red/Pink for bearish impulse
Width and color intensity reflect strength and momentum slope.
🎨 Visual Enhancements
Feature	Description
✅ Ribbon Fill	Optional fill between MACD and Signal line, colored by trend direction
✅ Zero-Line Background	Background highlights above/below 0 to easily read bullish/bearish bias
✅ Crossover Highlights	Tiny circles plotted when MACD crosses Signal line
🔍 Divergence Detection Suite
The script includes a full Divergence Engine to detect:
🔼 Bullish Regular Divergence (Price lower lows + Indicator higher lows)
🔽 Bearish Regular Divergence (Price higher highs + Indicator lower highs)
🟢 Bullish Hidden Divergence (Price higher lows + Indicator lower lows)
🔴 Bearish Hidden Divergence (Price lower highs + Indicator higher highs)
🧩 Divergence Modes:
Supports both Regular, Hidden, or Both simultaneously
Detects from either Close Price or Heikin Ashi-derived candles
Uses dynamic pivot tracking with configurable lookback and divergence sensitivity
Divergence lines are labeled, colored, and plotted in real-time
🔁 Styling & Customization:
Choose from Solid, Dashed, or Dotted line styles
Configure separate colors and widths for all divergence types
Control number of divergence lines visible or only show the most recent
Divergences update live without repainting
⚠️ Alerts
Alerts are built-in for real-time notification:
MACD Histogram reversals (rising → falling, or vice versa)
Divergence signals (all 4 types, grouped and individually)
Combines seamlessly with TradingView alerts for actionable triggers
🔧 Input Controls (Grouped by Purpose)
Better MACD Group
1st–4th Smoothing Lengths: Controls responsiveness of MACD core engine
Signal Length: Smoothness of signal line
Toggles for crossover highlights, zero cross fills, and ribbon fills
Divergence Settings
Enable/disable divergence lines
Choose divergence type (Regular, Hidden, Both)
Set confirmation requirements
Customize pivot detection and bar search depth
Styling Options
Colors, line widths, and line styles for each divergence type
Heikin Ashi Mode for smoother pivots and divergences
🧠 How to Use
✅ For Trend Traders:
Use MACD > Signal + Histogram > 0 → Bullish confirmation
MACD < Signal + Histogram < 0 → Bearish confirmation
Wait for pullbacks with hidden divergences to enter in trend direction
✅ For Reversal Traders:
Look for Regular Divergences at trend exhaustion points
Combine with price action (e.g., support/resistance or candle pattern)
✅ For Swing & Day Traders:
Enable Heikin Ashi Mode for smoother divergence pivots
Use zero line background + histogram color to time entries
📌 Summary
Feature	Description
🚀 Advanced MACD Core	Smoother, more reliable, multi-source-based MACD
🔍 Divergence Engine	Detects 4 divergence types with pivot logic
🎯 Real-Time Alerts	Alerts for histogram slope and divergences
🎛️ Deep Customization	Full styling, smoothing, and detection controls
📉 Heikin Ashi Support	Improved signal quality in trend-based markets






















