Quantum Momentum Analyzer [JOAT]Quantum Momentum Analyzer
Introduction
The Quantum Momentum Analyzer is an open-source oscillator that reimagines traditional RSI through a multi-layered, regime-aware framework. Instead of relying on a single RSI line, this indicator calculates multiple RSI variants simultaneously — raw, smoothed, volume-weighted, and multi-layer — then blends them into a composite "Quantum RSI" that adapts to changing market conditions. It also includes regime detection, neural divergence identification, and momentum burst alerts, all presented through a visually rich interface with gradient coloring and an information dashboard.
Built with Pine Script v6, the indicator uses custom types to manage divergence points, regime states, momentum bursts, and quantum zones as structured objects.
Why This Indicator Exists
Standard RSI is a powerful concept, but a single 14-period RSI line has well-known limitations: it gives false overbought/oversold signals in trending markets, it lacks volume context, and it treats all market regimes the same way. This indicator addresses those gaps by:
Multi-dimensional RSI: Combines four RSI calculations (raw, smoothed, volume-weighted, multi-layer) into a single adaptive reading that is more robust than any individual RSI
Regime detection: Automatically classifies the market as Trending, Ranging, Volatile, or Calm, and adjusts the visual presentation accordingly
Volume weighting: Incorporates volume into the RSI calculation so that high-volume moves carry more weight than low-volume noise
Neural divergence: Detects divergences between price and the quantum RSI using pivot-based analysis with configurable lookback and maximum divergence distance
Momentum bursts: Identifies sudden, explosive momentum shifts that often precede significant price moves
Core Components Explained
1. Multi-Layer RSI System
The indicator calculates four distinct RSI values and combines them into a weighted composite:
rawRSI = ta.rsi(close, rsiLength)
smoothedRSI = ta.ema(rawRSI, smoothingLength)
volWeightedRSI = ta.rsi(close * volume, rsiLength)
multiLayerRSI = (ta.rsi(close, rsiLen1) + ta.rsi(close, rsiLen2) + ta.rsi(close, rsiLen3)) / 3
The multi-layer RSI uses three configurable periods (default 7, 14, 21) to capture momentum across short, medium, and long cycles. The final Quantum RSI is a weighted average of all four, giving a reading that is smoother than raw RSI but more responsive than heavily smoothed alternatives.
2. Regime Detection
The regime detector classifies market conditions using ADX for trend strength and ATR percentile for volatility:
Trending: ADX above threshold (default 25) — momentum signals are more reliable
Ranging: ADX below threshold with low volatility — overbought/oversold levels become more meaningful
Volatile: High ATR percentile regardless of ADX — wider bands and more cautious interpretation needed
Calm: Low ADX and low volatility — reduced signal reliability, smaller moves expected
The background color subtly shifts based on the detected regime, giving traders an immediate visual cue about the current market environment without needing to check additional indicators.
3. Neural Divergence Detection
Divergences are detected by comparing pivot highs and lows in price against corresponding pivots in the Quantum RSI. A bullish divergence occurs when price makes a lower low but the Quantum RSI makes a higher low, suggesting weakening selling pressure. A bearish divergence is the inverse.
The detection uses configurable parameters:
Pivot lookback (default 5): How many bars to look back for pivot confirmation
Max divergence bars (default 50): Maximum distance between the two pivots forming the divergence
Divergences are plotted as labeled markers on the oscillator panel, making them easy to spot without cluttering the price chart.
The Quantum Momentum Analyzer oscillator panel showing the multi-layer RSI line with regime-colored background zones and divergence markers
4. Momentum Burst Detection
A momentum burst fires when the rate of change in the Quantum RSI exceeds a configurable threshold within a short window. These bursts often coincide with the start of impulsive moves. Each burst is tracked as an object with a direction, strength value, and bar index, and is visualized as a highlighted marker on the oscillator.
5. Quantum Zones
The indicator defines dynamic zones on the oscillator based on the current regime and RSI behavior. These zones represent areas of high probability for reversals or continuations. In trending regimes, the zones shift to accommodate the tendency for RSI to stay elevated (in uptrends) or depressed (in downtrends), rather than using fixed 70/30 levels.
Visual Elements
Quantum RSI Line: The main composite RSI plotted with gradient coloring that shifts from bearish to bullish tones
Overbought/Oversold Levels: Horizontal reference lines at configurable levels (default 70/30) with a midline at 50
Regime Background: Subtle background coloring indicating the current market regime
Momentum Histogram: A histogram showing the rate of change of the Quantum RSI, color-coded by direction and intensity
Divergence Markers: Labels marking bullish and bearish divergences directly on the oscillator
Momentum Burst Markers: Highlighted signals when explosive momentum is detected
Dashboard: Real-time display of Quantum RSI value, regime state, divergence status, momentum direction, and burst alerts
Input Parameters
RSI Settings:
RSI Length (default 14): Base period for RSI calculations
Smoothing Length (default 5): EMA smoothing applied to the raw RSI
Overbought / Oversold levels (default 70 / 30)
Volume Weighting: Toggle volume-adjusted RSI component
Regime Detection:
ADX Length (default 14)
ADX Threshold (default 25): Above this = trending
ATR Percentile Length (default 100): Lookback for volatility ranking
Divergence Detection:
Pivot Lookback (default 5)
Max Divergence Bars (default 50)
Multi-Layer RSI:
Layer 1 / 2 / 3 Length (default 7, 14, 21)
Visual Settings:
Show Momentum Histogram, Dashboard, Glow Effects, Pulse Effects
How to Use This Indicator
Step 1: Check the regime background. In a trending regime, focus on momentum continuation signals rather than overbought/oversold reversals. In a ranging regime, the 70/30 levels become more actionable.
Step 2: Monitor the Quantum RSI line for crossovers of the 50 midline. A cross above 50 with rising momentum histogram suggests bullish momentum is building.
Step 3: Watch for divergences. A bullish divergence near the oversold zone in a ranging regime is a higher-probability reversal signal than one in a strong trending regime.
Step 4: Use momentum bursts as early warnings. A burst in the direction of the prevailing trend often signals the start of an impulsive move.
Step 5: Confirm with the dashboard. The dashboard provides a quick summary of all components so you can assess the overall momentum picture at a glance.
Dashboard view showing regime state, Quantum RSI value, divergence status, and momentum burst alert in a trending market
Indicator Limitations
Like all RSI-based tools, this indicator is a lagging momentum measure. It confirms momentum shifts after they begin, not before.
Volume-weighted RSI requires reliable volume data. On instruments with sparse or unreliable volume (some forex pairs, illiquid assets), consider disabling volume weighting.
Regime detection uses ADX, which itself has a lag. Regime transitions may be identified a few bars after they actually begin.
Divergences do not guarantee reversals. They indicate weakening momentum, but price can continue in the original direction for an extended period.
The multi-layer RSI adds smoothing, which reduces noise but also reduces responsiveness to sudden moves.
Momentum bursts can produce false signals during choppy, low-conviction markets.
Originality Statement
This indicator is original in its multi-dimensional approach to RSI analysis. While RSI, divergence detection, and regime filtering are established concepts individually, this indicator is justified because:
It fuses four distinct RSI methodologies (raw, smoothed, volume-weighted, multi-layer) into a single composite reading
Regime-aware interpretation automatically adjusts context based on ADX and volatility, something standard RSI indicators do not provide
The neural divergence system uses pivot-based detection with configurable distance limits, providing more precise divergence identification than simple lookback methods
Momentum burst detection adds an event-driven layer that identifies explosive shifts in RSI momentum
The quantum zone system dynamically adjusts overbought/oversold interpretation based on the current regime rather than using static levels
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. RSI and momentum analysis are tools for understanding market dynamics, not guarantees of future price movement. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
مؤشر

مؤشر

مؤشر

مؤشر

مؤشر

Financial Markets Composite Custom Index ProWhat This Indicator Does
-Financial Markets Composite Custom Index is a portfolio construction and analysis tool that lets you build your own weighted index from up to 20 securities. Unlike simply watching multiple charts or using a watchlist, this indicator synthesizes price data from all components into a single tradeable chart with full OHLC candlesticks, allowing you to apply technical analysis directly to your custom basket.
-The indicator calculates a weighted composite of all selected tickers and displays it as candlesticks starting from a user-defined base value. It then layers institutional-grade analytics on top: performance metrics, moving averages, benchmark comparison, breadth analysis, contribution tracking, and a correlation heatmap that reveals diversification quality.
How It Works
The mathematical foundation is weighted aggregation with automatic normalization.
-For each bar, the indicator fetches open, high, low, and close prices from all 20 tickers. Each price is multiplied by its normalized weight, then summed:
Weighted Close = (C1 × W1) + (C2 × W2) + ... + (C20 × W20)
The same formula applies to open, high, and low prices, producing four composite values per bar.
-Weight normalization ensures your basket always sums to 100% regardless of input values. If you enter weights of 7, 5, and 3 for three tickers (leaving others at zero), the indicator calculates total weight (15), then divides each by the total: 46.7%, 33.3%, and 20%. This means you can enter weights as percentages, ratios, or any relative scale you prefer.
The composite prices are then rebased to your chosen starting value (default 1000) using the formula:
Index Value = (Current Weighted Price / Initial Weighted Price) × Base Value
-This rebasing serves two purposes. First, it creates an index that starts at a round number, making percentage moves intuitive to read. Second, it allows direct comparison with benchmarks that have been rebased to the same starting point.
The Correlation Heatmap
-The correlation heatmap is the analytical centerpiece that transforms this from a simple index builder into a diversification analysis tool.
-The heatmap displays a matrix showing how each of your first 10 components correlates with every other component. Correlation is calculated using the Pearson method on returns rather than prices. This distinction matters because prices are non-stationary (they trend), while returns oscillate around zero, making correlation measurements statistically meaningful.
-The calculation uses a rolling lookback window (default 50 bars). For each pair of components, the indicator computes:
Correlation(A,B) = Covariance(A,B) / (StdDev(A) × StdDev(B))
Results range from -1 to +1:
• Values near +1 indicate the two assets move together
• Values near 0 indicate independent movement
• Values near -1 indicate inverse movement
-The heatmap uses color coding to make patterns immediately visible:
• Bright green cells indicate strong positive correlation (above 0.7 threshold)
• Light green shows moderate positive correlation
• Yellow cells indicate low correlation — these represent your best diversification
• Light red shows moderate negative correlation
• Bright red indicates strong negative correlation (potential hedges)
-When examining your heatmap, look for clusters of green. If most of your technology stocks show correlations above 0.8 with each other, your "diversified" basket may actually behave like a single concentrated position during market stress. The ideal diversified portfolio shows more yellow and mixed colors, indicating components that move independently.
Performance Metrics Panel
The left-side panel displays five real-time performance metrics:
-Daily Change shows the percentage move from the previous bar's close to the current close. This updates with each tick when markets are open.
-Period Return calculates the percentage gain or loss over a configurable lookback (default 20 bars). This answers the question "how has my basket performed over the last N periods?"
-Total Return measures performance from the first bar where data became available to the current bar. This is your inception-to-date return.
-Volatility displays the standard deviation of returns over the specified lookback period. Higher values indicate more erratic price movement. This metric helps with position sizing — a basket with 2% daily volatility requires different position management than one with 0.5% volatility.
-Maximum Drawdown tracks the largest peak-to-trough decline in the index's history. This is calculated by comparing each bar's close to the highest close seen up to that point. The metric shows the worst historical decline you would have experienced, which is essential for stress-testing your basket construction.
All metrics are color-coded: green for positive values, red for negative, and yellow for neutral readings like volatility.
The Three Moving Averages
Three independent moving averages can be overlaid on your composite index. Each average offers three type options:
-Simple Moving Average weights all bars equally over the period. A 50-bar SMA gives the same importance to bar 1 as bar 50.
-Exponential Moving Average applies greater weight to recent bars, making it more responsive to new price action. The weighting factor is 2/(length+1).
-Weighted Moving Average applies linearly increasing weights, with the most recent bar receiving the highest weight.
The moving averages are applied to the composite index values, not to individual component prices. This is an important distinction. When you add a 50 EMA, you see the smoothed trend of your entire basket's combined movement, not an average of 20 separate moving averages. This provides cleaner trend identification for the portfolio as a whole.
Default configuration:
• MA 1: 20-period EMA (red) — short-term trend
• MA 2: 50-period EMA (blue) — intermediate trend
• MA 3: 200-period SMA (yellow) — long-term trend
Crossovers between these averages generate alerts automatically when enabled.
Benchmark Comparison
-The benchmark feature overlays any symbol (default SPY) on your chart for direct relative performance comparison. The benchmark is automatically rebased to match your index's starting value, ensuring both lines begin at the same point.
-You can display the benchmark as either a line or candlesticks. The candlestick option fetches full OHLC data for the benchmark symbol and plots it alongside your composite candles, allowing you to compare not just closing prices but also intraday ranges and candle patterns.
-When your custom index consistently stays above the benchmark line, your basket is outperforming. When it falls below, the benchmark is winning. The spread between the two lines represents your relative performance versus the comparison index.
-This feature answers the fundamental portfolio question: "Am I being rewarded for the complexity of managing this custom basket, or would I be better off just buying SPY?"
Breadth Analysis
-The breadth indicator counts how many of your 20 components are currently trading above their own 20-period moving average. Results are displayed as both a count (e.g., "15/20") and a percentage.
-This reveals internal market structure that the composite price alone cannot show. Your index might be rising while breadth deteriorates — fewer stocks participating in the advance. This divergence often precedes reversals because it shows the rally narrowing to fewer leaders.
Color coding provides instant assessment:
• Green (above 70%): Strong participation, healthy advance
• Yellow (30-70%): Mixed participation, potential transition
• Red (below 30%): Weak participation, most components declining
The breadth calculation happens independently of your weight assignments. A component with 1% weight counts the same as one with 10% weight in the breadth tally. This is intentional — breadth measures participation, not contribution.
Contribution Analysis
-The contribution panel identifies which single component moved your index most on each bar. It displays the ticker symbol and its percentage contribution to the bar's change.
-The calculation determines each component's contribution by multiplying its price change by its normalized weight, then identifying the largest contributor. This helps you understand what is driving your basket's movement.
-If one asset consistently dominates the contribution panel, your "diversified" index may have concentration risk. Conversely, if contributions rotate among components, your basket is behaving as intended with multiple drivers.
The Composition Table
The right-side table displays all active components with three columns:
-Ticker shows the cleaned symbol name (exchange prefix removed for readability).
-Weight shows your input value exactly as entered.
-Normalized shows the mathematically adjusted percentage after all weights sum to 100%.
Components with zero weight are automatically hidden, keeping the table compact. If you only use 8 of the 20 available slots, only those 8 appear in the table.
Alert Conditions
Nine alert conditions cover the primary analytical signals:
-Large Daily Move fires when the absolute daily percentage change exceeds your threshold (default 2%). This catches unusual volatility days requiring attention.
-Breadth Below Threshold triggers when component participation drops below your minimum (default 30%). This warns of deteriorating internals.
-Breadth Above Threshold fires when participation exceeds your maximum (default 70%). This confirms broad strength.
-Index Crossed Above MA1 and Index Crossed Below MA1 trigger on moving average crossovers for trend change detection.
-Index Crossed Above MA2 and Index Crossed Below MA2 provide the same signals for your second moving average.
-New 52-Bar High fires when your index reaches its highest level in 52 bars.
-New 52-Bar Low triggers at the lowest point in 52 bars.
-All alerts use static message text compatible with TradingView's alertcondition requirements.
Settings Reference
-Tickers 1-5, 6-10, 11-15, 16-20 — Symbol inputs with associated weight values. Weights auto-normalize to 100%.
-Base Index Value — Starting point for the rebased index (default 1000).
-Performance Lookback — Bars used for period return and volatility calculations (default 20).
-Large Move Alert Threshold — Percentage threshold for volatility alerts (default 2.0).
-Show Performance Panel — Toggle the left-side metrics table.
-Show Composition Table — Toggle the right-side holdings table.
-Show Correlation Heatmap — Toggle the correlation matrix display.
-Table Position — Placement for composition table (9 position options).
-Candle Style — Visual style for index candles: TradingView Standard, Black and White, or Custom with user-defined colors.
-Show Benchmark — Toggle benchmark overlay visibility.
-Benchmark Symbol — Comparison symbol (default SPY).
-Benchmark Style — Display as Line or Candles.
-Show MA1, MA2, MA3 — Individual toggles for each moving average.
-MA Type — SMA, EMA, or WMA selection for each average.
-MA Length — Period for each moving average calculation.
-MA Color — Color picker for each average line.
-Breadth MA Length — Moving average period used for breadth calculation (default 20).
-Correlation Lookback — Bars used for correlation calculation (default 50).
-Heatmap Position — Screen placement for the correlation matrix.
-Show Correlation Values — Display numerical values within heatmap cells.
-High/Low Correlation Threshold — Boundaries for color intensity mapping.
Practical Applications
-Sector Rotation Analysis: Build indices for each sector (technology, healthcare, energy, financials) using representative stocks. Compare relative performance and breadth across sectors to identify rotation opportunities. When technology breadth deteriorates while energy breadth improves, capital may be rotating.
-Earnings Season Monitoring: Create a basket of companies reporting earnings this week. Watch the composite to gauge overall results sentiment. The contribution panel shows which reports moved markets most.
-Correlation Regime Detection: Monitor your heatmap over time. During market stress, correlations typically spike toward 1.0 across all assets (the "correlation of one" phenomenon). Seeing your normally yellow cells turn green warns that diversification benefits may temporarily disappear.
-Custom Factor Exposure: Build factor-tilted baskets — momentum leaders, value stocks, quality names, or dividend payers. Compare factor index performance to identify which factors are currently rewarded by the market.
-Risk Management: Use the maximum drawdown metric and volatility reading to right-size positions. A basket with 30% historical drawdown requires different allocation than one with 10% drawdown, even if returns are similar.
What Makes This Indicator Original
-Standard TradingView watchlists show multiple symbols but cannot aggregate them into a single tradeable chart. The built-in spread/ratio tools work for pairs but become unwieldy beyond three or four symbols. This indicator solves the N-asset composition problem with full OHLC reconstruction.
-The correlation heatmap provides portfolio-level diversification analysis typically found in institutional risk systems. Calculating rolling correlations across 10 assets (45 unique pairs) and displaying them in an interpretable visual format brings professional analytics to individual traders.
-Breadth analysis on custom baskets is not available in standard tools. You can find market breadth for indices like the S&P 500, but not for your personal watchlist of 15 stocks. This indicator calculates participation metrics for whatever universe you define.
-The contribution attribution panel identifies index drivers in real-time, answering "why did my basket move?" without manually checking each component.
-These features work together as an integrated system. The correlation heatmap informs weight decisions, breadth confirms or warns about price moves, contribution identifies leaders, and performance metrics quantify results — all updating dynamically on a single chart.
Markets and Timeframes
-This indicator functions on any market where TradingView provides data: equities, ETFs, forex pairs, cryptocurrencies, commodities, and indices. Components can mix asset classes within a single basket (for example, stocks plus gold plus bitcoin for a multi-asset portfolio).
Timeframe selection depends on your holding period:
-For position trading and investing (weeks to months), daily or weekly timeframes provide clean signals with the 200-period moving average serving as the primary trend filter. Correlation lookbacks of 50-100 bars capture meaningful relationships.
-For swing trading (days to weeks), 4-hour or daily charts work well. The 50-period moving average becomes more relevant, and breadth divergences over 5-10 bars often precede reversals.
-For day trading (intraday), 15-minute to 1-hour charts balance noise reduction with signal timeliness. Reduce correlation lookbacks to 20-30 bars for more responsive readings.
-For scalping (minutes), 1-minute to 5-minute charts require tight moving averages (8-21 periods). The performance metrics and correlation heatmap become less relevant at this speed; focus shifts to the candlesticks and shortest moving average.
The correlation heatmap works best on daily timeframes or higher, where returns have economic meaning. Intraday correlations contain more noise and require longer lookbacks to stabilize.
Disclaimer
-This indicator is a technical analysis and portfolio construction tool. It does not provide financial advice, buy/sell recommendations, or guaranteed trading outcomes.
-Past performance metrics displayed by the indicator do not guarantee future results. Maximum drawdown figures represent historical observations and actual future drawdowns may exceed historical levels.
-Correlation relationships between assets change over time and may break down precisely when diversification is most needed (during market stress events).
-Users are responsible for their own trading decisions and should conduct independent analysis before entering positions. Consider consulting a qualified financial advisor for personalized investment guidance.
Always use appropriate position sizing and risk management regardless of any indicator signals.
مؤشر

مؤشر

مؤشر

مؤشر

مؤشر

مؤشر

Liquidity Flow Surge Profile [ChartPrime]🔶 OVERVIEW
LiquidityFlow Surge Profile is an advanced orderflow visualization suite that maps institutional transaction density and detects climactic liquidation events in real time. By combining a 25-bin structural heatmap with an intelligent "Liquidation Surge" engine, this indicator identifies where market energy is being absorbed and where it is being aggressively released.
The tool focuses on the relationship between high-contrast structural "Heat" and immediate volume surges, providing traders with a high-conviction roadmap of the market's internal mechanics.
• 25-Bin High-Contrast Structural Liquidity Map
• Dynamic Liquidation Surge Bubbles (5 Tier Scaling)
• Real-Time Analytics Dashboard
• ATR-Adaptive Signal Placement
• Automated Fair-Value Visibility Clearout
🔶 CORE CONCEPT — STRUCTURAL THERMAL MAPPING
Liquidity is the fuel of the market. This indicator uses a proprietary single-pass volume distribution algorithm to identify the most significant transaction clusters over three user-definable depths (Short, Medium, Long).
Structural Clusters: The 25-bin heatmap highlights price levels where the most volume has transacted, acting as psychological and institutional floors or ceilings.
Fair-Value Visibility: To ensure the trader can always see immediate price action, the heatmap dynamically clears its coloring around the active candle, maintaining structural context without obscuring the bars.
🔶 LIQUIDATION SURGE ENGINE
The "Liquidation Bubble" system monitors current volume relative to the highest transaction peaks over the last 500 bars. These surge events are often where stop-losses are triggered, positions are forcefully closed, and major institutional entries are filled.
Relative Intensity: Bubbles scale across 5 tiers (Tiny, Small, Normal, Large, Extreme) based on volume size, ranging from 40% to 100%+ of the lookback high.
Directional Context: Bubbles are plotted above the bar for bullish surges (Short Liquidations) and below the bar for bearish surges (Long Liquidations).
Visual Weight: As volume intensity increases, the bubbles become more opaque and larger, creating an immediate visual hierarchy of market conviction.
🔶 REAL-TIME ANALYTICS DASHBOARD
The Pro version includes a dedicated real-time dashboard positioned in the top right corner of the chart.
This table tracks the absolute latest liquidation event, displaying:
• Event Type: Identifies if the last surge was a Long or Short liquidation.
• Volume Magnitude: Displays the exact transaction volume of the surge.
• Contextual Coloring: The dashboard text dynamically matches the bubble colors (Mint/Rose) for instant situational awareness.
🔶 HOW TO USE
Absorption & Reversal: Look for price entering a thick "Heat" cluster while printing an Extreme (Large) liquidation bubble. This often signals a climactic "Stop Run" followed by a reversal.
Breakout Confirmation: When price slices through a thermal zone accompanied by a sequence of rising bubbles, it confirms high-conviction institutional participation.
Liquidity Magnets: Use the high-intensity bins as primary magnets for profit-taking or as structural levels to defend with your stop-loss.
🔶 CONCLUSION
LiquidityFlow Surge Profile transforms raw transaction data into a structured map of market energy. By identifying exactly where the "Heat" is concentrated and where the "Surge" is occurring, it allows traders to move beyond price action and stay aligned with the strongest institutional footprints in the market. مؤشر

مؤشر

مؤشر

Trade Intelligence Dashboard// =============================================================================
// INDICATOR DESCRIPTION
// =============================================================================
// Name : Trade Intelligence Dashboard
// Version : Pine Script v6
// Type : Indicator (overlay)
// Author : Built with Claude (Anthropic) — designed as a universal debug tool
// Instruments : NQ, MNQ, ES, MES, SPY, QQQ, Stocks — any instrument
// Timeframes : Works on all timeframes
// =============================================================================
//
// OVERVIEW
// --------
// The Trade Intelligence Dashboard is a standalone indicator designed to give traders
// a comprehensive at-a-glance view of market conditions across 9 independent
// analysis sections, all displayed in a single clean horizontal table at the
// bottom of the chart. It is instrument-agnostic and works with any strategy —
// not just the VWAP + CVD strategy it was originally built alongside.
//
// The panel is designed to support real-time trading decisions by surfacing
// the most important technical and structural information in one place, color
// coded for instant interpretation — no hunting through multiple indicators
// or panels.
//
// Because it is a standalone indicator it can be added or removed from any
// chart independently without affecting any strategy script. This makes it
// ideal for live trading sessions where you want maximum information density,
// and easy to remove during backtesting when a clean chart is preferred.
//
// =============================================================================
// LAYOUT
// =============================================================================
//
// The panel displays as a horizontal table across the bottom of the chart
// with 10 columns and 9 rows:
// - Column 0 : Instrument info (always visible, cannot be toggled)
// - Columns 1–9 : Analysis sections (each independently toggleable)
// - Row 0 : Section headers (shaded with Section Header Background color)
// - Rows 1–8 : Metric labels and values
//
// When a section is toggled off its column disappears and all remaining
// columns shift left automatically — the table always stays compact and clean
// regardless of how many sections are active.
//
// =============================================================================
// SECTIONS
// =============================================================================
//
// INSTRUMENT (Col 0 — always visible)
// ------------------------------------
// Displays the selected instrument preset, point value, current price, daily
// change in points, and daily change as a percentage. The instrument preset
// dropdown auto-fills the correct point value for dollar-value calculations
// displayed throughout the panel.
// Presets: NQ (20), MNQ (2), ES (50), MES (5), SPY/QQQ/Stock (1)
//
// VWAP (Col 1)
// ------------
// Shows the relationship between price and session VWAP. Metrics include:
// Above/Below status, distance in points, distance as percentage, VWAP value,
// and dollar distance from VWAP (using point value). Green when price is above
// VWAP, red when below.
//
// TREND (Col 2)
// -------------
// Displays the current trend direction (Up/Down/Flat), whether the trend is
// strong enough to trade (based on ATR multiple threshold), trend strength in
// points, and trend strength expressed as an ATR multiple. Green for bullish,
// red for bearish, white for flat/neutral.
//
// ATR & VOLATILITY (Col 3)
// ------------------------
// Shows the current ATR value, ATR as a percentage of price, volatility
// condition (OK or Low based on minimum ATR % floor), ATR dollar value
// (ATR × point value), and ATR direction with percentage change from the
// previous bar. Useful for understanding whether current conditions are
// favorable for momentum trades.
//
// CVD — Cumulative Volume Delta (Col 4)
// --------------------------------------
// Displays the session CVD value (resets each day when session reset is
// enabled), CVD threshold, overall CVD direction (Bullish/Bearish/Neutral),
// CVD position relative to threshold (Above/Inside/Below), and the session
// reset status. Green for bullish CVD, red for bearish, yellow for neutral/
// inside threshold. Note: CVD uses bar direction as a proxy for true delta
// since bid/ask volume is unavailable in Pine Script.
//
// EMA/SMA (Col 5)
// ---------------
// Shows the fast MA value and direction, slow MA value and direction, the
// most recent cross signal (Bullish Cross / Bearish Cross / None), and
// price position relative to both the fast and slow MA. MA mode (EMA or SMA)
// and both lengths are fully user adjustable. MA lines for fast and slow are
// also plotted on the chart when this section is enabled. Green for rising/
// bullish, red for falling/bearish.
//
// VOLUME (Col 6)
// --------------
// Displays current bar volume, volume classification vs average (High/Normal/
// Low based on user-defined thresholds), volume ratio (current vs average),
// bar pressure (Buying/Selling/Neutral based on bar direction), and the volume
// moving average value. High volume = green, low volume = red, normal = white.
//
// MARKET STRUCTURE (Col 7)
// ------------------------
// Tracks swing highs and lows using pivot detection to identify the current
// market structure. Displays the last swing type (HH/HL/LH/LL), overall
// structure bias (Bullish/Bearish/Neutral), bars since the last swing, last
// swing high and low values, and swing range in points. HH/HL = green
// (bullish structure), LH/LL = red (bearish structure).
//
// RSI (Col 8)
// -----------
// Shows the current RSI value, condition (Overbought/Oversold/Neutral),
// RSI trend (Rising/Falling/Flat), overbought and oversold levels, and
// RSI distance from the 50 midline. RSI above 50 = green, below 50 = red,
// at 50 = yellow. Overbought = red (caution), oversold = green (opportunity).
// RSI length and OB/OS levels are fully user adjustable.
//
// PRICE ACTION (Col 9)
// --------------------
// Displays bar-level price action analysis including: bar direction (Bullish/
// Bearish/Doji), bar range in points and dollars, bar range vs current ATR
// (above 1x ATR = green, below = red), bar close position (Upper/Mid/Lower
// third of the bar range), and consecutive bullish or bearish bar count.
// This section helps identify momentum, exhaustion, and conviction at the
// bar level without needing a separate candlestick pattern indicator.
//
// =============================================================================
// COLOR CODING SYSTEM
// =============================================================================
//
// All values throughout the panel follow a consistent dynamic color system:
//
// Green (Positive Color) — bullish, true, above, rising, high, OK,
// long, buying, HH/HL, oversold RSI (opportunity)
// Red (Negative Color) — bearish, false, below, falling, low, weak,
// short, selling, LH/LL, overbought RSI (caution)
// Yellow (Warning Color) — neutral boundary, 50% levels, inside threshold,
// Doji bars, equal wicks, RSI at 50
// White (Neutral Color) — raw numbers with no directional meaning,
// labels, static reference values
//
// All four colors are fully user adjustable via the Colors input group.
//
// =============================================================================
// DOLLAR VALUE CALCULATIONS
// =============================================================================
//
// Several metrics display dollar values calculated by multiplying point values
// by the instrument point value from the preset. This makes the panel
// immediately useful for futures traders who think in dollar terms:
//
// NQ — 1 point = $20 (full size Nasdaq futures)
// MNQ — 1 point = $2 (micro Nasdaq futures)
// ES — 1 point = $50 (full size S&P 500 futures)
// MES — 1 point = $5 (micro S&P 500 futures)
// SPY / QQQ / Stock — 1 point = $1 (shares, adjust for lot size manually)
//
// Dollar values appear for: VWAP distance, ATR value, and bar range.
//
// =============================================================================
// DISPLAY SETTINGS
// =============================================================================
//
// Box Position — Top Right, Top Left, Bottom Right, Bottom Left
// Box Text Size — Small (size.tiny), Medium (size.small), Large (size.normal)
// Box Background — fully user adjustable color
// Box Text Color — fully user adjustable color
// Box Border — thickness 0–5, fully user adjustable
// Section Header — separate background color for section header row
//
// =============================================================================
// USAGE TIPS
// =============================================================================
//
// - Add this indicator to any chart independently of any strategy script.
// It recalculates all values from scratch using only price and volume data
// so it works alongside any strategy without conflicts.
//
// - Toggle sections off that are not relevant to your current setup to keep
// the panel compact. For example, if you are not using MA-based entries
// you can toggle off the EMA/SMA section entirely.
//
// - Use the Instrument preset to ensure dollar value calculations match your
// actual instrument. For NQ set to NQ, for MNQ set to MNQ etc.
//
// - The CVD session reset toggle should match the setting in your strategy
// script for consistent values across both panels.
//
// - For intraday trading the panel works best on timeframes of 1m through
// 30m. On daily or weekly charts the session-based metrics (CVD, session
// high/low, VWAP) will reflect longer periods which may not be meaningful
// for intraday setups.
//
// - Use TradingView Templates (gear icon → template dropdown → Save As) to
// save separate panel configurations for different instruments, with only
// the relevant sections enabled for each.
//
// - The MA lines (Fast MA and Slow MA) only plot on the chart when the
// EMA/SMA section is toggled on. Toggle it off to hide the MA lines from
// the chart without removing the indicator entirely.
//
// - The VWAP line also only plots when the VWAP section is toggled on.
// If you have a separate VWAP indicator already on the chart, toggle the
// VWAP section off to avoid duplicate lines.
// ============================================================================= مؤشر

VWAP daily, weekly, monthly, yearlyVWAP Multi-Timeframe with Colored Corridors
This indicator provides a comprehensive View Weighted Average Price (VWAP) analysis across multiple timeframes, featuring highly customizable visual zones and individual label controls.
🚀 Key Features
📅 Multi-Timeframe Analysis
Track Daily, Weekly, Monthly, and Yearly VWAP simultaneously on a single chart.
Compare short-term intraday value with long-term structural trends effortlessly.
📊 Dynamic Standard Deviation Bands
Includes 3 levels of Standard Deviation (1σ, 2σ, 3σ) to identify overextended or value areas.
Colored Corridors: Features background fills between bands to visualize "value zones" (Inner, Middle, and Outer).
Default Focus: Optimized by default to highlight the Outer 2-3σ corridor in a sleek blue shade (#6d94fe) at 7% opacity for a premium, non-cluttered look.
🎨 Total Visual Control
Independent Labels: Every VWAP label (Daily, Weekly, etc.) can have its own color, position, and offset.
Visibility Toggles: Easily toggle individual VWAP lines or specific corridor fills on/off to suit your strategy.
Modern UI: Clean, auto-updating price labels prefixed with "VWAP" for instant clarity.
🛠️ How to Use
Identify Value: Use the standard deviation corridors to spot potential reversals or trend continuations.
Contextualize Trend: Observe how the shorter-term VWAP interacts with Monthly or Yearly levels to gauge overall market sentiment.
Customize: Head to the "Settings > Inputs" tab to adjust the transparency of the corridors or change the label colors to match your favorite theme.
Perfect for day traders and swing traders looking for a professional-grade VWAP toolkit. مؤشر
