PS BBPT Zero-X Lines (Select Any BBPT Line)During RTH only, script draws green or red lines on Bull Bear Power Trend indicator to show when the "Trend" crosses above or below zeroPine Script® indicatorby philscharf881
Hedge Model Pro Forex Volatility StructureThe Hedge Model is a structured Forex market indicator designed to identify compression, expansion, and controlled volatility shifts. This tool is built around structural behavior — not prediction. It highlights: • Compression zones • Expansion breaks • Structural shift points • Controlled execution areas • Defined visual trade mapping The model is designed for traders who prefer: ✔ Structured decision-making ✔ Risk-defined environments ✔ Clean chart visualization ✔ Repeatable execution logic This is not a signal spam indicator. This is a framework for understanding market structure. Works across major and cross Forex pairs on multiple timeframes. No repainting. No hindsight plotting. No curve fitting. Structured. Controlled. Consistent.Pine Script® indicatorby TruthakaWallStreetakaCookie21112
AG Pro Market Regime MeterOverview / What it does The AG Pro Market Regime Meter is a chart-first context and diagnostics tool designed to classify the current market environment. It evaluates price action across three separate dimensions: Trend Strength, Chop Risk, and Volatility. By providing an on-chart HUD (Heads-Up Display) and optional regime shift markers, it helps traders visualize whether the market is in a directional trend, a choppy range, or undergoing volatility expansion/contraction. Unique Edge Unlike traditional indicators that compress market context into a single oscillator line, this script isolates the three core pillars of market structure. It does not generate buy or sell signals. Instead, its unique edge lies in combining efficiency ratios, directional movement, and true range measurements to output a multi-axis regime classification. This prevents the blending of distinct market behaviors, allowing for clearer regime-based playbook selection. Methodology (Conceptual) The script processes market context through three distinct calculation engines: 1. Trend Strength: Blends a persistence measure (Efficiency Ratio calculating net movement vs. total movement) with normalized directional movement (ADX derived from DMI) to score directional structure. 2. Chop / Whipsaw Risk: Uses a Choppiness-style logic comparing the sum of True Range against the absolute High-Low range, inversely weighted with trend strength to assess fakeout probability. 3. Volatility Regime: Normalizes the current ATR percentage (ATR relative to close price) against a historical lookback window (default 100 periods) to classify structural expansion or contraction. The engine then outputs rule-based LOW/MID/HIGH threshold bands for each axis and generates a final heuristic Regime Summary. Signals and Alerts This script is a context tool and does not produce predictive trading signals or alerts. - Regime Shift Markers: The script plots optional visual markers on the chart when the heuristic Regime Summary changes (e.g., TREND to RANGE). - Confirmation: To prevent intrabar flickering, shift markers are evaluated and locked in strictly on confirmed bar closes. Anti-clutter algorithms (minimum bars apart, ATR-based offsets) are applied to keep the chart clean. How to Use Apply the indicator to evaluate if your intended trade setup matches the current market environment: 1. Trend HIGH + Chop LOW: Indicates structural direction. Favorable for trend-following logic and pullback entries. 2. Chop HIGH: Indicates elevated whipsaw probability. Warrants caution, size reduction, or mean-reversion tactics. 3. Volatility Check: High volatility suggests wider swings (requiring wider stops), while low volatility suggests contraction and potentially slower breakouts. 4. Use the HTF Peek row in the HUD to ensure the current timeframe regime aligns with the higher timeframe structure. Limitations and Transparency - This is strictly a contextual layer, not a standalone trading system. It does not provide entries or exits. - The LOW/MID/HIGH classifications are heuristic baseline measurements. They may require parameter tuning depending on the specific asset class, timeframe, and baseline volatility profile. - The HTF Peek row uses the request.security function. Depending on the current bar state, higher timeframe context data may fluctuate until the actual higher timeframe bar closes. Risk Disclosure Trading involves significant risk of capital loss. This script is provided strictly for educational and informational purposes and does not constitute financial or investment advice. Always evaluate liquidity, slippage, and your own account constraints, and employ strict risk management.Pine Script® indicatorby AGProLabs25
EMA and Dow Theory Strategies V3Overview EMA and Dow Theory Strategies V3 is a major refinement of V2, focused on three goals: reducing overfitting, filtering out range-bound markets, and simplifying the parameter set from 13 inputs down to just 5. The core logic remains the same — combining Dow Theory swing structure with EMA trend direction — but V3 replaces the dual-EMA crossover system and OTHERS.D correlation filter with a single EMA slope judgment and an ADX-based range filter. The result is a cleaner, more robust strategy that performs more consistently across different assets and timeframes. What Changed from V2 Removed: Fast EMA / Slow EMA crossover → replaced by single EMA slope direction Index Fast EMA / Index Slow EMA (OTHERS.D correlation) → removed entirely RSI filter (overbought/oversold) → removed (was not functioning effectively) Scale adjustment parameter → removed Added: ADX filter (period fixed at 14) → skips entries during sideways/ranging markets Single EMA slope judgment → trend direction determined by whether EMA is rising or falling Result: Parameters reduced from 13 → 5 Parameters & Recommended Ranges EMA Period | Default: 50 | Range: 30–100 Shorter for high-volatility assets, longer for stable ones. ATR Multiplier | Default: 4.0 | Range: 2.5–6.0 Controls TP distance. Higher = wider targets. Stop Loss (%) | Default: -6.0 | Range: -4 to -10 Wider for volatile assets, tighter for BTC/ETH. ADX Threshold | Default: 18.0 | Range: 15–28 Higher = stricter range filter, fewer but higher-quality trades. Swing Detection Period | Default: 4 | Range: 2–14 Smaller = more sensitive to swing highs/lows. Recommended Settings by Asset Type Meme coins (DOGE, SHIB, etc.) EMA: 44–55 / ATR: 3.5–5.0 / SL: -6 to -8% / ADX: 18–22 / Swing: 3–5 Major assets (BTC, ETH) EMA: 55–80 / ATR: 2.5–4.0 / SL: -4 to -6% / ADX: 20–25 / Swing: 5–10 Mid-cap alts (SOL, SUI, etc.) EMA: 35–55 / ATR: 4.0–5.5 / SL: -5 to -7% / ADX: 18–23 / Swing: 4–7 Small-cap alts EMA: 30–50 / ATR: 4.5–6.0 / SL: -7 to -10% / ADX: 18–22 / Swing: 3–5 Recommended Settings by Timeframe 1–5 min: ADX threshold 15–20 (ADX tends to be lower on short timeframes) 15 min – 1 hour: ADX threshold 18–23 2–4 hour: ADX threshold 20–25 Entry Conditions Long: EMA slope rising AND Dow Theory trend up AND ADX > threshold Short: EMA slope falling AND Dow Theory trend down AND ADX > threshold Exit Conditions TP1: +ATR×1 → close 30% TP2: +ATR×2 → close 30% TP3: +ATR×3 → close 30% Stop Loss: fixed % from entry price → full close Trend reversal: Dow Theory swing flip → full close Visual Features EMA line: green when rising, red when falling Gray background: ADX below threshold (range-bound zone — no entries) Gradient zones: distance from price to swing high/low 4H reference: higher timeframe swing levels displayed This strategy is designed for trend-following on crypto assets, primarily on the 1H–4H timeframe. Always backtest on your target asset before live trading. Past performance does not guarantee future results. 🇯🇵 日本語 EMA and Dow Theory Strategies V3 概要 EMA and Dow Theory Strategies V3 は、V2を大幅に改良したバージョンです。主な改善点は3つ——過学習リスクの低減、横ばい相場のフィルタリング、そしてパラメーター数を13個から5個へのスリム化です。 コアロジックはV2から引き継いでいます。ダウ理論のスイング構造とEMAのトレンド方向を組み合わせてエントリーを判断します。ただしV3では、デュアルEMAクロスとOTHERS.D相関フィルターを廃止し、1本のEMA傾きとADXによるレンジフィルターに置き換えました。結果として、より汎用性が高く、異なる銘柄・時間足でも安定して機能する設計になっています。 V2からの主な変更点 削除したもの: Fast EMA / Slow EMA クロス → EMA1本の傾き判断に統合 Index Fast EMA / Index Slow EMA(OTHERS.D相関)→ 完全削除 RSIフィルター(過熱・売られすぎ判定)→ 削除(実質機能していなかったため) スケール調整パラメーター → 削除 追加したもの: ADXフィルター(期間14固定)→ 横ばい相場でのエントリーをスキップ EMA傾き判断 → EMAが上向きか下向きかでトレンド方向を判定 結果:パラメーター数を 13個 → 5個 に削減 パラメーターと推奨設定範囲 EMA期間 | デフォルト: 50 | 推奨範囲: 30〜100 ボラが高い銘柄は短め、安定銘柄は長め。 ATR倍率 | デフォルト: 4.0 | 推奨範囲: 2.5〜6.0 TP距離の基準。大きいほど利確ラインが遠くなる。 損切り(%) | デフォルト: -6.0 | 推奨範囲: -4〜-10 ボラが高い銘柄は広め、BTC/ETHはタイトでOK。 ADXしきい値 | デフォルト: 18.0 | 推奨範囲: 15〜28 高いほどレンジ除外が厳しく、トレード数が減り精度が上がる。 スイング検出期間 | デフォルト: 4 | 推奨範囲: 2〜14 小さいほどスイング高値・安値への感度が高くなる。 銘柄タイプ別おすすめ設定 ミーム系(DOGE・SHIBなど) EMA: 44〜55 / ATR倍率: 3.5〜5.0 / 損切り: -6〜-8% / ADX: 18〜22 / スイング: 3〜5 主要銘柄(BTC・ETH) EMA: 55〜80 / ATR倍率: 2.5〜4.0 / 損切り: -4〜-6% / ADX: 20〜25 / スイング: 5〜10 中堅アルト(SOL・SUIなど) EMA: 35〜55 / ATR倍率: 4.0〜5.5 / 損切り: -5〜-7% / ADX: 18〜23 / スイング: 4〜7 小型アルト EMA: 30〜50 / ATR倍率: 4.5〜6.0 / 損切り: -7〜-10% / ADX: 18〜22 / スイング: 3〜5 時間足別おすすめ設定 1〜5分足:ADXしきい値 15〜20(短期足はADXが低めになる傾向) 15分〜1時間足:ADXしきい値 18〜23 2〜4時間足:ADXしきい値 20〜25 エントリー条件 ロング:EMAが上向き AND ダウ理論トレンドが上昇 AND ADX > しきい値 ショート:EMAが下向き AND ダウ理論トレンドが下降 AND ADX > しきい値 イグジット条件 TP1:エントリーから +ATR×1 → 30%決済 TP2:エントリーから +ATR×2 → 30%決済 TP3:エントリーから +ATR×3 → 30%決済 損切り:設定%を超えたら全決済 トレンド反転:ダウ理論のスイングが逆転したら決済 チャートの見方 EMAライン:上向きのとき緑、下向きのとき赤に色が変わります グレー背景:ADXがしきい値を下回っている横ばいゾーン(このゾーンではエントリーしません) グラデーションゾーン:現在値からスイング高値・安値までの距離を視覚化 上位足表示:4時間足のスイングレベルを参考表示 このストラテジーは主に1時間〜4時間足の暗号資産トレンドフォローを想定して設計されています。実運用の前に必ずご自身の対象銘柄・時間足でバックテストを行ってください。過去の結果は将来の利益を保証するものではありません。Pine Script® strategyby mm_mitsuya26
Time ORB [AlgoRich]What does this script do? This indicator is a Time-Based Open Range Breakout (ORB) tool. It monitors price action during a specific user-defined time window, identifies the high and low of that period, and then projects those levels forward as actionable breakout zones. Key Features: Calculation Modes: You can choose to calculate the range based on Wicks (high/low) or Candle Bodies (open/close) depending on your strategy's sensitivity. Extension Limit: To prevent chart clutter, the script includes an "Extension End Time." Once this time is reached, the levels and signals are disabled for the day. Signal Logic: Breakout Alerts: It triggers "Buy" or "Sell" labels when a candle closes outside the established range. Reversal (Second Entry): It has a built-in feature to catch a second breakout if the first move was a "fakeout" and the price reverses to the opposite side. Timezone Management: Includes a UTC offset input to ensure the range aligns perfectly with local market opening hours. How to trade it: Bullish Breakout: Look for long entries when price closes above the Top Line. Bearish Breakout: Look for short entries when price closes below the Bottom Line. Equilibrium: The center line acts as a "fair value" or a target/neutral zone.Pine Script® indicatorby AlgoRichPRO104
EURUSD Volatility Compression Breakout v1.0 Overview The EURUSD Volatility Compression Breakout (VCB Pro) is a momentum-volatility hybrid indicator designed to detect explosive breakout moves after periods of market compression. Financial markets move in cycles: 🔹 Expansion → 🔹 Contraction → 🔹 Expansion This indicator identifies when the market is “coiling” (low volatility compression) and signals when real expansion begins — filtering out weak or fake breakouts. It is optimized for EURUSD intraday volatility behavior, especially during London and New York sessions. ⚙️ How The Indicator Works (Step-By-Step Logic) 1️⃣ Trend Bias Filter (Directional Context) The indicator uses a 100 EMA to define directional bias: • Price above EMA → Bullish environment • Price below EMA → Bearish environment This prevents counter-trend breakout trades and increases probability alignment with macro flow. 2️⃣ Volatility Compression Detection The system measures compression using: • Bollinger Band Width • ATR (Average True Range) Compression is detected when: • Bollinger Bands narrow significantly • ATR falls below its moving average This indicates: ✔ Reduced volatility ✔ Liquidity building ✔ Energy accumulation ✔ Market “coiling” The background turns blue during compression phases to visually highlight pressure zones. 3️⃣ Expansion Detection After compression, the indicator waits for: • ATR spike (volatility expansion) • Large candle body (momentum confirmation) This ensures the breakout is driven by strong orderflow — not random price noise. 4️⃣ Breakout Confirmation A breakout signal triggers only when: ✔ Previous candle was in compression ✔ Current candle shows expansion ✔ Price closes outside Bollinger Bands ✔ Direction aligns with EMA trend This 4-layer confirmation drastically reduces false signals. 📊 What The Signals Mean 🟢 BREAKOUT BUY Indicates: • Volatility expansion upward • Bullish momentum confirmed • Price breaking upper range • Trend aligned Best used during: • London Open • NY Open • High impact session volatility 🔴 BREAKOUT SELL Indicates: • Volatility expansion downward • Bearish momentum confirmed • Price breaking lower range • Trend aligned Best used during: • News volatility • Session opens • Post-compression breakdowns 💎 Key Benefits of This Indicator ✅ 1. Detects Explosive Moves Early It identifies the transition from quiet accumulation to aggressive expansion. ✅ 2. Filters Fake Breakouts Most breakout traders fail because they trade inside compression. This indicator waits for confirmed expansion. ✅ 3. Trend-Aligned Entries Prevents emotional counter-trend trading. ✅ 4. Works Extremely Well on EURUSD EURUSD often compresses during Asian session and expands during London. This indicator is structured around that behavior. ✅ 5. Non-Repainting Logic Signals only confirm after candle close. No repainting. No hindsight bias. ✅ 6. Clean & Professional Chart No clutter. Minimal shapes. Clear background compression zones. 🔥 Final Summary This is not a basic Bollinger Band breakout. ✔ Volatility cycle ✔ Momentum shift ✔ Trend alignment ✔ Pressure build-up ✔ Real expansion It is designed to trade movement — not noise.Pine Script® indicatorby Mentor_Michael032
Improved EMA Trend + ATR Strategy with ArrowsThis strategy is built around a simple idea: strong directional moves often begin after periods of low volatility. Instead of chasing trends late, it waits for price compression and then trades the breakout when expansion begins. The approach combines volatility structure and trend alignment to reduce random entries. Core Concept Markets cycle between quiet phases and expansion phases. When volatility contracts, it often leads to a stronger move once price breaks out of that range. This strategy attempts to capture that transition. How It Works 1. Volatility Compression Detection A squeeze condition is identified when Bollinger Bands contract inside Keltner Channels. This signals reduced volatility. 2. Squeeze Release The strategy waits for volatility to expand again. Trades are only considered when the squeeze ends. 3. Breakout Confirmation Entries occur when price breaks above or below the Bollinger Bands after the squeeze release. 4. Trend Alignment A long-term EMA is used to filter direction: Above EMA → bullish bias Below EMA → bearish bias This helps reduce counter-trend trades. 5. Risk Management Stop-loss and take-profit levels are based on ATR. This allows exits to adapt to current market volatility. A configurable risk-to-reward ratio defines profit targets. Key Features Structured volatility-based entries Trend confirmation filter ATR-based dynamic risk control Commission and slippage included for realistic testing No repainting logic Best Conditions This type of strategy tends to perform better during: Volatility expansion phases Strong directional markets Assets that experience compression before breakouts It may underperform in slow, range-bound environments. Important Notes This strategy is designed for research and backtesting purposes. Performance will vary across different markets and timeframes. Always evaluate across multiple conditions before considering live deployment.Pine Script® strategyby AIScripts24
StO Price Action - Trend HeatmapShort Summary - Displays multi-timeframe market bias as a color heatmap table - Aggregates bullish and bearish candles per timeframe - Visual intensity reflects directional dominance Full Description Overview - Analyzes up to 10 selectable timeframes simultaneously - Counts bullish and bearish candles per timeframe - Evaluates a configurable number of historical candles - More bullish candles increase green intensity - More bearish candles increase red intensity - Neutral or mixed conditions appear visually balanced - Outputs results in a compact on-chart table Method - Designed to visualize multi-timeframe alignment - Provides instant directional context across intraday to macro levels - Uses candle color logic as momentum proxy - Helps identify trend stacking or timeframe divergence - Clean table layout with adjustable screen position Timeframe Structure - Supports custom selection of up to 10 timeframes - Intraday and higher timeframes can be mixed freely - Each timeframe can be enabled or disabled individually - Works with built-in available timeframes Usage - Select which timeframes to include - Set how many candles to evaluate per timeframe - Position the table on the chart as preferred - Use strong color clustering as confirmation tool - Watch for mixed colors as early warning of conflict Notes - Does not predict reversals, only shows directional dominance - Particularly useful for top-down analysis - Designed as bias confirmation, not as entry triggerPine Script® indicatorby sto_svcUpdated 8
Auto S/R Channels [WillyAlgoTrader]Auto Support & Resistance Channels is an overlay indicator that algorithmically discovers the highest-quality ascending and descending price channels by evaluating pivot-point combinations, scoring each candidate by how well price is contained within it, and monitoring the active channels for breakouts and boundary reactions in real time. Channel drawing is one of the most subjective tasks in technical analysis — two traders rarely agree on where the lines should go. This indicator removes that ambiguity: it systematically tests dozens of pivot-pair combinations, builds a trendline + parallel for each, computes a containment ratio (what percentage of bars fit inside), and displays only the best-fitting result. The channel then becomes a live framework — the script detects breakouts when price closes through a boundary, identifies wick-based reactions (bounces) at support and resistance, fires categorized alerts, and automatically replaces stale channels when new pivots produce a superior fit. 🔍 WHAT MAKES IT ORIGINAL 1. Containment-ratio scoring across 40+ candidates. For each direction (ascending and descending), the algorithm evaluates up to 40 pivot-pair combinations (8 most recent pivots × 5 preceding pivots). For each pair it constructs the full channel — base trendline through the two anchors, parallel through the most extreme opposing pivot — then scans up to 300 bars, counting how many bars have their entire range (low to high) inside the channel with a tolerance of 5% ATR. The ratio of contained bars to total bars is the quality score. Only the candidate that scores highest above the minimum threshold (default 55%) is drawn. A new channel replaces the current one only when it scores at least 70% of the existing score AND its base pivots are actually different — preventing cosmetic redraws when the same pivots simply refine their quality metric. 2. Dual-direction parallel search. Both ascending and descending channel searches run on every new pivot (whether it's a high or a low). This ensures neither direction goes stale — a bug common in channel tools that only re-evaluate one direction per pivot type. Both channels can coexist on the chart, naturally capturing wedges, converging structures, and transitional markets. 3. Three-event signal classification. — Breakout : close beyond the boundary with crossover verification (previous bar was inside or within 1.5× ATR) — React : wick touches a boundary (within 12% ATR) but close + open remain inside — a bounce/rejection — Aggregate : events from both channels combine into Buy / Sell / Wait (e.g., react at ascending support = Buy; breakout below descending support = Sell) Each event type has its own alert toggle, so you can subscribe only to the signals you care about. 4. Five anti-phantom-signal guards. — Max extrapolation : no detection beyond maxChannelBars past the second base pivot — Crossover check : previous close must have been within 1.5× ATR of the boundary — no phantom signals when a new channel is drawn behind price that already moved away — Smart flag reset : on channel rebuild, breakout flags reset only if price is currently inside the new channel (direction-agnostic boundary test) — Change-gate : labels and flags are only cleared when the channel's base pivots actually change — if the same two pivots refine their quality score, existing signals are preserved — Full label cleanup : when a channel does change, all labels from the previous version are deleted — no stale artifacts 5. Per-component line styling. Base line, parallel line, and midline each have independent width and style (solid / dashed / dotted). Combined with configurable fill transparency, extension mode (none / right / both), and separate bull/bear colors, the visual output adapts to any chart style. ⚙️ HOW IT WORKS Pivot detection: Swing points are identified with ta.pivothigh() and ta.pivotlow() using the configured lookback length. Up to 40 recent pivots of each type are stored. Pivots lag by N bars — standard for all pivot-based tools. Ascending channel construction: Pairs of pivot lows where the second is higher than the first (rising slope) and separated by Min–Max Channel Bars define candidate base trendlines. For each pair, the script scans all stored pivot highs within the channel's time span and selects the one with the greatest positive offset from the base — this becomes the parallel (resistance boundary). The channel width equals the maximum perpendicular distance from base to the highest opposing pivot. Descending channel construction: Mirror logic: pairs of pivot highs with falling slope define the base. The lowest opposing pivot low sets the parallel (support boundary). Quality scoring: Each candidate is scored by iterating up to 300 bars: a bar is "contained" if low ≥ lower boundary − 5% ATR AND high ≤ upper boundary + 5% ATR. The containment ratio (contained / total) is the quality score. The best candidate above the threshold wins. A replacement requires ≥70% of the current score AND different base pivot bars — this balance allows channels to evolve with the market while preventing noise-driven flickering. Breakout detection: On every confirmed bar (barstate.isconfirmed), both channel boundaries are interpolated at the current bar index. For an ascending channel: bullish breakout fires when close > parallel AND close ≤ parallel + 1.5× ATR; bearish breakout when close < base AND close ≥ base − 1.5× ATR. Descending channels use mirrored logic with direction-agnostic boundary identification. Breakout flags prevent duplicate signals until price re-enters the channel. React detection: A support reaction triggers when the bar's low penetrates the support boundary within 12% ATR tolerance, but the close and open remain above it — a classic wick rejection. Resistance reaction uses the same logic at the upper boundary. 📖 HOW TO USE Reading the chart: — Green channel = ascending (bullish bias) — base from pivot lows, parallel through the highest high — Red channel = descending (bearish bias) — base from pivot highs, parallel through the lowest low — Midline = channel equilibrium (50%) — frequently acts as intra-channel support/resistance — "Breakout ▲" / "Breakout ▼" = confirmed close beyond a channel boundary — Dashboard shows: Trend / Signal (Buy/Sell/Wait) / Strength / Quality % / Active Channels Trading approach: — In an ascending channel: look for long entries at base reactions (support bounces), take profit or watch for rejection at the parallel (resistance). A bullish breakout above the parallel may indicate trend acceleration. — In a descending channel: look for short entries at base reactions (resistance rejections), cover at the parallel (support). A bullish breakout above the base signals a potential trend reversal. — The midline often acts as an intermediate decision level — watch for stalls and direction changes there. — Higher Quality % = more bars historically contained = stronger structural validity. — When both channels are active simultaneously, the market is likely forming a wedge or converging structure — the directional breakout from whichever channel breaks first typically signals the next move. Timeframe guidance: — Scalping (1–15min): Pivot Length 3–7, Min Channel Bars 10–20, Quality 0.45–0.55 — Intraday (1H–4H): Pivot Length 8–15, Min Channel Bars 20–50, Quality 0.55–0.65 — Swing (Daily+): Pivot Length 15–30, Min Channel Bars 30–100, Quality 0.6–0.8 ⚙️ KEY SETTINGS REFERENCE — Pivot Length (default 21): bars left/right for swing detection — higher = fewer, stronger pivots — ATR Length (default 14): tolerance, crossover guard, and quality calculations — Min Channel Bars (default 10): minimum distance between the two base pivots — Max Channel Bars (default 400): maximum lookback for pivot pairs and extrapolation limit for signal detection — Min Channel Quality (default 0.55): minimum containment ratio — higher = stricter, fewer channels — Extend Channels (default Right): project lines beyond anchor pivots (Right / Both / None) — Delete Previous (default On): clean up old drawings and labels when a new channel forms — Show Breakout Label (default On): display Breakout ▲/▼ labels on the chart — Show Midlines (default On): 50% equilibrium line inside each channel — Show Channel Fill (default On): subtle fill between boundaries — Fill Transparency (default 95): 80–99 — higher = more transparent 🔔 Alerts Three independent, toggleable alert types: — Breakout : price closes outside a channel boundary (all five guards active) — Signal : aggregated Buy/Sell from combined channel events — React : wick rejection at a channel boundary All alerts support standard TradingView text and optional JSON webhook format for 3Commas, Alertatron, or custom bot integrations. ⚠️ IMPORTANT NOTES — Breakout and react signals require bar-close confirmation — they do not repaint after the bar closes. — Channels will update when new pivots produce a higher-quality fit with different base points. This is by design — the indicator always shows the best available channel. All previous drawings and labels are cleaned up automatically on change. — This is a structural analysis and event-detection tool . It maps the dominant price channel and monitors boundary interactions — it does not predict whether breakouts will follow through or reactions will hold. — Past channel containment does not guarantee future price behavior within the same structure. — Works across all asset classes and timeframes. No volume data required.Pine Script® indicatorby WillyAlgoTrader355
Adaptive Volatility Trend [WillyAlgoTrader]Adaptive Volatility Trend (AVT) is a trend-following overlay indicator that dynamically adjusts its sensitivity to market conditions using the Kaufman Efficiency Ratio and ATR-based volatility bands. Unlike static moving averages or fixed-width channels, AVT continuously adapts: it accelerates in strong directional moves and slows down during choppy, range-bound price action — reducing whipsaws where most trend indicators fail. 🔍 WHAT MAKES IT ORIGINAL The core innovation is a self-tuning mechanism built on three adaptive layers: 1. Kaufman Efficiency Ratio (ER) as an adaptive engine. The ER measures how "efficient" price movement is — the ratio of net directional change to total path traveled over N bars. An ER near 1.0 means price moved in a clean straight line (strong trend); near 0.0 means it went sideways with lots of noise. AVT uses the smoothed ER to dynamically blend between a fast constant (2-period EMA speed) and a slow constant (30-period EMA speed), producing an Adaptive Moving Average that responds quickly in trends and becomes sluggish in chop. 2. ER-scaled ATR bands. The volatility channel doesn't just use raw ATR × multiplier. It incorporates the Efficiency Ratio to narrow the bands during trending conditions (where ER is high) and widen them during ranging markets (where ER is low). This means the channel contracts when the trend is clean — keeping signals tight — and expands when price is noisy — filtering out false breakouts. 3. Composite Signal Scoring System (0–100). Every signal receives a quality score based on three weighted components: — Trend strength (0–40 pts): derived from the Efficiency Ratio magnitude — Momentum (0–30 pts): RSI distance from the neutral 50-level in the signal direction — Volume confirmation (0–30 pts): current volume relative to its 20-period average Only signals exceeding the user-defined minimum score threshold are displayed — letting you filter out low-conviction setups. ⚙️ HOW IT WORKS Trend detection: The indicator calculates an Adaptive Moving Average using the Kaufman method. The slope of this line determines trend direction: if the line rises by more than 5% of current ATR, the trend is classified as bullish; if it falls by the same threshold, bearish. A small dead zone (ATR × 0.05) prevents noise from flipping the trend. Signal generation: A BUY signal fires when: — Trend flips from bearish/neutral to bullish (slope turns positive) — Price is above the adaptive line — RSI is not in overbought territory (if RSI filter is enabled) — Volume exceeds its moving average × threshold (if volume filter is enabled; auto-disabled on forex) — Composite score meets the minimum threshold — Bar is confirmed (close-based, no repainting) SELL signals use the mirror logic. Anti-repaint compliance: All signals require barstate.isconfirmed — they only trigger on the close of the bar and never change on historical data. A warmup period (minimum 50 bars or 2× Trend Length) prevents unreliable early signals. Volume filter on forex: The indicator automatically detects instruments with no volume data (common on forex pairs) and bypasses the volume filter for those symbols, so it works seamlessly across asset classes. 📖 HOW TO USE Reading the chart: — Green trend line + upward slope = bullish regime — Red trend line + downward slope = bearish regime — Yellow trend line = neutral / transitioning — ▲ labels below bars = confirmed BUY signal — ▼ labels above bars = confirmed SELL signal — The shaded channel around the trend line shows volatility-adjusted support/resistance zones Quick-start presets: — Conservative (Length 30 / ATR 20 / Mult 2.5): fewer signals, higher reliability — suited for swing trading on 4H–Daily — Default (Length 20 / ATR 14 / Mult 2.0): balanced for most timeframes — Aggressive (Length 12 / ATR 10 / Mult 1.5): more signals — suited for 15min–1H — Scalping (Length 8 / ATR 7 / Mult 1.2): fast response — optimized for 1–5min charts Signal quality: Use the Score value in the dashboard to gauge conviction: — 70–100: strong trend + momentum + volume alignment — 40–69: moderate setup, consider additional confluence — Below threshold: signal filtered out (not shown) Dashboard panel: Displays current trend direction, last signal with its score, Efficiency Ratio %, RSI value, timeframe, and indicator version. Position is adjustable to any corner of the chart. Alerts & automation: Supports both standard TradingView alert messages and JSON webhook format for integration with 3Commas, Alertatron, or custom bots. Alert messages include ticker, price, timeframe, and signal score. ⚙️ KEY SETTINGS REFERENCE — Trend Length (default 21): lookback for adaptive MA — higher = smoother, lower = faster — ATR Length (default 14): period for volatility bands — higher = wider bands — Band Multiplier (default 2.0): ATR multiplier for channel width — higher = fewer false signals — RSI Filter (on by default): blocks buy signals when RSI > 70, sell signals when RSI < 30 — Volume Filter (on by default): requires volume > SMA(20) × 1.2 — auto-disabled on forex — Min Signal Score (default 40): minimum composite score for signal display — Efficiency Smoothing (default 5): EMA smoothing of the Kaufman ER ⚠️ IMPORTANT NOTES — This indicator does not use future data. No lookahead, no repainting. — Past performance shown on any chart does not guarantee future results. — AVT is a tool for identifying trend direction and generating signal candidates — it is not a complete trading system. Always use proper risk management and consider additional confluence before entering trades. — The indicator works best in trending markets. In prolonged sideways conditions, even filtered signals may produce whipsaws — the Efficiency Ratio in the dashboard helps you assess whether the current market is trending enough for signal reliability.Pine Script® indicatorby WillyAlgoTrader22499
Trend Velocity Channel [BackQuant]Trend Velocity Channel Overview Trend Velocity Channel is a trend and momentum-acceleration overlay built around one idea, trend strength is the gap between a fast “lead” average and a slow “lag” average . When the lead line pulls away from the lag line, the market is accelerating in that direction. When that gap collapses, trend energy is fading and reversals become more likely. Instead of using a single moving average slope or crossover, this indicator measures: A leading trend line (DEMA) that reacts quickly. A lagging trend line (slower EMA) that represents slower consensus value. A normalized “velocity / crush” metric: the distance between them in ATR units . A trend regime based on the sign of that velocity. A dynamic channel defined by the lead line on one side and a padded lag boundary on the other. A reversal level engine that marks flip bars and tracks retests and invalidations. The result is a channel that visually answers: Are we accelerating or decelerating? How strong is the current acceleration relative to recent history? Where is the “danger edge” where a reversal would be confirmed? Which flip levels remain relevant and which got invalidated? Concept: lead vs lag as a proxy for trend velocity Markets trend when price doesn’t just move, it keeps moving faster than the slow baseline can follow . If a fast estimator (lead) separates from a slow estimator (lag), that separation is a practical proxy for “velocity”: Lead above lag, bullish acceleration. Lead below lag, bearish acceleration. Lead converging back into lag, trend energy compressing. This script calls that separation Crush , meaning the lead line is “crushing away” from the lag line. Core components 1) Leading line: DEMA The lead line is a Double Exponential Moving Average: dema = DEMA(price, maLen) Why DEMA: It reduces lag relative to a standard EMA. It reacts faster to genuine directional moves. It still smooths noise enough to act as a structural line. DEMA is used as the “inner” channel edge and the glow anchor. 2) Lagging line: Slow EMA The lag line is a slower EMA: lagMA = EMA(price, round(maLen * 1.5)) Why a slower EMA: It represents a slower-moving consensus baseline. It creates a meaningful “gap” against the lead line. It is less sensitive to micro-chop, so separation signals are cleaner. The lag line also becomes the basis for the channel’s outer edge. 3) Volatility normalization: ATR Raw MA distance is not comparable across regimes. A 50-point gap might be huge in a low-vol market and nothing in a high-vol market. So the gap is normalized by ATR: atr = ATR(14) rawCrush = (dema - lagMA) / atr Interpretation: rawCrush = “how many ATRs the lead line is away from the lag line.” This standardizes the signal across instruments and volatility states. 4) Crush smoothing The gap can still jitter, especially in choppy markets. So it is EMA-smoothed: crush = EMA(rawCrush, crushSmth) Lower crushSmth: Faster regime flips, more noise. Higher crushSmth: More stable regimes, slower reaction. Trend regime and flips Trend direction is derived directly from the sign of the smoothed crush: trend = crush > 0 ? +1 : -1 flip = trend != trend Meaning: Bull regime: lead (DEMA) is above lag baseline in ATR units. Bear regime: lead is below lag baseline. Flip: the velocity sign changed, meaning acceleration has switched direction. This is not a price crossover system, it is a lead-lag separation regime system . Measuring strength: crushNorm The script also grades how extreme current crush is relative to recent conditions: crushAbs = abs(crush) crushHigh = highest(crushAbs, 80) crushNorm = crushHigh > 0 ? min(crushAbs / crushHigh, 1) : 0 Interpretation: crushNorm near 0 means separation is small relative to recent extremes, trend is weak or compressing. crushNorm near 1 means separation is near the largest seen recently, trend acceleration is strong. This strength scale drives: Color intensity (gradient) Glow width “Peak Crush” alert condition Channel construction Inner edge The inner edge is the leading line: inner = dema This is the “fast structure” of the move. Outer edge The outer edge is built from the lag line plus an ATR padding: outer = (bull) lagMA - atr * chanPad outer = (bear) lagMA + atr * chanPad This is important. The lag line sits behind price, so the script offsets it outward by a user-defined fraction of ATR. This creates a more realistic boundary that accounts for volatility. Interpretation: In bull regimes, the outer boundary is below lagMA, creating a support-like corridor beneath price. In bear regimes, the outer boundary is above lagMA, creating a resistance-like corridor above price. The channel is intentionally asymmetric This channel is not “± ATR around a mean.” It is directional: Inner edge hugs price via fast DEMA. Outer edge is anchored to lagMA and padded outward. So it behaves like a trend corridor where: The inner edge shows where the trend is currently “being pulled.” The outer edge shows the boundary where the trend would be meaningfully compromised if crossed. Ribbon fill (3-layer depth) Two midpoints are created between inner and outer: mid1 = inner + (outer - inner) * 0.33 mid2 = inner + (outer - inner) * 0.66 Then the fill is layered: inner → mid1 (most opaque) mid1 → mid2 mid2 → outer (most transparent) This creates a depth effect that visually communicates where price is sitting within the corridor. When the corridor is tight and strong, the ribbon looks concentrated. When it expands, the ribbon spreads and fades. Color logic (trend + strength) The indicator uses a gradient color where direction sets the palette and crushNorm sets intensity: Bull: faint green → strong green as crushNorm increases Bear: faint red → strong red as crushNorm increases This means you can read two things instantly: Direction (bull vs bear) Acceleration strength (faded vs intense) Glow engine on DEMA Glow width scales with ATR and crushNorm: glowW = atr * 0.07 * (0.5 + crushNorm) So: High acceleration = larger glow, more “energy” around the lead line. Low acceleration = smaller glow. Glow is built as multiple invisible plots above and below DEMA with layered fills, forming a halo around the lead line that encodes strength. Flip-aware band breaking The outer boundary line is broken on flips: bandBrk = flip ? na : outer plot(..., plot.style_linebr) This prevents a misleading continuous line across regime changes, since the outer edge swaps sides on flip. Crush reversal levels (flip levels engine) This script includes a level system that plants a dashed horizontal level on every regime flip, then tracks: Whether price retests it (first touch marker) Whether price invalidates it (deletes it) How long it extends forward How many levels are kept 1) Level placement On a flip: If trend flips bullish, the level is placed at the flip bar’s low. If trend flips bearish, the level is placed at the flip bar’s high. That makes sense structurally: Bull flip low is a “pivot low” candidate. Bear flip high is a “pivot high” candidate. Then a dashed line is drawn forward ~60 bars. 2) Level storage and maxLvls Levels are stored in an array and capped by maxLvls. When the cap is exceeded, the oldest is deleted. This keeps the chart readable. 3) Level invalidation (broken logic) Each level is monitored: Bull flip level breaks if price closes far below it: close < level - atr * 2.5 Bear flip level breaks if price closes far above it: close > level + atr * 2.5 This is a volatility-scaled invalidation. If price pushes through a flip level by a large margin in ATR terms, it’s no longer acting like a meaningful reaction point. 4) Retest detection A “touch” is detected when: close is within 0.25 ATR of the level, and close two bars ago was not close (distance > 0.5 ATR), and the level hasn’t been marked retested yet. On first retest, an “x” marker is printed and the level’s retested flag is set to true so it won’t spam. What these levels represent They are not generic support/resistance. They are regime pivot levels created by a change in lead-lag acceleration. In practice: Untested flip levels can act like “memory zones” where price may react. Retested levels become less special, still relevant but not “naked.” Invalidated levels are removed to reduce noise. Signals and alerts The script provides: Crush Bull: flip into bullish regime (crush crosses above 0 via smoothing logic) Crush Bear: flip into bearish regime Peak Crush: crushNorm > 0.85, meaning separation is near recent max, strong acceleration Important: Peak Crush is not a reversal call. It flags strong trend energy. That can precede continuation or exhaustion, you use it as context, not a standalone trade trigger. How to use it Trend following framework Stay aligned with the regime color. In bull regime, treat the outer boundary as the “structure floor.” In bear regime, treat the outer boundary as the “structure ceiling.” The inner DEMA is your fast guide, the outer edge is your compromise boundary. Acceleration read Increasing color intensity and thicker glow imply acceleration is strengthening. Fading color and shrinking glow imply acceleration is decaying and the move is losing energy. A regime flip is a clean state change, not a micro-signal. Using reversal levels Treat naked flip levels as potential reaction zones. Watch first retest behavior, clean rejection suggests the flip level is holding. If the level invalidates by 2.5 ATR, it’s removed because structure has been overwritten. Key inputs explained MA Length (maLen) Sets both the lead line length and the lag line length (scaled by 1.5). Lower values: More sensitive, more flips. Higher values: Smoother, fewer flips, slower response. Crush Smoothing (crushSmth) Controls stability of the velocity signal. Lower: Fast flips, noisier regime. Higher: More confirmation, later flips. Channel Padding (chanPad) Controls how much extra ATR space is added beyond lagMA. Higher padding: Wider channel, fewer boundary touches. Lower padding: Tighter boundary, more reactive “risk edge.” Max Levels Controls how many historical flip levels are retained. Summary Trend Velocity Channel treats trend as lead-lag separation expressed in ATR units. A fast DEMA tracks the active move, a slower EMA defines baseline value, and their normalized gap (Crush) defines both direction and acceleration strength . That strength drives an adaptive visual language (gradient color, glow width, ribbon depth). The channel itself is directional, with the lead line as the inner edge and a volatility-padded lag boundary as the outer edge, acting as a structural “compromise line.” On every regime flip the script plants a pivot level, tracks retests, and deletes invalidated levels, giving you a clean map of acceleration-based reversal zones.Pine Script® indicatorby BackQuant577
Multi-Index VWAP DashboardTo post this on the TradingView Community Scripts, you want a description that highlights its multi-instrument correlation and institutional session data. It’s not just a VWAP indicator; it’s a "Tape Reading" dashboard for index traders. Here is a structured description you can copy and paste: Description Overview The Multi-Index Institutional VWAP Dashboard is a high-performance Tape Reading tool designed for NQ, ES, and YM traders. It provides a real-time "at-a-glance" matrix of how the three major US Indices are performing relative to critical institutional benchmarks. Instead of cluttering your main chart with dozens of lines, this dashboard compiles the data into a clean, Bookmap-inspired UI. Key Benchmarks Tracked The dashboard monitors price action for NQ, ES, and YM against: NY VWAP: Anchored specifically to the New York Open (09:30 AM ET). PD NY VWAP: The closing value of the previous day's New York session VWAP—a major level for institutional mean reversion. LOD/HOD Anchored VWAP: Dynamic VWAPs that re-anchor automatically to the current Day's High and Day's Low. 15m Opening Range (OR): Detects if price is trading Inside, Above (▲), or Below (▼) the first 15 minutes of the NY session. Trend Matrix: A real-time momentum filter for each index to identify cross-market divergence. Features Bookmap Style Visuals: Uses custom bubble icons (◎) for a modern, heat-map aesthetic. Timezone Optimized: Hard-coded for New York Session hours while respecting your local chart offset. Customizable Layout: Full control over dashboard position (Top/Bottom/Corners) and text sizing to fit any monitor resolution. Cross-Index Correlation: Easily spot "SMT Divergence" (e.g., when NQ is above its NY VWAP but ES is below it). How to Use Bullish Confirmation: Look for "All Green" bubbles across all three indices, specifically price holding above the NY VWAP and OR High. Mean Reversion: Use the PD NY VWAP and HOD/LOD VWAP as targets or areas of interest for potential reversals. Trend Divergence: If NQ is showing "Bullish" while YM is showing "Bearish," exercise caution as the indices are decoupled. Settings Tips Position: Move the dashboard to the "Bottom Right" if you have other indicators at the top. Style: Toggle between "Solid," "Bubble," or "Ring" icons in the script settings to match your chart's theme.Pine Script® indicatorby bansheecapital13
Mentor Michael - Adaptive Regime Pro v1.0📌 Professional Entropy-Based Adaptive Trend System | Gold Optimized Mentor Michael – Adaptive Regime Pro v1.0 is a professional-grade adaptive trend engine designed to automatically adjust to changing market conditions using entropy-driven volatility modeling. This system is engineered especially for XAUUSD (Gold), where price behavior shifts rapidly between expansion and compression phases. Instead of using fixed moving averages or static volatility bands, this indicator dynamically adapts smoothing and structure based on real-time market regime detection. The result is a clean, professional trend framework that measures both direction and quality. 🧠 Core Engine – Entropy-Based Market Regime Detection At the heart of the system is an entropy calculation derived from: • Logarithmic return dispersion • Standard deviation vs mean normalization • Controlled scaling between 0 and 1 This produces a normalized entropy value representing market uncertainty. Low Entropy → Structured, directional market High Entropy → Choppy, mean-reverting market The system uses this value to drive all adaptive components. 📊 Adaptive EMA (Dynamic Smoothing Model) Unlike traditional EMAs with fixed smoothing constants, this system modifies the alpha coefficient dynamically. When entropy is high: • EMA becomes more reactive • Adjusts faster to noise When entropy is low: • EMA becomes smoother • Better at riding sustained trends This prevents lag during breakouts while avoiding overreaction during consolidation. 📦 Dynamic Volatility Bands (Dual Structure Model) Two ATR-based envelopes are built around the adaptive EMA: Inner Bands (Fast Reaction Zone) Used for detecting regime shifts. Price closing above inner upper band → Bullish regime Price closing below inner lower band → Bearish regime Outer Bands (Volatility Expansion Zone) Track broader volatility expansion and serve as structural references. Band width scales automatically based on trend strength. Stronger trend → Wider bands Choppy market → Narrower bands This creates a volatility-aware structure instead of static channels. 🎯 Trend State Logic The script maintains internal trend memory to avoid signal flickering. A regime shift only occurs when price confirms beyond the inner band. • Bullish Trend • Bearish Trend • Neutral State This produces cleaner trend transitions and professional-level stability. 💪 Signal Strength Meter (0–100) Signal Strength = (1 − Normalized Entropy) × 100 This converts volatility behavior into a measurable percentage. High Score → Clean directional conditions Low Score → Compression or indecision Instead of guessing trend quality, you see it numerically. 🖥 Trend Dashboard Panel The built-in dashboard (top-right corner) displays: • Current Trend State • Signal Strength (%) • Entropy (%) The panel updates in real time and can be toggled ON/OFF. Designed for fast visual decision-making without clutter. 🎨 Visual Structure • Adaptive color-coded EMA • Dynamic layered volatility fills • Optional bar coloring • Controlled transparency for clean overlays • Professional layout for live trading environments The structure is designed to look premium and readable across all timeframes. 🔔 Alert System Built-in alert conditions trigger on: • Bullish Regime Shift • Bearish Regime Shift Alerts activate only when confirmed regime transitions occur. Suitable for: • Manual execution • Automation • Session monitoring ⚙️ Input Parameters Explained Entropy Lookback Controls regime sensitivity. Lower values increase responsiveness. Higher values produce smoother macro trends. Fast Band Multiplier Controls inner band width (signal sensitivity). Slow Band Multiplier Controls outer band width (volatility envelope scale). Visual Controls Custom colors, transparency, dashboard toggle, and bar coloring options. 💎 Optimized for XAUUSD (Gold) Gold trends strongly but consolidates sharply. This adaptive entropy structure is specifically tuned to handle that expansion-compression behavior. Recommended for XAUUSD 4H: Lookback: 22–28 Fast Multiplier: 1.6–1.9 Slow Multiplier: 3.2–3.8 Also performs well on: • BTCUSD • Major Forex pairs • Indices ✅ Ideal For • Trend-following traders • Swing traders • Volatility regime analysis • Confluence with Order Blocks / FVG / Liquidity Sweeps • Gold and Crypto trading 🔥 What Makes This Different? Most indicators use: • Fixed smoothing • Static ATR bands • No regime awareness Adaptive Regime Pro: • Measures entropy in real time • Dynamically adjusts smoothing • Scales volatility structure • Quantifies trend strength objectively • Maintains stable regime memory It is not just a moving average —It is a volatility-aware adaptive regime system. ⚠️ Disclaimer This script is provided for educational and analytical purposes only. It does not provide financial or investment advice. Always apply proper risk management.Pine Script® indicatorby Mentor_Michael0325
EMA xPair [crlmx]EMA indicator pair with smooth gradient fill. Timeframe adjustable to fixed value or follow the chats. Key Features - Two configurable EMAs (default 8 / 24 on day TF) - 15 reference timeframes from 1min to Monthly - Gradient fill between EMAs - colour tracks the dominant line - Midline between the two EMAs - acts as a dynamic centre reference - Streamlined inputs / UI brought to you by crlmx Trading Applications - Use as trend filter, not entry trigger - Gradient fill enhances visual read on trend bias - Midline acts as support/resistance between the two EMAs - Daily 8/24 works across all instruments and timeframes - Daily 30/50 gives a very solid HTF trend signal across assets for swing / position trading - Recommended Settings Scalping (fast): EMA1: 8 | EMA2: 24 | TF: 1min | Chart: 1m–5m Scalping: EMA1: 8 | EMA2: 24 | TF: 3–5min | Chart: 1m–5m Day Trading: EMA1: 8 | EMA2: 24 | TF: Day | Chart: 15m–1H Swing Trading: EMA1: 30 | EMA2: 50 | TF: Day | Chart: 4H–1D Version History v1.21 (Latest - 23 Feb 2026) - Gradient fill between EMAs with transparency control - 15 reference timeframes (1min to Monthly) - Midline defaults to off Pine Script® indicatorby crlmx8
Adaptive Trend RegimeAdaptive Trend Regime Adaptive Trend Regime is a market regime detection indicator designed to identify whether the market is trending bullish, trending bearish, or moving sideways. The indicator combines EMA alignment, ADX trend strength, and EMA slope momentum to filter market noise and highlight only meaningful directional movement. Instead of reacting to every price fluctuation, this tool focuses on detecting sustained market conditions. ━━━━━━━━━━━━━━━━━━ How It Works Fast and Slow EMAs determine market direction. ADX measures trend strength and filters ranging markets. EMA slope confirms momentum and removes weak trends. Volatility-adjusted zones adapt dynamically using ATR. The background zone changes color depending on market regime: 🟢 Bullish Trend — Strong upward momentum 🔴 Bearish Trend — Strong downward momentum 🟡 Range — Low momentum or consolidation ━━━━━━━━━━━━━━━━━━ Parameters Fast EMA Length Controls short-term market direction sensitivity. Slow EMA Length Defines the broader trend structure. ADX Threshold Minimum trend strength required to classify the market as trending. Higher values produce more conservative signals. Slope Dead Zone (%) Filters small EMA movements considered market noise. Increasing this value reduces false trend detection. Slope Lookback Number of bars used to calculate EMA slope momentum. ATR Multiplier Controls the size of the displayed trend zone relative to market volatility. ━━━━━━━━━━━━━━━━━━ Best Usage • Trend-following strategies • Market regime filtering • Trade confirmation • Avoiding low-momentum environments Works across all markets and timeframes. ━━━━━━━━━━━━━━━━━━ Notes This indicator does not provide buy or sell signals. It is intended to help traders understand market conditions and trade in alignment with prevailing momentum. Pine Script® indicatorby ferCV4
Strategic Trend FilterStrategic Trend Filter (STF) | MisinkoMaster Strategic Trend Filter is a structurally weighted trend confirmation overlay designed to identify high-quality directional environments while filtering out low-volatility noise and weak structural movement. Rather than relying on traditional moving averages, STF constructs a dynamically weighted equilibrium level derived from multiple price components and structural factors. It then validates trend conditions only when price displacement is supported by sufficient volatility expansion. The result is a disciplined trend filter that emphasizes structural strength over simple price crossing behavior. Core Philosophy Many trend tools respond primarily to price direction. STF goes further by incorporating: • Structural correlation behavior • Statistical dispersion • Rate-of-change magnitude • Price range positioning • Volatility confirmation This multi-factor structure allows the filter to respond only when price movement demonstrates internal coherence and sufficient expansion. In short, STF is designed to confirm quality trends, not just directional movement. Key Features Multi-factor structural weighting model Dynamic equilibrium filter instead of traditional moving average Volatility-confirmed trend validation Volume-aware filter stabilization Median-based volatility confirmation Automatic trend coloring Optional on-chart long and short labels Overlay design for direct price interaction Reduced whipsaws in low-volatility environments Suitable as a directional bias filter for strategies How It Works (Conceptual) The indicator builds a composite equilibrium level using several internal components: Structural Correlation Measures how individual price components relate to the composite price structure over the lookback window. Statistical Dispersion Standard deviation measurements help evaluate how far price is distributing around equilibrium. Momentum Magnitude Absolute rate-of-change calculations measure directional displacement strength. These components are combined into weighted factors that influence how much each price dimension contributes to the final filter value. The resulting filter represents a dynamic structural equilibrium rather than a simple average. Additionally, a volatility confirmation layer compares current true range behavior against its median condition. Trend state changes are validated only when sufficient volatility is present. Proprietary weighting relationships remain protected in the invite-only implementation. Trend Logic Explained Bullish State Activated when price structure holds above the dynamic filter and volatility confirms expansion. This suggests sustained upward pressure supported by structural alignment. Bearish State Activated when price structure remains below the filter and volatility confirms expansion. This indicates organized downside movement rather than random fluctuation. If volatility contracts or price fails to maintain structural positioning, the filter avoids unnecessary state changes. Volume Stabilization Mechanism When volume declines relative to the previous bar, the filter stabilizes temporarily. This reduces sensitivity during participation drops, helping avoid false transitions caused by thin liquidity conditions. This feature improves robustness in lower-liquidity assets and during session transitions. Visual Components Dynamic Filter Line Represents structural equilibrium and adjusts continuously to price behavior. Color-Coded Environment Filter and candles change color to reflect bullish or bearish state. Shaded Region A filled zone between price and filter visually highlights directional dominance. Optional Long / Short Labels When enabled, transition points are clearly marked on the chart. Inputs Overview Lookback Period Controls the primary structural evaluation window. Higher values create smoother, more stable filters. Lower values increase responsiveness. Confirmation Length Defines the volatility median window used for expansion validation. Allow Labels? Enables or disables on-chart long and short markers. Parameter Tuning Guidance Shorter Lookback → Faster adaptation → More sensitive to structural shifts → Suitable for lower timeframes Longer Lookback → More stable equilibrium → Better for swing or position trading Shorter Confirmation Length → Faster volatility confirmation → More reactive signals Longer Confirmation Length → Stricter volatility validation → Fewer but stronger transitions Best Use Cases Directional bias filter for breakout systems Confirmation layer for momentum strategies Trend qualification before position scaling Volatility-aware trade filtering Multi-timeframe bias alignment Portfolio-level environment scanning Strategy Integration Ideas Use STF to: • Trade only in the direction of confirmed trend state • Avoid mean-reversion setups during strong structural expansion • Filter out low-volatility consolidation phases • Improve win rate by aligning entries with structural bias STF performs best when paired with entry triggers such as pullbacks, continuation patterns, or momentum expansions. Summary Strategic Trend Filter is a structurally weighted, volatility-confirmed overlay designed to detect organized directional movement while filtering weak or noisy price action. By combining correlation structure, dispersion metrics, momentum magnitude, and volatility validation, STF delivers a disciplined trend confirmation framework suitable for discretionary traders and systematic strategy developers alike.Pine Script® indicatorby MisinkoMasterUpdated 99221
Directional Logistic Oscillator | GainzAlgoOverview The Directional Logistic Oscillator (DLO) is a momentum-based indicator designed to measure directional market strength and identify potential trend reversals or mean-reversion opportunities. It builds on the classic Directional Movement Index (DMI) by transforming its components (+DI, -DI, and ADX) into probabilistic signals using logistic functions, then combining them into a bounded oscillator that oscillates between approximately -1 and +1. Unlike traditional oscillators like RSI or MACD, DLO emphasizes directional probability by estimating the likelihood of bullish or bearish dominance while factoring in overall trend strength (via ADX). This makes it particularly useful for: Spotting overbought/oversold conditions in ranging markets. Confirming trend shifts in trending markets. Generating reversal signals based on oscillator cycles. The oscillator is plotted as histogram bars (columns) for visual clarity, with color-coding to highlight strength and direction. Positive values indicate bullish momentum, negative values bearish, and crossings of key levels can signal trading opportunities. How It Works At its core, DLO processes DMI data through a logistic transformation to create "probabilities" of directional movement: 1. DMI Calculation : Uses the standard DMI with a user-defined length (default 14) to compute +DI (upward movement), -DI (downward movement), and ADX (trend strength). 2. Logistic Probability : Each DMI component is normalized against its long-term mean and passed through a logistic (sigmoid) function. This creates smooth probabilities between 0 and 1. The logistic function is defined as: logistic_prob(series, mean_lb, slope, smooth_len) => mean = ta.sma(series, mean_lb) z = (series - mean) * slope prob_raw = 1.0 / (1.0 + math.exp(-z)) ta.ema(prob_raw, smooth_len) This step makes the indicator adaptive to market conditions, with the "slope" controlling how sharply it reacts to deviations from the mean. 3. Net Directional Strength : Bullish minus bearish probability, scaled by ADX probability and a user-defined multiplier, then bounded using a hyperbolic tangent (tanh) function to keep values between -1 and +1. net_dir = prob_plus - prob_minus strength_raw = net_dir * prob_adx * osc_scale strength_bound = tanh(strength_raw) Tanh ensures smooth, bounded output without clipping extremes unnaturally. 4. Smoothing and Signals: The raw strength is smoothed with EMA, then further processed into SMA and EMA lines for signal generation. Percentile-based thresholds (adaptive over a lookback period) detect extreme zones for mean-reversion signals. The result is a visually intuitive oscillator: Green bars for bullish, red for bearish, with varying intensity based on momentum. Inputs DLO offers customizable settings grouped for ease of use. Defaults are tuned for balanced performance on daily charts. DMI Settings DI Length (default: 14): Controls DMI sensitivity. Shorter lengths react faster to price changes but add noise; longer lengths smooth signals for trends. Mean Lookback (default: 360): The period for calculating the long-term average of DMI components. Higher values provide a more stable baseline, reducing false signals from short-term volatility. Lower values make the indicator more responsive but noisier Difference between high and low mean lookback period, lower length can pick up on new trends faster but at the cost of increased noise. Logistic Probability Settings LR Slope (higher = steeper) (default: 0.18): Adjusts the steepness of the logistic curve. Lower values create gradual transitions (smoother oscillator); higher values make sharp shifts, emphasizing extremes. Probability Smoothing (EMA) (default: 3): Short EMA to reduce noise in probabilities. Keep low (1-5) for responsiveness; higher for smoothness. Oscillator Settings Oscillator Scale (pre-tanh) (default: 2.5): Multiplies net strength before bounding. Higher values increase sensitivity and amplitude (larger swings); lower values compress the range for subtler signals. Comparison of 4 different settings for Oscillator scale, showing that as the scale parameter increases, the oscillator output becomes more pronounced, exhibiting higher amplitude compression toward the bounds and spending more time saturated near the extreme values of +1 and −1. Oscillator Smoothing Length (default: 7): Period for SMA/EMA smoothing of the final oscillator. Longer = smoother, fewer signals; shorter = more reactive. Color & Display Settings Buy Color / Sell Color: Customize colors for bullish/bearish visuals. Plot Reversion Signals (default: true): Shows arrows for cycle reversals (local highs/lows). Plot Mean-Reversion Signals (default: true): Arrows for crossings from extreme percentile zones. Plot Oscillator MA (default: false): Overlays an SMA on the oscillator for additional confirmation. Allow Intrabar Updating (default: true): Enables real-time updates within incomplete bars (may cause minor repainting). Visuals Oscillator Histogram: Columns colored green (bullish) or red (bearish), with lighter shades for weaker momentum. Crosses above/below zero signal momentum shifts. Horizontal Lines: Zero (neutral), +0.5 (strong bullish), -0.5 (strong bearish). Background Highlights: Subtle green/red shading when in strong zones. Bar Colors: Mirrors oscillator direction on the price chart. Color-coded trend regimes: green/teal highlight strong and weak uptrends, red/purple mark strong and weak downtrends, while the oscillator histogram confirms direction and strength through its polarity and amplitude. Signals Mean-Reversion (MR) Signals : Triangles (▲/▼) when the smoothed oscillator crosses up from low percentiles (oversold) or down from high percentiles (overbought). These are adaptive, using historical data for dynamic extremes. Buy: Oscillator crosses above lower threshold (e.g., 10th/5th percentile). Sell: Crosses below upper threshold (e.g., 90th/95th percentile). Reversion Signals : Arrows (⬆/⬇) at local turning points in the oscillator cycle, indicating potential reversals. Zero-Line Crosses : Basic bullish/bearish momentum changes. Usage Tips Trend Confirmation: Use in trending markets—persistent positive/negative values confirm up/down trends. Pair with moving averages for entries. Mean-Reversion: In sideways markets, trade MR signals from extremes. Combine with support/resistance. Divergences: Look for price making new highs/lows while DLO doesn't for reversal setup. Alerts MR Buy/Sell: Extreme zone crosses (percentile-based). Reversion Up/Down: Cycle turning points. Osc Bullish/Bearish Cross: Zero-line crosses. Limitations Like all oscillators, DLO can lag in strong trends or produce false signals in choppy markets, use with confirmation. Percentile thresholds adapt over time but may vary by asset volatility. Not a standalone system; always combine with risk management. Pine Script® indicatorby GainzAlgoUpdated 7878749
Multi-Type Moving AverageMulti-Type Moving Average is a flexible moving average indicator that allows users to switch between EMA, SMA, WMA, VWMA, and SMMA from a single line. It also includes optional Bollinger Bands when using SMA, making it suitable for both trend-following and volatility-based analysis. Designed to be lightweight, clean, and easy to use on any market or timeframe.Pine Script® indicatorby lahonglam2
True Baseline Median SuperTrendTrue Baseline Median SuperTrend (TBM SuperTrend) | MisinkoMaster True Baseline Median SuperTrend is a volatility-adaptive trend indicator designed to refine traditional SuperTrend logic by introducing a volatility-filtered baseline and median-based smoothing techniques. Instead of relying on a fixed midpoint calculation, TBM SuperTrend dynamically constructs its baseline from structurally significant price observations, then applies layered median smoothing to reduce noise while preserving trend integrity. The result is a cleaner, more stable trend-following tool that reacts to meaningful shifts in volatility and directional pressure without excessive whipsaws. Core Philosophy Most SuperTrend-style indicators anchor their bands to a simple price midpoint and apply an ATR-based offset. While effective, this approach can be overly sensitive during volatile consolidations. TBM SuperTrend improves this structure by: • Building a volatility-qualified baseline • Filtering insignificant price movements • Applying median smoothing instead of simple averaging • Retaining ATR-based adaptive band distance This creates a trend structure that prioritizes meaningful price expansion over random noise. Key Features Volatility-qualified baseline construction Median-smoothed upper and lower bands ATR-based adaptive volatility envelope Dynamic trend state detection Automatic candle coloring Clear long and short transition labels Reduced whipsaw behavior compared to standard SuperTrend Works across intraday and higher timeframes Designed for trend continuation and breakout frameworks How It Works (Conceptual) The indicator operates in three structural layers: Volatility Measurement Market volatility is assessed using an ATR-based structure. Baseline Construction Instead of averaging all recent prices, the script filters price samples based on volatility conditions. Only structurally relevant bars contribute to the baseline calculation. This ensures that the baseline reflects meaningful movement rather than passive drift. Median Smoothing Both the volatility-adjusted bands and the baseline structure undergo median smoothing. Median smoothing is less sensitive to outliers than standard averaging, which helps stabilize the trend line during erratic price spikes. After the adaptive bands are constructed, price interaction with those bands determines directional bias: • Price closing above the upper threshold confirms bullish trend state • Price closing below the lower threshold confirms bearish trend state Internal implementation details remain proprietary in the protected version. Trend Logic Explained Bullish State When price maintains strength above the adaptive upper boundary, the indicator confirms a long bias. The trailing structure shifts beneath price, acting as dynamic support. Bearish State When price closes below the adaptive lower boundary, the indicator confirms a short bias. The trailing structure shifts above price, acting as dynamic resistance. State transitions occur only when decisive boundary breaks happen, helping reduce false flips. Visual Components Trend Lines Only the active directional band is displayed, reducing clutter and emphasizing current bias. Shaded Volatility Zone A filled region between price and the active band visually highlights trend dominance. Long / Short Labels Clear on-chart labels mark confirmed trend transitions. Candle Coloring Price candles automatically reflect current trend state for immediate visual recognition. Inputs Overview Source Defines the price series used for baseline construction. ATR Length Controls the volatility lookback period. True Baseline Length Determines the window used for constructing the volatility-qualified baseline. Factor Adjusts the volatility multiplier that expands or contracts the adaptive bands. Median Period Controls the median smoothing strength applied to the bands. Lower values increase responsiveness. Higher values improve stability and reduce noise. Why Median Smoothing Matters Traditional smoothing methods (like EMA or SMA) can be distorted by sharp price spikes. Median-based smoothing reduces the impact of extreme values, making TBM SuperTrend particularly effective in: • Crypto markets • High-volatility equities • News-driven instruments • Lower timeframe trading This improves structural consistency during sudden volatility expansions. Best Use Cases Trend-following systems Breakout confirmation Pullback entries within established trends Trailing stop framework Directional bias filtering Volatility-adaptive strategy design Parameter Tuning Guidance Shorter ATR Length → Faster adaptation → More sensitivity → Suitable for intraday trading Longer ATR Length → Smoother volatility structure → Better for swing trading Higher Factor → Wider bands → Fewer signals → Stronger trend confirmation Lower Factor → Tighter bands → Earlier entries → More reversals Longer Median Period → Smoother band structure → Reduced whipsaws Shorter Median Period → Faster reaction → More sensitivity to shifts Practical Strategy Integration Use TBM SuperTrend as: • Primary directional filter • Trailing stop mechanism • Confirmation layer for breakout systems • Bias alignment tool across multiple timeframes It performs best when combined with momentum confirmation or volume expansion tools. Summary True Baseline Median SuperTrend enhances traditional SuperTrend logic by introducing volatility-qualified baseline construction and median smoothing for structural stability. The result is a cleaner, more adaptive trend tool that prioritizes meaningful price movement while minimizing noise. It is well suited for traders seeking a disciplined, volatility-aware trend framework that remains robust across changing market conditions.Pine Script® indicatorby MisinkoMaster1111738
Tema RSI Return + Trend + Impulse FilterTEMA 9 RSI Return + Trend & Impulse Filter This indicator combines Triple EMA momentum, RSI-style normalization, slope confirmation, and ATR-based impulse filtering to produce structured, non-repainting trade signals. It is designed for traders who want disciplined entries aligned with trend strength and volatility expansion. 🔍 Core Logic Structure • TEMA (Triple EMA) for responsive trend detection • Slope confirmation to validate directional bias • Normalized oscillator (0–100 scale) for return-from-extreme logic • Upper & lower band re-entry structure • ATR impulse filter to confirm candle strength • Confirmed-bar logic (no repainting signals) 🧠 Signal Flow Oscillator reaches extreme level Market structure aligns with TEMA slope Impulse candle confirms volatility expansion Signal prints on confirmed bar close This layered filtering reduces weak reversals and low-momentum entries. ⚙ Recommended Usage • Lower timeframes (M1 / M5) • Gold (XAUUSD) • Major Forex pairs • High volatility trading sessions This script is intended for analytical and educational purposes only. Risk management remains the trader’s responsibility. Custom Pine Script development & indicator-to-strategy conversion available via profilePine Script® indicatorby yower_Pinescript58
Delta Ladder Order Flow [UAlgo]Delta Ladder Order Flow is an overlay order flow visualizer that builds a per bar delta ladder using lower timeframe candles as an intrabar proxy. For each recent bar, the script pulls the underlying lower timeframe open, high, low, close, and volume arrays, then distributes volume into discrete price buckets. Each bucket accumulates estimated buy volume and sell volume, producing a ladder that resembles a footprint style view. The display focuses on three core outputs: A delta heatmap ladder where each price level is colored by net delta dominance A Point of Control highlight that marks the highest total volume level inside the bar A stacked imbalance detector that scans diagonally across levels to identify aggressive one sided participation and optionally projects that stack forward The system is designed with stability controls for real world chart conditions. It includes dynamic scaling to prevent excessive level counts on high range bars, object budgeting through bars to draw limits, and text filtering to reduce clutter. 🔹 Features 1) Intrabar Resolution via Lower Timeframe Data The ladder is constructed using request.security_lower_tf. You select an Intrabar Resolution timeframe that must be lower than the chart timeframe. The script then receives arrays of LTF candles for each chart bar and uses them as a proxy for footprint style aggregation. This approach provides a practical order flow approximation on TradingView charts without requiring native tick level data. 2) Ladder Aggregation with Tick Size Multiplier Price levels are aggregated using the symbol mintick multiplied by a user multiplier. Increasing the multiplier produces thicker ladder steps and fewer levels. Decreasing it produces finer granularity but increases the number of boxes drawn. This control is critical for balancing detail versus performance across different symbols and volatility regimes. 3) Dynamic Scaling to Prevent High Range Bar Overload A single volatile bar can contain too many price steps if the granularity is too fine. To prevent crashes, the script estimates how many steps would be required for the bar and increases the effective step size when the raw step count exceeds Max Levels per Bar. This keeps rendering stable even during high volatility events while still maintaining a consistent ladder representation. 4) Buy, Sell, and Neutral Volume Attribution Each LTF candle’s direction is inferred from its open and close: Close above open is treated as buy side volume Close below open is treated as sell side volume Close equal open is treated as neutral and split evenly between buy and sell Volume is then distributed across the price buckets covered by the LTF candle range so that wide candles spread their influence across multiple levels. 5) Delta Heatmap Ladder with Intensity Scaling Each price bucket computes delta as buy volume minus sell volume and total volume as the sum of both. Ladder cells are colored positive or negative based on delta sign, and transparency is scaled by how dominant the delta is relative to the maximum total volume level inside that bar. This yields a compact heatmap where strong imbalances visually stand out. A square root curve is applied to intensity to improve mid tone visibility without making everything fully opaque. 6) Point of Control Highlight The ladder tracks the price level with the highest total volume and marks it as the Point of Control. When enabled, the POC row uses a dedicated border color and a stronger border width so the acceptance anchor is immediately visible. 7) Stacked Imbalance Detection and Projection The script can detect stacked diagonal imbalances. It compares volume across adjacent price levels using a diagonal logic similar to footprint tools: Bullish diagonal checks buy volume at a level versus sell volume at the level below Bearish diagonal checks sell volume at a level versus buy volume at the level above An imbalance requires the winning side to exceed the losing side by the configured Imbalance Ratio and also exceed a minimum volume threshold to filter low volume noise. When consecutive imbalanced levels reach the Stacked Levels count, the stack is marked and optionally extended forward as a zone. Stack members also override normal heatmap coloring and are rendered more solid for emphasis. 8) Clean Visual Controls Several options support readability: Bars to Draw limits workload and object count Show Delta Values can be toggled on or off Min Delta to Show Text filters small prints Ladder Width percent controls how wide the ladder is relative to the bar space Text size can be adjusted for different chart zoom levels Box outline can be hidden by default for a cleaner footprint aesthetic 🔹 Calculations 1) Intrabar data acquisition (lower timeframe arrays) The script requests arrays of LTF OHLCV values for each chart bar using request.security_lower_tf. ltf_open = request.security_lower_tf(syminfo.tickerid, tf_input, open) ltf_close = request.security_lower_tf(syminfo.tickerid, tf_input, close) ltf_high = request.security_lower_tf(syminfo.tickerid, tf_input, high) ltf_low = request.security_lower_tf(syminfo.tickerid, tf_input, low) ltf_vol = request.security_lower_tf(syminfo.tickerid, tf_input, volume) These arrays contain the lower timeframe candles that make up each chart bar. Each chart bar index has its own embedded array. 2) Base tick step (bucket size control) Bucket size starts from mintick multiplied by Tick Size Multiplier. var float base_tick_step = syminfo.mintick * tick_size_mult This is the baseline price increment used to build the ladder levels. 3) Last bar execution model (performance design) The script only builds and draws ladders when barstate.islast is true. It then reconstructs the last N bars using an index offset. if barstate.islast int start_idx = math.max(0, bar_index - bars_to_draw + 1) for i = start_idx to bar_index int offset = bar_index - i float arr_o = ltf_open float arr_c = ltf_close float arr_h = ltf_high float arr_l = ltf_low float arr_v = ltf_vol This design dramatically reduces CPU and memory load compared to updating every bar. 4) Dynamic scaling per bar (anti crash protection) For each bar, the script estimates how many price steps would be needed using the current bucket size. If that count exceeds Max Levels per Bar, it increases the step size only for that bar. float bar_h = high float bar_l = low float bar_range = bar_h - bar_l float raw_steps = bar_range / base_tick_step int scaler = 1 if raw_steps > max_levels_per_bar scaler := int(math.ceil(raw_steps / max_levels_per_bar)) float current_tick_step = base_tick_step * scaler Result: Calm bars use fine granularity High range bars are automatically compressed into fewer buckets 5) LTF candle direction classification (buy, sell, neutral) Each LTF candle is classified using its open and close. Neutral candles split volume evenly. bool is_buy = c > o bool is_sell = c < o bool is_neutral = c == o This is a heuristic proxy for aggressor side. It is not true bid ask data. 6) Align LTF candle range to bucket grid The candle low and high are rounded to the current tick step so bucket prices align cleanly. float low_aligned = math.round(l / current_tick_step) * current_tick_step float high_aligned = math.round(h / current_tick_step) * current_tick_step 7) Step counting and volume per step The script computes how many bucket levels the candle touches and divides volume equally across them. int steps = int(math.round((high_aligned - low_aligned) / current_tick_step)) + 1 if steps > 500 steps := 500 float vol_per_step = v / steps This means wide candles distribute volume across more ladder cells, while tight candles concentrate volume into fewer cells. 8) Writing volume into the ladder map (PriceLevel storage) Each chart bar owns a DeltaLadder with a map of price to PriceLevel. Each PriceLevel stores buy and sell volume. Volume is added step by step. type PriceLevel float price float buy_vol = 0.0 float sell_vol = 0.0 type DeltaLadder int bar_idx map levels float min_price = 10000000.0 float max_price = 0.0 float max_vol_level = 0.0 float poc_price = na float poc_vol = 0.0 The add method updates volumes and also tracks max volume and POC: method add_volume(DeltaLadder this, float price, float vol, bool is_buy, bool is_neutral) => if not this.levels.contains(price) this.levels.put(price, PriceLevel.new(price)) PriceLevel lvl = this.levels.get(price) if is_neutral lvl.buy_vol += vol * 0.5 lvl.sell_vol += vol * 0.5 else if is_buy lvl.buy_vol += vol else lvl.sell_vol += vol float t = lvl.total() if t > this.max_vol_level this.max_vol_level := t if t > this.poc_vol this.poc_vol := t this.poc_price := price The main loop calls this method for each bucket level touched by each LTF candle: for p = 0 to steps - 1 float level_price = low_aligned + (p * current_tick_step) ladder.add_volume(level_price, vol_per_step, is_buy, is_neutral) 9) Delta and total volume formulas Delta and total are defined as methods on PriceLevel. method delta(PriceLevel this) => this.buy_vol - this.sell_vol method total(PriceLevel this) => this.buy_vol + this.sell_vol These values drive both coloring and POC selection. 10) Stacked imbalance detection (diagonal footprint logic) Prices are sorted so neighbor comparisons are correct. A stack_map stores whether each price belongs to a bullish or bearish stacked run. float prices = ladder.levels.keys() array.sort(prices) map stack_map = map.new() Diagonal comparisons: Bullish diagonal compares BuyVol at level i with SellVol at level below i minus 1 Bearish diagonal compares SellVol at level i with BuyVol at level above i plus 1 Bullish check includes a zero handling rule: if i > 0 float p_below = array.get(prices, i-1) PriceLevel lvl_below = ladder.levels.get(p_below) if lvl_below.sell_vol == 0 if lvl.buy_vol > imb_min_vol direction := 1 else if lvl.buy_vol > lvl_below.sell_vol * imb_ratio and lvl.buy_vol > imb_min_vol direction := 1 Bearish check includes symmetric logic: if i < array.size(prices) - 1 float p_above = array.get(prices, i+1) PriceLevel lvl_above = ladder.levels.get(p_above) if lvl_above.buy_vol == 0 if lvl.sell_vol > imb_min_vol direction := -1 else if lvl.sell_vol > lvl_above.buy_vol * imb_ratio and lvl.sell_vol > imb_min_vol direction := -1 Runs are tracked and only accepted if the number of consecutive levels meets the stacked requirement: if math.abs(i - run_start_idx) >= stack_count for k = run_start_idx to i - 1 stack_map.put(array.get(prices, k), run_dir) The script also draws a projected zone for the detected stack band: box.new(right_time, p_top + current_tick_step/2, right_time + 1000 * 60 * 60 * 24, p_bot - current_tick_step/2, xloc=xloc.bar_time, border_width=0, bgcolor=color.new(c_stack, 85), extend=extend.right) 11) Heatmap intensity and transparency mapping For each price level, intensity is computed as abs(delta) relative to the maximum total volume level in the bar, then curved and mapped into transparency. float intensity = ladder.max_vol_level > 0 ? math.abs(delta) / ladder.max_vol_level : 0 intensity := math.min(intensity, 1.0) float curved_intensity = math.sqrt(intensity) float transp = 97 - (curved_intensity * 57) Stacked members force stronger visibility: if stack_map.contains(p) intensity := 1.0 transp := 30 12) POC marking in the drawing pass POC is detected during volume accumulation, then used in rendering to upgrade the border style for that cell. bool is_poc = show_poc and (p == ladder.poc_price) color border_c = is_poc ? col_poc : col_outline int border_w = is_poc ? 2 : 1 13) Delta text rendering filter Text labels are optional and can be filtered by a minimum absolute delta threshold. if show_text and math.abs(delta) >= text_threshold string txt = str.tostring(delta, format.volume) label.new(int((left_time + right_time)/2), p, txt, xloc=xloc.bar_time, style=label.style_none, textcolor=txt_col, size=text_size) Pine Script® indicatorby UAlgo297
Accumulation Zone Profiles [UAlgo]Accumulation Zone Profiles is an overlay indicator that detects low volatility accumulation phases and automatically builds a fixed range volume profile for each confirmed zone. The script uses a statistical volatility model based on log returns, identifies periods where volatility compresses into an unusually quiet regime, then verifies that price action remains sufficiently sideways before confirming the zone. When a zone is confirmed, the indicator draws two complementary views: A highlighted accumulation range on the chart A fixed range volume profile drawn to the right of the zone, including Point of Control and Value Area levels The intent is to turn consolidation into a structured map. Instead of treating ranges as vague rectangles, the script assigns a volume distribution to the range so you can see where the market accepted price, where it rejected price, and which levels are most likely to matter during expansion. 🔹 Features 1) Statistical Accumulation Detection Using Log Volatility The detection engine starts from log returns r = ln(C / C ) and builds an EWMA based volatility estimate. Volatility is converted into log space and evaluated with a rolling distribution model. A z score determines whether the current volatility is unusually low relative to its own history. Zones begin when the z score falls below a configurable entry threshold and they end after volatility recovers above an exit threshold for a configurable number of confirmation bars. 2) Sideways Quality Filter With Trend Score Not every low volatility period is true accumulation. The script measures drift using a trend score defined as: absolute sum of returns divided by sum of absolute returns Lower values indicate more rotation and less directional drift. A maximum trend score filter ensures zones remain meaningfully sideways before a profile is created. 3) Non Repainting Option Using Confirmed Bars When enabled, the system only updates on confirmed bars. This reduces repainting behavior and makes zone start and zone end decisions more stable for live trading workflows. 4) Fixed Range Volume Profile Per Zone For each confirmed accumulation zone, the script builds a histogram of volume across a user selected number of price rows. Each bar’s volume is distributed into bins according to how much of that candle range overlaps each bin. This produces a true fixed range profile for the zone. The profile is drawn to the right of the zone so it does not cover price action. 5) Point of Control and Value Area Levels The highest volume row is treated as the Point of Control. Value Area High and Value Area Low are computed by expanding outward from POC until a target percent of total volume is captured. This creates a practical acceptance framework inside the zone. Optional plotting allows: Highlighting the POC row Drawing VAH and VAL lines Drawing zone boundary guides Showing an information label that summarizes zone statistics 6) Tick Alignment For Clean Levels If enabled, the zone range, bin step size, and derived levels are aligned to the instrument tick size. This produces cleaner price levels and reduces floating point noise in labels and lines. 7) Object Budget Management Volume profiles use many boxes. The script computes an effective rows value based on the number of profiles you choose to keep, then limits total box usage so you are less likely to hit platform object limits. Older profiles are deleted automatically when new ones are created. 8) Alerts Two alerts are available: Accumulation Zone Started Accumulation Zone Confirmed and Profile Created This supports automation such as watchlist monitoring and breakout preparation. 🔹 Calculations 1) Log Return and EWMA Variance The script defines log return as ln(C / C ) and uses an EWMA of squared returns as a variance proxy. Alpha for EWMA: f_alpha(int len) => 2.0 / (len + 1.0) Log return: lr = math.log(close / close ) lr := na(close ) or close == 0.0 ? 0.0 : lr EWMA variance and volatility: alphaFast = f_alpha(fastLen) var float ewmaVarR = na ewmaVarR := na(ewmaVarR ) ? lr * lr : alphaFast * (lr * lr) + (1.0 - alphaFast) * ewmaVarR vol = math.sqrt(math.max(ewmaVarR, 0.0)) 2) Log Volatility Distribution and z Score Volatility is transformed into log space to stabilize distribution behavior. The script maintains EWMA estimates of mean and second moment, then computes standard deviation and z score. eps = 1e-10 logVol = math.log(vol + eps) alphaDist = f_alpha(distLen) var float m1 = na var float m2 = na m1 := na(m1 ) ? logVol : alphaDist * logVol + (1.0 - alphaDist) * m1 m2 := na(m2 ) ? logVol * logVol : alphaDist * (logVol * logVol) + (1.0 - alphaDist) * m2 sigma = math.sqrt(math.max(m2 - m1 * m1, eps)) z = (logVol - m1) / sigma Interpretation: Negative z means volatility is below its typical level More negative z means stronger compression 3) Zone Start and Zone End Conditions Entry and exit logic uses the z score relative to thresholds: Start when z is less than or equal to minus Enter Threshold End when z is greater than or equal to minus Exit Threshold for Exit Confirm Bars lowNow = not na(z) and z <= -enterZ highNow = not na(z) and z >= -exitZ Exit confirmation counter: zb.exitCount := highNow ? zb.exitCount + 1 : 0 bool exitByConfirm = zb.exitCount >= exitBars A maximum zone duration also forces closure: bool exitByMax = zb.barCount() >= maxZoneBars If exit is triggered via confirmation bars, the script removes those last bars from the zone before profiling to avoid contaminating the accumulation range with the volatility recovery phase. 4) Sideways Drift Score Filter During zone building, returns are accumulated: sumR is the signed drift sumAbsR is total movement magnitude Trend score: method driftScore(ZoneBuilder this) => math.abs(this.sumR) / math.max(this.sumAbsR, 1e-10) A zone is accepted only if: Bar count is at least Min Zone Bars Drift score is less than or equal to Max Trend Score 5) Profile Range and Row Step Once accepted, the profile range is built from the min low and max high of the zone. The range is optionally aligned to tick. Step size equals range divided by rows, with optional tick alignment: float stepRaw = (hi - lo) / rows float step = stepRaw if alignTick step := math.max(syminfo.mintick, f_roundToTick(stepRaw)) 6) Volume Histogram Construction For each bar in the zone, volume is assigned into bins. If the candle range is very small, volume goes to a single nearest bin. Otherwise, volume is distributed proportionally by overlap between candle range and each bin range. Core proportional distribution logic: float overlap = math.max(0.0, math.min(bh, binHi) - math.max(bl, binLo)) if overlap > 0 float frac = overlap / br array.set(binVol, b, array.get(binVol, b) + bv * frac) This produces binVol, a per row volume distribution. 7) POC Calculation POC is the index of the maximum bin volume. POC price is the center of that row. if v > maxV maxV := v pocIdx := b float poc = lo + (pocIdx + 0.5) * step 8) Value Area Computation Value Area is derived by expanding outward from POC until the cumulative volume reaches Value Area percent of total volume. Target volume: float target = totV * (valueAreaPct / 100.0) Expand left and right by choosing the side with higher next volume until the target is met. This creates a contiguous value area band. VAL and VAH mapping to prices: float valP = lo + left * step float vahP = lo + (right + 1) * step 9) Rendering Logic Zone highlight is drawn directly over the accumulation period using a box with configurable fill and border transparency. The volume profile is drawn as a stack of boxes to the right of the zone. Each row width is proportional to row volume relative to max row volume. Transparency is mapped so high volume rows appear more prominent. POC row can be highlighted using a dedicated color and transparency configuration. VAH and VAL can be drawn as horizontal lines across the profile region, and optional boundary lines can mark the start and end of the detected zone. 10) Profile Retention and Cleanup Profiles are stored in an array. When the number of stored profiles exceeds Keep Last Profiles, the oldest profile is deleted and all of its objects are removed. This keeps the chart responsive and prevents reaching the platform maximum object counts.Pine Script® indicatorby UAlgo11564
Price-Volume-Volatility Cube [LuxAlgo]The Price-Volume-Volatility Cube indicator provides a 3D visualization of the relationship between price, volume, and volatility using a Cabinet Oblique projection. By mapping these three critical market dimensions onto a normalized 3D space, the tool allows traders to observe how market conditions evolve and cluster within a specific lookback window. 🔶 USAGE The indicator renders a wireframe cube on the chart that represents the boundaries of the selected lookback period. Each data point within that period is plotted as a colored sphere inside the cube, creating a "cloud" that reveals the character of recent price action. 🔹 The 3D Axes The cube uses three distinct axes to position data points: Volume (X-Axis): Represents the relative volume of the bar. Points further to the right indicate higher relative volume. Volatility (Y-Axis): Represents the True Range (TR) of the bar, projected as depth. Points appearing "deeper" in the cube indicate higher volatility. Price (Z-Axis): Represents the closing price. Points higher up in the cube indicate prices closer to the period's high, while lower points represent prices near the period's low. 🔹 Interpreting the Data Path The current bar is highlighted with projection lines that connect its position to the floor and the individual axes. This helps you identify if the current market state is an outlier (e.g., high price, high volume, low volatility) or if it is sitting within a common cluster. The colors of the points transition from red (near the period low) to green (near the period high), providing an immediate visual cue for price location regardless of the cube's orientation. 🔶 DETAILS The script utilizes a Cabinet Oblique projection to transform 3D coordinates into 2D screen space. This specific projection preserves the proportions of the X and Z axes while scaling the Y (depth) axis by half at a 45-degree angle to maintain visual clarity. To maintain a consistent visual experience, the indicator automatically calculates the vertical height based on the Cube Base Width . This ensures the visualization maintains a perfect 1:1:1 aspect ratio, keeping the geometry as a true cube regardless of the user's horizontal scaling. Additionally, the vertical position of the cube is automatically handled to ensure the visualization remains centered and visible within the indicator pane. 🔹 Normalization To ensure the data fits perfectly within the cube, all values are normalized between 0 and 1 based on the minimum and maximum values found within the user-defined lookback period. This means the cube always represents the relative "range" of behavior over that specific window of time. 🔶 SETTINGS 🔹 Cube Settings Lookback Period: Determines the number of bars used to calculate the min/max values for normalization and the number of points rendered inside the cube. 🔹 Visuals Cube Base Width (Bars): Controls the horizontal scale of the cube in chart bars and automatically determines the height to maintain a 1:1:1 aspect ratio. 🔹 Position Horizontal Offset (Bars): Moves the cube left or right relative to the last bar.Pine Script® indicatorby LuxAlgo22179