FCP | Market Sessions | High Low Box & Range StatsMarks the Sydney, Tokyo, London and New York sessions, tracks each
one's high and low, and carries those levels forward to the next
session open.
WHAT IT DRAWS
• A shaded box spanning each session's time window and price range.
• High and low lines that extend to the next session's open.
• Range extension lines projected from the session high and low at
configurable multiples of the session range (0.5x, 1x, 2x by
default), with optional multiplier labels.
• A stats table showing each active session's current range as a
percentage of its own average range over the last N sessions.
Rows for disabled sessions are hidden.
HOW IT WORKS
Session boundaries and session extremes are not read from the chart's
candles. They are computed from 5-minute data through a lower-timeframe
request, so the levels are identical whether you are on a 15-minute
chart or a 4-hour chart. The chart is only the canvas.
The session in progress updates on every tick rather than on bar close,
so the box and its high and low lines follow price in real time.
SETTINGS
Session timezone — sessions are defined in this timezone, so the
windows stay fixed regardless of the symbol's exchange timezone.
Accepts a UTC offset (GMT+0, GMT+3) or an IANA name (Europe/London).
Look-back — how many past sessions to keep drawn.
Each session has its own on/off switch, time window, colour and line
width, so you can define custom windows instead of the defaults.
Range extensions — three independent multipliers; set any of them to
0 to hide one. Line style, width and transparency are adjustable.
Range stats — the averaging window, panel corner and text size.
NOTES
Works on timeframes up to and including 1 day. On higher timeframes
nothing is drawn.
Session times are fixed to the selected timezone and do not shift with
daylight saving time. If your sessions are defined in a DST-observing
timezone, adjust the windows twice a year or enter an IANA timezone
name. 지표

OBV Acceleration / DecelerationDescription:
Introduction
Classic On-Balance Volume (OBV) is a powerful tool for tracking smart money and volume flow. However, standard OBV relies on raw closing prices to determine whether volume was "bullish" or "bearish" for the day. This makes it highly susceptible to market noise, wicks, and fake-outs.
This open-source script, OBV Acceleration / Deceleration, rebuilds the OBV formula from the ground up. It filters price noise using a Fibonacci-weighted Master Average and introduces a Volume Kinetics engine to detect exactly when volume is accelerating (spiking) or decelerating (drying up)
How It Works: Core Logic & Features
This indicator is built on three core mechanical features. Here is the exact logic behind how they work:
1. The Fibonacci Master Average (Noise Filtering)
Instead of looking at the raw close price to decide if volume should be added or subtracted, this script calculates six separate Simple Moving Averages (SMAs) based on the first six numbers of the Fibonacci sequence (1, 1, 2, 3, 5, 8).
*The Logic: The script averages these six SMAs together to create a "Master Average."
*The Result: If the Master Average is pointing up, the volume is added to the OBV. If it points down, it is subtracted. This ensures that a single erratic price wick does not falsely flip the volume flow.
2. Volume Kinetics (Acceleration & Deceleration)
Standard OBV only tells you direction, not intensity. This script measures the "velocity" of the volume by tracking the absolute change in the OBV step bar-by-bar, and compares it to a 40-period historical average.
*Acceleration (Volume Spikes): If the current volume is greater than our customizable Expansion Factor (default 2.0x the average), it flags an Acceleration state. This indicates high momentum, institutional participation, or a heavy breakout.
*Deceleration (Volume Dry-Up): If the current volume drops below our Compression Factor (default 0.5x the average), it flags a Deceleration state. This mathematically highlights market exhaustion, tight consolidation, or a lack of interest.
3. OBV Moving Average & Cloud Fill
To help determine the broader momentum context, a 20-period SMA is applied directly to the custom OBV line.
*The Logic: A dynamic cloud fills the space between the OBV line and its SMA.
*The Result: When OBV is above its SMA, the cloud is Teal (Bullish momentum). When OBV is below its SMA, the cloud is Maroon (Bearish momentum).
Visual Guide (Reading the Dots)
The indicator plots color-coded dots directly on the OBV line to give you instant visual feedback on volume kinetics:
🟢 Bright Green Dot: Bullish Acceleration (High-volume buying spike).
🔴 Bright Red Dot: Bearish Acceleration (High-volume selling spike).
🟡 Yellow Dot: Deceleration / Exhaustion (Volume has severely dried up).
🔵 Teal Dot: Standard bullish volume flow.
🟤 Maroon Dot: Standard bearish volume flow.
Practical Trading Applications
Confirming Breakouts: If price breaks through a key resistance level and the indicator prints a Bright Green Dot, it confirms the breakout is supported by anomalous volume and is more likely to succeed.
Spotting Reversals (Exhaustion): When price approaches a major support or resistance level and prints a cluster of Yellow Dots, it means the volume pushing the trend has dried up. This often precedes a reversal or a deep pullback.
Trend Riding: Stay in trades as long as the OBV line remains on the correct side of its SMA (represented by the Teal or Maroon cloud fill), ignoring minor price pullbacks.
지표

Regime Gated Confluence Score [Pineify]Regime Gated Confluence Score
Overview
This pane indicator combines trend, momentum, and volume after a four-state gate selects meaning and weight. The main score and dashboard reconcile signed contributions.
Problem Definition
Fixed-weight confluence hides a regime error. Positive RSI may confirm a trend but mark extension in a range. EMA separation can persist after efficient travel ends. Relative volume shows participation, not acceptance. A permanent sum can stay strong when path efficiency is low, factors disagree, or ATR leaves its baseline, so users cannot tell whether magnitude reflects agreement or one dominant input.
Design Rationale
ATR-normalized EMA separation and slope measure trend across price scales. Centered RSI supplies momentum; RANGE reverses it to express a fade. Volume pressure combines capped relative volume with close location without claiming aggressor flow. EMA spread and path efficiency classify structure; ATR versus baseline identifies displacement. Lower hold thresholds add hysteresis. A trained model would add hidden data assumptions, while fixed weights preserve the failure. Explicit rules accept sensitivity and lag for auditability.
Key Features
Four regimes with hysteresis.
Standardized trend, RSI, and participation factors.
Regime weights, range inversion, missing-volume renormalization, conflict attenuation, exact contribution totals, and confirmed alerts.
How It Works
EMA spread and fast-EMA change are normalized by ATR, blended 65/35, and clipped to -1 through +1. RSI is centered at 50, divided by 25, and clipped. Volume multiplies close location inside the bar by relative volume capped at 2.5 times baseline, then smooths it. If fewer than 80% of volume-window bars are usable, volume is omitted.
Trend strength is absolute normalized EMA spread. Path efficiency divides net movement by total one-bar movement. ATR relative to baseline measures displacement. VOLATILE has priority until its lower hold level clears. Otherwise, strong separation and efficiency enter TREND, weak evidence enters RANGE, and unresolved evidence is TRANSITION.
Trend/momentum/volume weights are 55/30/15 in TREND, 15/60/25 in RANGE, 40/35/25 in VOLATILE, and 35/40/25 in TRANSITION. RANGE reverses only RSI. Missing volume removes its weight and renormalizes the others. Agreement divides absolute net contribution by total absolute contribution and sets a 0.55-to-1 gate; VOLATILE adds an ATR penalty. Gated components sum to the score. Warm-up or invalid threshold and EMA ordering blocks output with a diagnostic.
How Multiple Indicators Work Together
Trend estimates structure, momentum locates bounded pressure, and volume tests participation plus bar acceptance. The regime interprets them before combination. Without range inversion, extension becomes a continuation vote; without trend, brief momentum can dominate; without volume, weights must be renormalized. Agreement converts remaining conflict into lower magnitude rather than hiding it.
Trading Ideas and Insights
Use the score as context, not an order. A confirmed threshold cross during TREND identifies aligned conditions. In RANGE, check whether trend or volume opposes inverted momentum before considering a fade. In VOLATILE, a compressed gate shows ATR displacement discounting the raw sum. A strong component beside a modest total indicates conflict.
Unique Aspects
The contribution is the sequence of classification, interpretation change, weighting, and attenuation. RANGE reverses momentum while other factors can veto it; hysteresis separates trend entry from persistence; missing volume is removed; and agreement scales every component so the ledger equals the score. The halo shows magnitude, the background shows regime, and the table exposes construction.
How to Use
Start with defaults and compare the regime label with visible path behavior. Wait for warm-up. Keep the ledger visible to see whether structure, oscillator pressure, or participation drives direction. Use confirmed alerts when closing-state transitions matter. Contribution lines are diagnostic; the halo and background form the primary view. Omitted volume means a disclosed two-factor score.
Customization
EMA lengths and slope lookback control structural response; RSI length controls momentum sensitivity. Volume baseline and smoothing trade speed for stability. Regime length changes path efficiency and the ATR baseline. Entry thresholds must exceed hold thresholds. Raising the score threshold reduces alert frequency but does not establish better forecasting. Visual switches change display only.
Assumptions and Limitations
The script uses chart OHLC and reported volume. Exchange, tick, and absent volume differ; close-location volume is only a proxy. EMA, ATR, RSI, and rolling baselines lag. RANGE can fade a breakout, hysteresis can delay exits, and attenuation can suppress an early shock.
Realtime factors, regime, colors, and score can change before close; alerts require confirmation. No request calls, future data, pivots, or negative offsets are used. The script does not model liquidity, news, sizing, entries, stops, or exits. Thresholds do not establish expected return. Sparse bars and unreliable volume can distort evidence.
Conclusion
This replaces a fixed sum with an inspectable state process. The score and ledger show weights, conflict attenuation, and missing-data effects. Keep separate risk and execution rules.
.
지표

5-Day Rolling SMA 1m + Trend Alignment Band5-Day Rolling SMA 1m + Trend Alignment Band
This indicator displays a rolling multi-day Simple Moving Average calculated from 1-minute closing prices, together with a three-state Trend Alignment Band.
It is designed to provide a continuous view of short-term market direction across intraday chart timeframes.
Concept
A conventional 5-day SMA calculated on a daily chart averages only five daily closing prices.
This indicator uses a different approach. It calculates the average from all 1-minute closing prices contained in approximately five regular trading sessions.
For a U.S. stock or ETF with a 390-minute regular trading session:
390 minutes x 5 trading days = 1,950 one-minute bars
The default 5-day calculation is therefore approximately equivalent to:
SMA = Sum of the last 1,950 one-minute closes / 1,950
However, the script does not assume that every market has exactly 390 one-minute bars per trading day.
Instead, it measures the actual number of 1-minute bars in recent completed trading sessions. It then uses the median session length to estimate the typical number of bars per day.
The rolling window is calculated as:
Rolling Window = Typical 1-minute bars per session x Rolling Days
Using the median helps reduce the influence of shortened or unusual trading sessions.
Why use 1-minute data?
Using 1-minute data allows the multi-day average to move continuously instead of behaving like a daily moving average projected onto an intraday chart.
On a 1-minute chart, the rolling SMA can update every minute as:
one new 1-minute close enters the calculation;
the oldest observation leaves the rolling window.
On higher chart timeframes, the same internally calculated 1-minute rolling SMA is sampled onto the selected chart timeframe.
The purpose is not to reproduce a conventional 5-period daily SMA. It is to represent the average location of intraday prices over approximately the most recent five trading sessions.
Trend Alignment Band
The area between price and the rolling SMA is colored according to the relationship between price and the direction of the SMA.
Green - Bullish Alignment
Green appears when:
Price is above the rolling SMA.
The rolling SMA is rising.
Condition:
Price > SMA AND SMA(t) > SMA(t-1)
This indicates that price location and short-term trend direction are aligned upward.
Red - Bearish Alignment
Red appears when:
Price is below the rolling SMA.
The rolling SMA is falling.
Condition:
Price < SMA AND SMA(t) < SMA(t-1)
This indicates that price location and short-term trend direction are aligned downward.
Yellow - Transition / Conflict
Yellow appears when the two conditions are not aligned.
Examples include:
Price moves above the SMA while the SMA is still falling.
Price moves below the SMA while the SMA is still rising.
The SMA is flat.
Yellow should therefore not automatically be interpreted as a ranging market. It represents disagreement between current price location and the direction of the rolling average, which can occur during transitions, pullbacks, reversals, or consolidation.
Intended Use
The indicator is intended primarily as a short-term market-regime and directional context tool rather than as a standalone entry signal.
Possible uses include:
Identifying short-term directional bias.
Distinguishing aligned trends from transition phases.
Providing context for pullbacks and rallies.
Comparing current price with the average intraday price location of recent trading sessions.
Maintaining a consistent short-term reference when moving between intraday chart timeframes.
The three band states can be interpreted as:
Green = bullish alignment
Red = bearish alignment
Yellow = transition or directional conflict
These states are descriptive, not predictive, and should not be treated as automatic buy or sell signals.
Original Features
The script differs from a standard daily SMA or a fixed-length intraday SMA in several ways:
The moving average is calculated internally from 1-minute closing prices.
The script automatically measures the typical number of 1-minute bars in recent completed sessions.
The median session length is used to reduce sensitivity to shortened or irregular trading days.
The rolling period is automatically constructed from the detected session length and selected number of trading days.
The Trend Alignment Band combines both price position and SMA direction instead of using a simple price/SMA crossover alone.
This allows the indicator to adapt its multi-day rolling window to different symbols and trading-session structures without relying on a permanently fixed 1,950-bar setting.
Settings
Show 5-Day Rolling SMA
Shows or hides the rolling SMA line.
Show Trend Alignment Band
Shows or hides the colored area between price and the rolling SMA. Enabled by default.
SMA Line Width
Adjusts the thickness of the SMA.
SMA Color
Default: orange.
Band Transparency
Controls the transparency of the colored trend band.
Bullish Band / Bearish Band / Transition Band
Allows customization of the green, red, and yellow states.
Rolling Days
Default: 5 trading days.
Session Detection Days
Controls how many completed sessions are used when estimating the typical number of 1-minute bars per trading day.
Session
Regular: Uses the symbol's regular trading session.
All: Uses the available session data for the symbol.
For U.S. stocks and ETFs, Regular is the intended default.
Limitations
This is not the same calculation as a conventional 5-period SMA on a daily chart.
The indicator averages 1-minute closing-price observations, so it is better interpreted as a rolling intraday time-sampled price average over approximately the selected number of trading days.
Results can vary depending on:
the symbol's trading-session structure;
Regular versus All session selection;
holidays and shortened trading sessions;
the amount of 1-minute historical data available from the data provider;
the chart timeframe on which the internally calculated series is sampled.
A sufficient amount of historical intraday data is required before the script can determine the normal session length and calculate the full rolling window.
This indicator does not predict future prices and does not generate guaranteed trading signals. It should be used together with price structure, support/resistance, volume analysis, risk management, or other independent forms of analysis.
日本語説明
このインジケーターは、**直近の複数営業日相当の1分足終値から計算するローリングSMA(単純移動平均線)**と、価格とSMAの状態を3色で表すTrend Alignment Bandを表示します。
一般的な日足5SMAとは計算方法が異なります。
通常の日足5SMAは、
直近5本の日足終値の平均
ですが、本インジケーターは直近約5営業日に含まれる1分足終値を連続的に平均します。
米国株・ETFの通常取引時間が1日390分の場合、
390分 × 5営業日 = 1,950本
となるため、デフォルト設定では概ね1分足1950期間SMAに相当します。
1日のバー数を自動判定
このインジケーターでは、1日のバー数を390本と固定していません。
過去の完了した取引日について実際の1分足本数を計測し、その中央値から通常の1営業日あたりのバー数を推定します。
計算期間は、
ローリング本数 = 1営業日の代表的な1分足本数 × ローリング日数
として自動的に決定されます。
中央値を使用することで、短縮取引日などの特殊なセッションの影響を受けにくくしています。
1分足を使用する理由
日足5SMAをそのままイントラデイチャートへ表示すると、日ごとに値が切り替わるため階段状になります。
本インジケーターでは内部計算を1分足で行うため、1分足チャートでは新しい1分足が形成されるごとにローリング平均が更新されます。
したがって、通常の日足5SMAよりも連続的に、直近数営業日における価格の平均的な位置を表現できます。
上位時間足では、この1分足で計算されたRolling SMAを各チャート時間足へサンプリングして表示します。
Trend Alignment Band
価格とRolling SMAとの間を、価格の位置とSMAの方向に応じて3色に分類します。
緑 - Bullish Alignment
以下の2条件が同時に成立した状態です。
価格がSMAより上
SMAが上向き
Price > SMA かつ SMA(t) > SMA(t-1)
価格と短期トレンドの方向が上方向に一致している状態を示します。
赤 - Bearish Alignment
以下の2条件が同時に成立した状態です。
価格がSMAより下
SMAが下向き
Price < SMA かつ SMA(t) < SMA(t-1)
価格と短期トレンドの方向が下方向に一致している状態を示します。
黄 - Transition / Conflict
価格とSMAの方向が一致していない状態です。
代表例:
価格はSMAを上回ったが、SMAはまだ下降している
価格はSMAを下回ったが、SMAはまだ上昇している
SMAが横ばい
したがって黄色は単純な「レンジ」を意味するものではありません。
価格の位置と短期平均の方向に不一致が生じている状態であり、転換、押し・戻し、反転、持ち合いなどで発生します。
基本的な使い方
本インジケーターは直接的な売買シグナルではなく、短期的な相場環境と方向性を把握するためのツールとして設計しています。
基本的には、
緑 = 上昇方向への整合
赤 = 下降方向への整合
黄 = 移行状態または方向の不一致
として使用します。
価格が単にSMAの上か下かだけではなく、SMA自体の方向も同時に判定することが特徴です。
本インジケーター独自の特徴
一般的な日足SMAや固定期間のイントラデイSMAと比較して、以下の特徴があります。
1分足終値を内部計算に使用
1営業日の実際の1分足本数を自動計測
過去セッションの中央値によって通常のセッション長を推定
セッション長 × 日数からローリング期間を自動設定
価格のSMAに対する位置とSMAの方向を組み合わせて3色の状態を表示
これにより、1950本などの固定値をすべての銘柄に適用するのではなく、銘柄ごとの取引セッションに応じた複数日Rolling SMAを構成します。
設定
Show 5-Day Rolling SMA
Rolling SMAの表示・非表示。
Show Trend Alignment Band
Trend Bandの表示・非表示。デフォルトはON。
SMA Line Width
SMAの太さ。
SMA Color
デフォルトはオレンジ。
Band Transparency
帯の透明度。
Bullish / Bearish / Transition Band
緑・赤・黄色を個別に変更できます。
Rolling Days
デフォルト5営業日。
Session Detection Days
通常の1営業日の1分足本数を判定するために使用する過去セッション数。
Session
Regular:通常取引時間のみ
All:取得可能なセッションデータを使用
米国株・ETFではRegularを基本設定として想定しています。
通常の日足5SMAとの違い
通常の日足5SMAは、5本の日足終値を平均します。
本インジケーターは、直近約5営業日に含まれる大量の1分足終値を平均します。
したがって、両者は「5日」という時間範囲を扱っていても同じ指標ではありません。
本インジケーターは、直近数営業日において価格が平均的にどの水準に滞在していたかを連続的に表現することを目的としています。
制約・注意事項
計算結果は以下の要因によって変化する場合があります。
銘柄ごとの取引時間
Regular / All の選択
祝日や短縮取引
TradingView側で利用可能な1分足履歴
表示しているチャート時間足
十分な1分足履歴が存在しない場合、通常のセッション長および完全なローリング期間を計算できるまでSMAが表示されない場合があります。
また、本インジケーターは将来の価格を予測するものではなく、売買結果を保証するものでもありません。価格構造、支持抵抗、出来高、リスク管理など、他の分析と組み合わせて使用してください。 지표

SHM - Dual-WMA Momentum OscillatorSHM - Dual-WMA Momentum Oscillator
Overview-
The SHM Dual-WMA Momentum Oscillator (DWO) is an institutional-grade momentum indicator engineered to isolate structural trend direction, momentum acceleration, and high-probability market cycles across custom timeframes.
By calculating the percentage distance between a Fast WMA and a Slow WMA, the DWO filters out transient market noise and locks calculation logic to a customizable higher timeframe wave—allowing you to project and track macro momentum seamlessly across every chart resolution.
Key Features & Architecture-
* Flexible Multi-Timeframe (MTF) Engine: Complete control over your anchor timeframe (Anchor Momentum Timeframe). Choose your preferred momentum wave (e.g., 4H, Daily/24H, 3D, Weekly) and lock it to display consistently across all timeframes without repainting or distortion.
* Universal Timeframe Visibility: Lock your preferred anchor to the 4-Hour wave, and that 4H momentum wave stays strictly visible whether you zoom down to a 15-minute execution chart or step up to inspect the Daily or Weekly macro chart.
* Structural Trend Isolation: Eliminates short-term volatility, revealing where higher-timeframe capital flow is actually moving.
* Triple Equilibrium Baselines: Features customizable numeric anchor points (+33, 0, -33) paired with dynamic 4-color momentum acceleration histograms to easily spot expansion, exhaustion, and mean-reversion zones.
* Signal Tracking Line: Integrates an EMA-smoothed signal tracking line to highlight momentum crossovers and zero-line baseline retests cleanly.
How to Use for Analysis-
1. Selecting Your Anchor Timeframe:
* Set the Anchor Momentum Timeframe in the settings input to your preferred cycle (e.g., 240 for 4H execution, 1440 for Daily macro, or 1W for high-timeframe positioning).
2. Determining Trend Bias:
* DWO Line Above Zero Baseline: The selected anchor wave is structurally bullish. Intraday pullbacks act as buying liquidity within the broader trend.
* DWO Line Below Zero Baseline: The selected anchor wave is structurally bearish. Intraday bounces act as counter-trend rallies.
3. Equilibrium Acceleration Histograms:
* Green / Teal Histograms: Positive momentum acceleration relative to your selected anchor timeframe.
* Red / Dark Red Histograms: Negative momentum acceleration relative to your selected anchor timeframe.
Inputs & Settings-
* Anchor Momentum Timeframe (Default: 24H / 1440): Selects the timeframe wave to project across all charts (supports 1m up to 1W).
* Fast WMA Lookback (Default: 65): Controls the sensitivity of the primary signal curve.
* Slow WMA Lookback (Default: 480): Establishes the baseline filter for long-term trend isolation.
* Signal Smoothing Line (Default: 63): Adjusts the sensitivity of the EMA signal tracking curve.
* Triple Baseline Configuration: Sets the Y-axis levels for upper (+33), zero (0), and lower (-33) histograms.
Disclaimer
This script is designed for educational, informational, and analytical charting purposes only. It does not constitute financial or trading advice. Always perform independent analysis and practice strict risk management.
지표

Dual Shock SPMA | NAL1. Overview
Dual Shock SPMA | NAL is a dual-memory trend indicator designed to separately track how significant bullish and bearish price shocks are developing through time.
Unlike the standard Shock Percentile Moving Average, the Dual Shock SPMA maintains two independent adaptive baselines. Positive shocks update the Bull Shock SPMA, while negative shocks update the Bear Shock SPMA.
This creates two separate memories of where statistically stronger directional moves have occurred, allowing the indicator to evaluate the relationship between bullish and bearish shock structure rather than treating all large movements as one stream.
2. Calculation
The indicator begins by calculating the percentage return of the selected source and ranking the absolute magnitude of that return against recent history.
Ret = not na(source ) ? (source - source ) / math.max(math.abs(source ), syminfo.mintick) : 0.0
ShockRank = ta.percentrank(math.abs(Ret), percentrank_lookback)
Because the percentile calculation uses the absolute return, bullish and bearish shocks are ranked against the same magnitude distribution.
The direction of the return then determines which baseline is allowed to update.
BullGate = Ret > 0.0 and not na(ShockRank) and ShockRank > percentile_gate
BearGate = Ret < 0.0 and not na(ShockRank) and ShockRank > percentile_gate
A qualifying positive shock updates only the Bull Shock SPMA. A qualifying negative shock updates only the Bear Shock SPMA. Otherwise, each baseline retains its previous value.
BullMA := na(BullMA ) ? emaValue : BullGate ? emaValue : BullMA
BearMA := na(BearMA ) ? emaValue : BearGate ? emaValue : BearMA
Each shock stream then maintains its own directional memory.
A rising Bull SPMA means significant positive shocks are occurring at progressively higher price levels. A rising Bear SPMA means significant negative shocks are also occurring at progressively higher levels. The inverse applies when either baseline is declining.
BullTrend := BullSPMA > BullSPMA ? 1 : BullSPMA < BullSPMA ? -1 : nz(BullTrend , 0)
BearTrend := BearSPMA > BearSPMA ? 1 : BearSPMA < BearSPMA ? -1 : nz(BearTrend , 0)
The final state requires agreement between both shock memories.
For a bullish regime, both baselines must be trending upward and the Bull SPMA must remain above the Bear SPMA. For a bearish regime, both must be trending downward and their ordering must reverse.
An optional midpoint gate can additionally require price to remain aligned with the center of the dual-shock structure.
ShockMid = math.avg(BullSPMA, BearSPMA)
Long = BullTrend == 1 and BearTrend == 1 and (not UseMidGate or close > ShockMid) and BullSPMA > BearSPMA
Short = BearTrend == -1 and BullTrend == -1 and (not UseMidGate or close < ShockMid) and BullSPMA < BearSPMA
3. Key Features
Separate bullish and bearish shock-memory baselines.
Absolute-return percentile ranking for directly comparable shock magnitude.
Event-driven updates restricted to statistically stronger price movements.
Independent directional memory for positive and negative shocks.
Dual-baseline agreement and relative-position logic.
Optional price midpoint confirmation.
Optional neutral state during unresolved shock structure.
Shock-memory spread visualization and state-based candle coloring.
4. Use
Dual Shock SPMA is designed to analyze how significant positive and negative price events are evolving relative to one another.
Rather than treating volatility as a single undifferentiated stream, the indicator preserves separate memories for each side of the market. This makes the relationship between bullish and bearish shock structure itself part of the signal.
The spread between the two baselines visually represents this evolving relationship, while the midpoint provides a central reference for the combined shock structure.
Dual Shock SPMA is designed as a specialized structural component within a complete strategy framework. Its role is to identify when independently maintained bullish and bearish shock memories begin establishing directional agreement, providing a distinct layer of information about the underlying development of larger price movements.
지표

지표

Structure Participation Matrix [MQLSoftware]OVERVIEW
Structure Participation Matrix turns confirmed structure breaks into auditable records. It shows price-travel and chart-feed participation context, then compares endpoints across frozen score buckets. Each record has four readings, a score, and one delayed observation. It is research, not entries, stops, targets, sizing, execution, or forecasts.
Its distinct contribution is the complete frozen event ledger: strict delayed pivots, four disclosed measurements fixed at the break close, explicit UNSCORED handling, and one outcome check aggregated by frozen bucket. It links structure, participation, and later observation rather than merely combining standard indicators.
CONCEPTS
Strict symmetric pivots require a unique extreme on both sides; ties are rejected. A pivot becomes eligible only after its full right-side delay. A break requires a confirmed close beyond the armed level plus the ATR buffer; a wick alone is not an event.
Four 0-100 components freeze at that close. PATH measures displacement against the leg's total path. CLOSE averages directional close location over its final bars. REL VOL compares average leg volume with a rolling median. BALANCE weights volume by close location. The fixed score is 30% EFF/PATH, 25% CLOSE, 25% RVOL/REL VOL, and 20% BAL/BALANCE, normalized once for displays, buckets, and alerts.
RVOL uses reported or tick volume; BAL is an OHLCV proxy. They are not bid/ask delta, order flow, or a footprint; neither proves participant identity or predicts future behavior. Missing leg volume or bounded history makes an event UNSCORED and excludes it from bucket statistics.
After exactly N confirmed bars, the close is checked once. HELD N means the endpoint is beyond the broken level; FAILED N means it is not. HELD does not mean price stayed beyond the level throughout. The result is fixed.
FEATURES
Confirmed BREAK UP and BREAK DOWN events
Latest-event PATH, CLOSE, VOL, BAL rail
LOW, MODERATE, HIGH, and VERY HIGH score bands
HELD N or FAILED N endpoint checks
Sample-aware count and held-at-N rate by bucket
Break, direction, score-60+, and outcome alerts
HOW TO USE
Start with defaults. Higher Strict Swing Strength gives fewer pivots and a longer delay. Break Buffer sets the required closing distance in ATR units. Maximum Measured Leg Bars bounds history; an older leg remains a visible UNSCORED break.
Read the latest label first. In the rail, PATH describes travel efficiency; CLOSE, final-bar commitment; VOL, relative chart activity versus baseline; and BAL, a directional OHLCV proxy. The score summarizes a frozen event, not an instruction or probability.
The newest event keeps its expanded label and rail. Older events become compact labels; Historical Detailed Rails restores detail. Visual switches and retention affect drawings only, not calculations, counts, or alerts.
The matrix uses events recalculated from the history currently loaded on the chart. Counts and rates change with symbol, timeframe, inputs, or the history boundary. Small buckets remain collecting. HELD N rates are historical endpoint observations, not future estimates.
CONCLUSION
The result is an inspectable break record with transparent measurements, compact history, one timed outcome, and visible data limits. 지표

CTT - Position Size Calculator V1.0CTT - Position Size Calculator V1.0 | Risk-Based Position Sizing
Confluence Trading Tools LLC
A chart overlay that calculates exactly how many shares to buy or sell based on your account size, risk tolerance, and stop loss — then draws entry, stop, and R-multiple profit targets directly on the chart. No more mental math, no more spreadsheets, no more guessing.
---
WHAT IT DOES
Enter your account balance and risk percentage. Set a stop loss (manually or let ATR do it). The calculator tells you exactly how many shares to trade so that if you get stopped out, you lose only the amount you chose to risk — nothing more.
---
CORE FEATURES
ATR-BASED STOP LOSS
Toggle between a manual stop price and an automatic ATR-calculated stop. In ATR mode, the stop is placed at entry ± (ATR × multiplier). Configurable ATR length (default 14) and multiplier (default 1.5×). No more eyeballing stop placement.
R-MULTIPLE PROFIT TARGETS
Three configurable profit targets based on your risk distance:
- 1R Target: risk/reward 1:1
- 2R Target: twice your risk distance
- 3R Target: three times your risk distance
Each target shows both the price level and the dollar profit at that level based on your calculated position size.
MAX POSITION CAP
Prevents overconcentration by capping the maximum position size to a percentage of your account (default 25%). When the calculated position exceeds the cap, shares are reduced and the table flags it in orange with the effective risk after capping.
CHART LINES
Entry (solid blue), stop loss (dashed red), and R-multiple targets (dotted green) are drawn directly on the chart with price labels. See exactly where your levels sit relative to price action. Line length is configurable.
LONG / SHORT SUPPORT
Toggle between long and short trades. Stops and targets automatically adjust direction — stop below entry for longs, above for shorts.
INFO TABLE
Compact table showing:
- Risk amount and percentage
- Stop price (with ATR info when in ATR mode)
- Stop distance in dollars and percentage
- Share count (flagged if capped)
- Capital required and percentage of account
- Max cap status
- All three R-multiple target prices with dollar profit
---
HOW TO USE
1. Set your account balance and risk percentage
2. Choose Long or Short
3. Set your stop — either type a manual price or switch to ATR mode
4. Read the table: shares to buy, capital required, and all three profit targets
5. Use the chart lines to visualize your trade setup against price action
---
USAGE NOTES
- Works on any asset class: equities, futures, forex, crypto
- Entry price defaults to the current close — you can also link it to another indicator's output via the source input
- ATR stop mode is recommended for volatile instruments where a fixed stop price doesn't adapt to conditions
- The position cap protects against concentration risk but does NOT override your broker's margin limits
- All calculations update in real time as price moves
---
Confluence Trading Tools LLC
지표

지표

Multi-Timeframe Structure Overlay [ITA]🟠 OVERVIEW
Multi-Timeframe Structure Overlay draws the structure of two higher timeframes
onto the chart you are actually trading.
Most multi-timeframe tools put the answer in a corner table: one hour bullish,
four hour bearish. That tells you the state but not where it sits, and price
does not trade against a table. Here the swing highs and lows those timeframes
are working with become lines on your chart, so you can see how far price is
from the level that would flip them.
Breaks are marked at the price where they happened, not in a corner.
🟠 CONCEPTS
* Higher Timeframe Structure - The swing highs and lows a larger timeframe has
confirmed. They are the levels that decide its direction, and they usually sit
somewhere your own timeframe never draws.
* Break of Structure - A close beyond the last confirmed swing in the direction
the timeframe was already going. Continuation.
* Change of Character - A break in the opposite direction to the previous one.
The first sign that the higher timeframe has turned, and marked separately
because it means something different.
* Bias - Which way each timeframe is currently pointing, based on its last
confirmed break. Shown as a small tag at the right edge rather than a panel.
* Alignment - Both higher timeframes pointing the same way. It has its own
alert, because that is usually the condition people are waiting for.
🟠 FEATURES
🔹 Two higher timeframes at once, each with its own colour, drawn as levels on
your chart rather than listed in a table
🔹 BOS and CHoCH labelled at the price where the break occurred, tagged with
which timeframe produced it
🔹 Bias tags at the right edge, offset from each other so they never overlap
🔹 A warning on the chart if a selected timeframe is lower than the one you are
viewing, instead of quietly drawing values that look plausible and mean nothing
🔹 Alignment alert for when both higher timeframes agree
🔹 Levels are requested with lookahead off and read from confirmed bars only,
so nothing shifts after the fact
🔹 Independent swing sensitivity, applied on each higher timeframe rather than
on your chart
🟠 HOW TO USE
Pick two timeframes above the one you are on. Working a 15 minute chart, one
hour and four hour is the usual pair. On a daily chart, use weekly and monthly.
Read the lines first. A higher timeframe level sitting just above price is the
level that flips its bias, and it is often nowhere near anything your own
timeframe would have drawn.
A CHoCH tag matters more than a BOS tag. Continuation is expected, a change of
character is the first evidence the larger move is turning.
When both bias tags point the same way, the higher timeframes agree. That is
the alignment alert, and it is usually a better filter than either timeframe on
its own.
Swing Lookback controls sensitivity on the higher timeframes. Raise it for
fewer and more significant levels.
🟠 CONCLUSION
Knowing the higher timeframe is bullish is not the same as knowing what price
has to do for that to change. This puts the second thing on the chart, where it
can actually be used. 지표

MovTrend Pullback SystemWhat it is: A trend-following 5 minute indicator built around a linear regression trend line ("MovTrend") with ATR-based volatility bands. It generates four distinct signal types, each answering a different question about price action relative to the trend.
Core components
MovTrend Line (MT) — A linear regression line (ta.linreg) plotted over price, colored by direction: green when sloping up, red when sloping down, gray when flat. This is the trend backbone everything else references.
Slope — The MT line's rate of change over a lookback window, plotted as a histogram in the lower pane. Crossing above/below configurable thresholds marks a "confirmed" up or down trend (green/red bars); values between thresholds are a gray "no-trade zone" where the trend isn't strong enough to trust.
ATR Bands — Upper/lower bands plotted around the MT line at a multiple of ATR, representing a "normal" volatility envelope. Price moving outside these bands is considered stretched/overextended relative to the trend.
The four signals
🟢 Buy Dot / 🔴 Sell Dot (Pullback Touch)
Fires when price dips down and touches the MT line during a confirmed uptrend (buy), or pokes up and touches it during a downtrend (sell), then closes back in the trend's favor. This is the core "buy the dip / sell the rip" signal — a shallow pullback to the trend line that holds.
🟡 Stretch Dot (Mean-Reversion Warning)
Fires when price closes outside the ATR bands — i.e., stretched further from the trend line than normal volatility would suggest. Dot size scales with how extreme the stretch is (tiny = mild, small = moderate, orange/normal = extreme), giving you an at-a-glance read on how overextended price is. This isn't a reversal signal on its own — it's a caution flag that price may be due to snap back toward the MT line. It's filtered by:
Volatility regime — suppressed during low-volatility chop, since a "stretch" in dead conditions is less meaningful
FVG confluence — checks if price is near a fair value gap, adding context to the stretch
Volume — requires above-average volume to confirm real participation, not just a thin drift
Slope deceleration — confirms the trend itself is actually losing momentum, not just that price poked outside the band
🔷 Trend Continuation Diamond (cyan up / magenta down)
Fires on a high-volume push with the trend, away from the MT line — meant to catch strong continuation moves the pullback-touch signal misses (since it only fires on touches, not on strength). It's built specifically to avoid firing at exhaustion tops/bottoms by requiring:
Volume that is not the largest in the recent lookback window (avoids climactic blow-off bars)
Slope that's still accelerating, not flattening
A cooldown between diamonds so one strong leg doesn't spam multiple signals
Filters that apply across signals
Session filter — dims the chart and can gate signals outside your configured trading hours, since overnight/thin-liquidity behavior isn't comparable to regular session action
MTF confirmation — optionally requires a higher timeframe's slope to agree before a buy/sell touch fires, filtering out signals that look right locally but fight the bigger picture
Signal conflict resolution — a Trend Continuation diamond won't fire on the same bar as a Buy/Sell touch, avoiding mixed signals
Performance tracking table
How to read it together
The intended workflow: use the MT line + slope histogram to establish trend context, take Buy/Sell touches as primary pullback entries in the direction of that trend, treat Stretch dots as a caution/take-profit signal rather than a new entry, and use Continuation diamonds as confirmation that a trend still has legs when you're already in a position or considering adding. 지표

Unicorn Model Unicorn Model
Finds the ICT Unicorn and frames its context. A Unicorn forms where a displacement leaves a Breaker behind and the Fair Value Gap that displacement traded through inverts onto it — the same-direction Inversion FVG overlapping the Breaker is what confirms it. Two arrays reinforcing each other at one price, which ICT teaches as a tight, high-probability zone. This tool detects that overlap, marks the Breaker that qualifies, always shows the inversion FVG that makes it one, tracks the liquidity that engineered it, and keeps the HTF bias and the draw on a clean dashboard. It maps structure. It does not fire trades.
The sequence it looks for
The Unicorn is a confluence, not a standalone trigger. Bullish below; bearish mirrors.
Liquidity is taken — price sweeps a sellside low, engineering the reversal.
A swing is broken — displacement closes through the last swing high. The candles immediately before that leg are left behind as an order block, and it becomes a Breaker only once price later closes back through it, the block failing and flipping exactly as an FVG inverts into an IFVG.
The FVG inverts onto the Breaker — a candle body closes through the gap, so it fails and flips polarity into an Inversion FVG. A Breaker that a same-direction IFVG overlaps IS the Unicorn; with no overlapping IFVG it stays a plain Breaker.
Bias frames it — the model needs a clear higher-timeframe read, so a bullish Unicorn shows in a bullish or discount context and a bearish one in premium.
The draw — engineered liquidity in the direction of bias is the target the setup delivers toward.
Because the Unicorn is only as good as its narrative, bias is first-class: qualification is gated to the HTF read by default, and the dashboard keeps the read, the raid and the draw in front of you.
These are established Inner Circle Trader concepts — the Fair Value Gap, the Breaker, market structure shift, liquidity, the Midnight Open and premium/discount. This script is an original implementation of them, and what makes it its own thing is that it resolves the Breaker and the Inversion FVG that confirms it into a single zone rather than plotting each array in isolation.
What it draws
The Unicorn. When a live same-direction IFVG overlaps a Breaker, that box is relabelled Unicorn + or Unicorn -, drawn in purple or magenta with a distinct dashed border so the setup reads at a glance against the solid-bordered arrays around it. It is confirmed once and holds — it does not flicker bar to bar — and the confirming IFVG is kept alive with it. The two live and die together, so a Unicorn always shows the inversion that makes it one.
The ingredients. Drawn faintly beneath: FVGs in blue for bullish and red for bearish, Breakers in a neutral black, each tagged with the chart timeframe. A gap that sits inside the Unicorn or its inversion hides its own box, so the zone is never buried under the ingredient it is built from. Everything invalidates by candle body only — a wick through a zone never counts. A plain FVG inverts the moment one body closes through it; the Breaker and the inversion take a configurable number of body closes to retire, two by default.
The inversion. When a body closes through an FVG it does not vanish, it inverts — flipping polarity to deliver from the other side. The same-direction inversion overlapping a Breaker is what confirms the Unicorn. It is shaded orange, carries no label because orange reads as IFVG on its own, and sits behind the Unicorn so the zone stays in front.
Liquidity. Swing highs are buyside, swing lows are sellside, plus prior-day and prior-week levels as external-range reference, each anchored to the candle that formed it. The outermost live swing each side is tagged Buyside or Sellside Liquidity; inner swings carry Minor tags; prior-period levels keep a dated one. A level that is also an Asia, London or New York session extreme carries that tag too. Every level is removed the instant it is taken — no dotted stub, no lingering line — and an un-taken level that price trends a full range past without returning also clears. Tags that share a price merge into one rather than stacking.
Midnight Open. The 00:00 New York open, a core daily reference and a bias input. Below it leans bullish, above it leans bearish.
The draw. The target the setup delivers toward. It stays hidden until a Unicorn has set up AND its setup-side liquidity has been swept; only then is the opposing draw tagged on that level. That ordering is deliberate — the marker can never read as a standalone entry signal.
Dashboard
HTF bias, bullish or bearish or mixed, auto or manual. Whether a Unicorn is live and which way, falling back to the last one's direction rather than a bare dash. Which side of liquidity was most recently raided. The current draw with its price. Prior-day high and low, tracked even when the lines are hidden. Price against the Midnight Open. And where price sits in the dealing range, discount or premium against the equilibrium.
Reading it in practice
Trade with the dashboard bias. A Unicorn marks the Breaker whose overlapping inversion FVG makes it one; the orange IFVG shows the imbalance it sits within. ICT guidance waits for price to tap the FVG side, places the stop beyond the combined Breaker and FVG extreme — whichever is furthest — and targets the engineered liquidity the draw tag names. A gap left open below a bullish Unicorn range is intended: it shows intent and speed, and is not meant to be filled.
Method and repainting
All detection evaluates on closed bars. Swings, the structure break, the Breaker flip, the FVGs, the inversion and the Unicorn overlap are confirmed on candle close, never intrabar. Once a Unicorn is confirmed it is locked — it does not re-evaluate or flip state bar to bar — and invalidation counts only confirmed body closes, so an in-progress candle, wick included, never removes it. The Midnight Open fixes on its forming bar, and every level anchors to the candle that formed it.
Live zones and levels extend to the right edge for readability. That projection is cosmetic and changes no confirmed level, tap or raid.
Settings
Session timezone, right-side offset and label sizes. Bias mode and whether Unicorns are gated to it. Pivot strength. Liquidity display, per-side level caps, prior day and week levels with their lookbacks, and the raid-relevance window. Session tagging and the three session windows. FVG minimum height and displacement size, both in ATR, the declutter, the cap on live gaps, the framing IFVG, and how many body closes retire a zone. Unicorn colours. Dashboard position, including middle right, and text size.
Analytics only
This is a decision-support tool for discretionary ICT study. It maps zones, structure and context. It contains no alerts and no buy or sell signals, and it does not tell you when to enter or exit. The draw marker is a text label that appears only after a Unicorn has set up and liquidity has been swept, pointing at a liquidity target — not a trade instruction.
Disclaimer
This is a decision-support tool for discretionary ICT trading. It is not financial advice, and no market's past behaviour is indicative of future results. 지표

Edo Premium DiscountEdo Premium Discount — Splits the Dealing Range into Premium, Equilibrium and Discount Zones with a Live Position Reading
Inside the range price moves in, where you enter is not neutral. Buying near the low of the range — in discount — offers a far better risk/reward than buying near the high — in premium. Institutional money accumulates cheap and distributes expensive, and trading with that logic rather than against it is one of the simplest structural edges to add. Edo Premium Discount turns that principle into a direct visual tool: it takes the current dealing range and answers, at all times, one question — is price trading expensive or cheap relative to the range it sits in?
The indicator builds the dealing range from the latest confirmed swing high and swing low, splits it into three zones, and reads where price sits within it. Premium is the expensive upper half (the sell side), discount is the cheap lower half (the buy side), and equilibrium is the fair-value band around the 50% midpoint. Everything is built on confirmed swings, so the indicator does not repaint. It is the relative-value frame of the Edolab structure family, the canvas on which to place liquidity, order blocks and the rest of the read.
THE DEALING RANGE
The range is the foundation: without a reference high and low, there is no premium or discount to measure. The indicator defines it with the most recent confirmed pivots — the last swing high as the range high and the last swing low as the range low. When price breaks out and forms new swings, the range updates to the new leg. The Swing Profile sets the sensitivity of those pivots: Scalper (5 bars each side) for short, reactive ranges on low timeframes, Swing (10 bars, the default) for the balanced 4H and daily read, and Long Term (21 bars) for the major ranges on weekly and higher horizons. The zones extend a configurable number of bars to the right so they project over the forming candles.
THE THREE ZONES
Splitting the range at its midpoint, the indicator draws three zones. Premium: the upper portion, above the equilibrium band, shaded red — price is trading expensive, the zone where sells are sought. Discount: the lower portion, below the equilibrium band, shaded teal — price is trading cheap, the zone where buys are sought. Equilibrium: the central band around the exact 50% midpoint, shaded neutral grey, with a dashed line marking the 50% level — fair value, neutral territory where neither side has a clear location edge. The Equilibrium Band input sets the half-width of that central band as a percentage of the range (5% by default, giving a 45%–55% band); widen it to enlarge the neutral zone, narrow it to expand the two operative zones.
POSITION AND ZONE STATE
On every bar the indicator classifies the close into one of the three zones — Premium above the equilibrium band, Discount below it, Equilibrium inside it — and reads its Position: how high the close sits in the range as a percentage, where 0% is the range low, 100% the range high and 50% the midpoint. The percentage refines the zone read: premium at 55% (just across the midpoint) is a very different proposition from premium at 95% (at the edge of the range high). The state shows in the panel's Zone cell in its colour and fires the matching alert when price enters each zone.
INFORMATION PANEL
The panel condenses the value read into a compact table: the current Zone (PREMIUM / EQUILIBRIUM / DISCOUNT) in its colour, the Position in percent, and the Range High and Range Low levels. It sits in any of the four chart corners (Top Right by default), comes in three sizes (Tiny / Small / Normal) and two themes (Dark / Light), and can be hidden entirely.
NO REPAINTING
The range is built on confirmed pivots: the range high and low only change when a new swing is confirmed, not during the forming candle, so the zones do not shift intrabar. There are no higher-timeframe functions — all logic runs on the current chart timeframe.
CONFIGURATION
The inputs are grouped by block. Range sets the swing profile, the equilibrium band as a percentage of the range and how many bars the zones extend to the right. Style exposes the premium, discount and equilibrium colours, the zone opacity and the Dark/Light theme. Panel controls panel visibility, position and size. The defaults are calibrated to work without adjustment on stocks, crypto, forex, indices and futures, on any timeframe — the inputs most users touch are the Swing Profile, to size the range to their horizon, and the Equilibrium Band, to set the width of the neutral zone.
ALERTS
Three predefined alerts cover the zone changes: Price entered Premium fires when the close enters the premium zone, Price entered Discount when it enters the discount zone, and Price entered Equilibrium when it returns to the fair-value band. The discount alert flags when price reaches the cheap half of the range — where buys are sought — and the premium alert when it reaches the expensive half. All alerts fire on bar close, consistent with the indicator's anti-repaint validation.
HOW TO READ IT
The most direct use is location: seek buys when price is in discount and sells when it is in premium, not the other way around — not a signal in itself, but a filter that grades trades by their risk/reward, since a buy in deep discount starts from a far more favourable zone than a buy in premium. Watch the extremes: a Position near 0% or 100% means price is at an edge of the range, and inside a range price tends to revert toward equilibrium, so an extreme reading warns that pushing further from fair value starts from a high-risk zone. Use equilibrium as a hinge: price reclaiming equilibrium from discount, or losing it from premium, marks a change of value half worth watching. And trade in confluence: a liquidity sweep or a quality order block in discount is a far stronger buy reference than the same signal in premium — Edo Premium Discount provides the value frame on which to place the rest of the structure.
OPEN SOURCE
Edo Premium Discount is published as a free open source indicator. The full Pine Script is publicly accessible on TradingView for study, adaptation and integration into any workflow. Part of the Edolab Markets free tools ecosystem, all available on TradingView.
This indicator is a technical analysis tool for educational and informational purposes only. It does not generate automatic buy or sell signals and should not be considered financial advice. Trading financial markets involves significant risk of capital loss. Past performance does not guarantee future results. Always use proper risk management.
지표

Pattern Atlas: Candlestick Indicator [AxeAlgo]Pattern Atlas: Candlestick Indicator
Companion indicator to Pattern Atlas : Candlestick (Library #1 of the AxeAlgo Pattern Atlas)
WHAT THIS INDICATOR IS
This is a complete candlestick pattern scanner built on top of the Pattern Atlas : Candlestick library — 23 classical candlestick patterns, detected on every bar and turned into on-chart highlighting, a live scanner table, and alerts. It doesn't implement any pattern math itself; every detection is delegated to the library's detect*() functions, so what you see here is exactly what that library finds, with nothing added or reinterpreted.
Candlestick reading is one of the oldest tools in technical analysis, tracing back to Steve Nison's work bringing Japanese candlestick charting to Western traders. The 23 patterns here follow that standard catalog (cross-checked against TA-Lib's CDL* function list), so anyone who already knows what a Morning Star or a Bullish Engulfing bar looks like will recognize exactly what's being flagged.
THE 23 PATTERNS IT SCANS
Single-bar patterns (9): Doji, Long-Legged Doji, Dragonfly Doji, Gravestone Doji, Hammer / Hanging Man, Inverted Hammer / Shooting Star, Marubozu, Spinning Top, Belt Hold.
Two-bar patterns (6): Engulfing, Harami, Harami Cross, Piercing Line / Dark Cloud Cover, Tweezer Top / Bottom, Kicker.
Three-bar-and-longer patterns (8): Morning / Evening Star, Morning / Evening Doji Star, Three Soldiers / Crows, Three Inside Up / Down, Three Outside Up / Down, Abandoned Baby, Rising / Falling Three Methods (the one pattern spanning 5 bars), Stick Sandwich.
READING THE CHART
Each matched pattern gets a box drawn around the exact bars it spans, colored gold for bullish, pale gold-white for bearish, and bright gold for neutral (indecision) patterns — colors are user-configurable. On top of that, a "pin" marker appears at the bar: bullish pins hang below the bar, bearish pins sit above it, and neutral patterns get a plain floating gem with no stem, since indecision doesn't have a direction to anchor to. Hovering any pin or gem shows the full description of everything that matched on that bar, including a measured strength percentage for each one — not just the pattern name repeated back at you.
Strength is a generic, direction-based read on how decisively the bar closed within its own high-low range (near the high for a bullish match, near the low for a bearish one, or a small body relative to the range for a neutral one) — a rough, pattern-agnostic proxy, not a bespoke ratio breakdown per pattern, since that level of internal detail isn't something the library exposes.
THE SCANNER TABLE
A table lists all 23 patterns grouped by category, with a live status column showing each one's current match percentage (or a dash when nothing's matching on the current bar). Position, text size, and whether it's shown at all are all configurable. This table is intentionally live — it reflects the forming bar in real time rather than waiting for the bar to close, since it's meant as a "what's happening right now" readout rather than a persisted signal.
FILTERS AND SETTINGS
Every pattern has its own on/off checkbox, and each of the three categories (Single-Bar, Two-Bar, Three-Bar+) has a master switch above its checkboxes to turn the whole group off in one click.
Three additional filters are available, all off by default so the scanner stays an unbiased detector unless you opt in:
- Volume confirmation — requires a match to occur on at least a chosen multiple of its own trailing average volume before it counts.
- Trend context — requires bullish matches to occur against a downtrend and bearish matches against an uptrend (the classical reading that a reversal candle means more against the trend it's reversing than in the middle of a random chop). Neutral patterns are never filtered by this, since they don't imply a direction.
- Minimum strength — hides matches below a chosen strength percentage.
These filters affect what's drawn on the chart and what feeds the pin/gem tooltips. They do not affect the scanner table, which always shows the library's raw, unfiltered read of the current bar, and they do not affect the per-pattern alerts described below, which fire independently of the visual display settings.
ALERTS
Every pattern has its own alert condition available in TradingView's Create Alert dialog, plus three combined conditions (any bullish pattern, any bearish pattern, any neutral pattern), plus one dynamic alert with a full message listing every pattern that matched, grouped by direction, with each one's measured description and strength.
A NOTE ON REPAINTING
Every box, pin, gem, and alert is gated on the bar actually having closed — nothing here fires or gets drawn off a still-forming bar, regardless of your alert-frequency setting in TradingView's dialog. The one exception is the scanner table, which is deliberately live so it can answer "what's happening on this bar right now" — that's a readout, not a persisted signal, and it's expected to change as the current bar develops.
PART OF A LARGER SERIES
This indicator is the companion to Library #1 of the AxeAlgo Pattern Atlas — a planned set of Pine libraries splitting pattern detection by the method actually used to find each kind of pattern: candlestick shape (this one), classical chart/geometric patterns (Library #2), harmonic Fibonacci-ratio patterns (Library #3), and market-structure concepts (order blocks, liquidity, Wyckoff-style events). Each library has, or will have, its own companion scanner indicator built the same way this one is.
DISCLAIMER
This indicator is a technical analysis tool for identifying classical candlestick shapes in historical and live price data. It does not predict future price movement, and a detected pattern — including its measured strength — is a description of past price action, not a signal guaranteed to repeat. Nothing in this script constitutes financial advice. Always combine pattern recognition with your own risk management and broader analysis before making any trading decision.
지표

STOC - Moving Average Trend & SignalsSTOC – Moving Average Trend & Signals is a trend-following indicator designed to simplify moving-average analysis using four widely followed averages:
• 10 EMA – Short-term momentum
• 20 EMA – Short/intermediate trend
• 50 SMA – Intermediate trend
• 200 SMA – Long-term market structure
The indicator combines price position, moving-average direction and MA alignment to identify potential entries, exits and broader trend conditions.
SIGNAL MODES
1. MA Stack
A Buy signal occurs when the averages newly align in bullish order:
10 EMA > 20 EMA > 50 SMA > 200 SMA
The standard exit occurs when this bullish alignment breaks.
2. Price vs MA
A Buy signal occurs when price crosses above the selected signal MA. The standard exit occurs when price crosses below it.
The selectable signal averages are:
• 10 EMA
• 20 EMA
• 50 SMA
• 200 SMA
3. Fast/Slow Crossover
A Buy signal occurs when the 10 EMA crosses above the 20 EMA. The standard exit occurs when the 10 EMA crosses below the 20 EMA.
EXIT METHODS
1. MA Signal Exit
Uses the corresponding exit condition of the selected signal mode.
2. ATR Trailing Exit
Replaces the standard MA exit with a volatility-adjusted trailing stop. The ATR stop follows the highest price reached after entry and never moves downward during an active trade.
The ATR exit is confirmed only when a candle closes below the trailing stop. Intrabar touches do not trigger an exit.
OPTIONAL FILTERS
• Moving-average slope confirmation
• Volume confirmation
• Minimum separation between the 10 EMA and 200 SMA
• Bar-close signal confirmation
• Flat or choppy market filter
DASHBOARD
The high-contrast dashboard is designed to remain visible on both light and dark chart themes. It displays:
• Current market trend
• Moving-average alignment
• Selected signal MA
• Price position
• MA direction
• Active exit method
• Current ATR stop
• Volume-filter status
• Current trade status
VISUAL FEATURES
• Individually configurable moving-average plots
• Buy and Exit labels
• Bullish and bearish trend backgrounds
• Optional ATR trailing-stop line
• Adjustable dashboard position and size
ALERTS
Alert conditions are included for:
• Buy signals
• All exit signals
• MA-based exits
• ATR trailing exits
• Beginning of a strong uptrend
• Beginning of a strong downtrend
For more reliable live alerts, keep “Confirm Signals on Bar Close” enabled and select “Once Per Bar Close” when creating the TradingView alert.
SUGGESTED USE
The indicator can be used across stocks, indices, futures, forex and cryptocurrencies. Higher timeframes such as 4-hour, daily and weekly charts generally provide cleaner trend signals, while lower timeframes may generate more frequent signals and market noise.
This indicator is a trend-following decision-support tool. It does not predict future prices or guarantee profitable trades. Signals should be combined with appropriate position sizing, risk management, support and resistance analysis, and independent market evaluation. 지표

Pivot Channel Breakouts█ OVERVIEW
Pivot Channel Breakouts is an adaptive market-structure indicator. It automatically builds a sloped channel from confirmed High and Low pivots, checks the geometry of the formation, and marks a breakout only when the close moves beyond the channel by a minimum ATR margin.
After a breakout the channel is moved into history, and an optional TP/SL module draws Entry, Stop Loss and up to three Risk:Reward targets. The indicator can be used both to read structure and to plan a potential trade after the breakout.
█ CONCEPTS
The indicator automatically detects pivots and builds the widest possible price channel that still contains all remaining points and candle closes. The goal is to recognize channel formations quickly without drawing the lines by hand.
Pivot-Based Channel Structure
The channel has two independent boundaries:
- Resistance — the upper line from High pivots.
- Support — the lower line from Low pivots.
The channel is drawn only when both sides of the buffer hold the required number of pivots. With the default setting that means at least two High pivots and two Low pivots. Until one side is incomplete, no formation is created.
Each boundary needs at least two pivots. With more points the indicator does not require collinearity. It searches pairs and keeps the pair with the greatest span, provided the remaining pivots and the candle closes stay on the correct side of the line. The first two pivots of the formation must be opposite — one High and one Low — so the channel starts from an alternating structure rather than two extremes of the same side. Envelope fit describes the price structure, not a perfect straight line through every point.
Pivot Detection
Pivot Left is the number of bars before the extreme, Pivot Right is the number of bars after it required for confirmation. Smaller values detect more local turns, larger values produce fewer and usually more significant pivots. A pivot is confirmed only after Pivot Right bars, so detection has a built-in delay.
Pivot Count
This parameter sets how many of the most recent High and Low pivots are kept in the buffer. A value of 2 builds a segment through two points on each side. Higher values increase selectivity: a line is created only when a pair meeting the structural rules can be found. The channel does not appear until both sides have collected the same required number of pivots.
Pivot Age and Channel Width
Max Pivot Age removes old points so a fresh pivot is not paired with a stale extreme. Minimum Channel Width rejects formations that are too short and accidental.
Dynamic Channel Adjustment
Until a confirmed breakout, a wick can bend the active boundary toward the new extreme. A temporary wick pierce does not end the channel. A breakout still requires a close beyond the line with an ATR margin.
ATR-Based Breakout and Close-Based Confirmation
A breakout is valid on the close only:
- above resistance + ATR × multiplier — long,
- below support − ATR × multiplier — short.
A wick alone does not generate a signal. The threshold scales with volatility: a higher multiplier cuts false breakouts, a lower one produces more signals.
Channel History and Pivot Reset
After a breakout the active channel is cut at the breakout bar and moved into history. Max Channels Shown limits how many old formations remain on the chart.
Reset Pivots on Breakout off: the next channel can form immediately from a mix of old and new pivots. On: both buffers are cleared and a completely new set of points must be collected.
TP/SL Framework
Each new breakout can draw:
- Entry — the close of the breakout candle,
- SL — ATR × multiplier or a fixed percent from entry,
- TP1 / TP2 / TP3 — targets as multiples of the Entry–SL distance (RR).
The layout moves with the chart and is closed when price hits SL or the farthest enabled TP.
█ FEATURES
General
- Max channels shown (history) — how many completed channels stay on the chart. Older ones are removed after the limit is exceeded.
Pivots
- Pivot Left / Pivot Right — sensitivity and confirmation delay of pivot detection.
- Pivots required to define a line — number of points in the buffer (2–6) on each side. The channel appears only after that many High pivots and that many Low pivots have been collected.
- Max pivot age (bars) — maximum age of a point.
- Minimum channel width (bars) — minimum length of the formation.
- Line extension to the right (bars) — visual extension of the lines to the right only; it does not affect detection.
Breakout
- ATR Period — ATR length used for the minimum breakout size.
- Minimum breakout size (x ATR), close only — required distance beyond the line on the close.
- Reset pivots on breakout — clears the buffers after a signal.
Appearance
- Resistance / Support Color — boundary colors.
- Trend line transparency — transparency of the channel lines.
- Channel fill color + Fill transparency — fill between the boundaries.
- Show breakout signals — triangles below/above the bar.
- Show dots on pivots — markers on every newly confirmed pivot.
- Dot color — resistance / support pivots.
TP/SL
- Show TP/SL Levels — enables the full layout.
- SL = ATR — SL from ATR or from a percentage.
- ATR Period (TP/SL) — separate ATR for the targets.
- ATR Multiplier for SL / SL % from Entry.
- RR for TP1 / TP2 / TP3.
TP/SL Display
- Show SL / TP1 / TP2 / TP3 Level — independent display of each level and its label.
█ APPLICATIONS
Channel Structure Analysis
Automatic drawing of sloped boundaries instead of connecting pivots by hand. Useful in trends, pullbacks and periods when price respects two parallel or near-parallel edges.
Breakout Confirmation
A triangle marks a close outside the channel with an ATR filter, not a mere line pierce. It is a starting point for further analysis of direction, momentum and context — not a standalone entry signal.
Risk/Reward Planning
After a breakout, Entry, SL and three targets are visible at once. SL can be based on volatility (ATR) or on a fixed percentage.
█ NOTES
- Larger Pivot Left/Right values mean slower, more selective detection.
- The signal is close-only; a wick can only bend the line.
- The breakout threshold scales with ATR.
- After a breakout the channel is archived; the pivot reset setting decides whether the next formation starts from scratch.
- TP/SL is visual R:R planning, not an assessment of trade quality. 지표

Keltner Channel Trend + SMC Liquidity Sweep [BigBeluga]🔵 OVERVIEW
The Keltner Channel Trend + SMC Liquidity Sweep is an advanced technical indicator created by BigBeluga to map volatility channels alongside Smart Money Concepts (SMC) liquidity pools and structural sweep zones. Traditional momentum strategies often fail to account for institutional liquidity resting above swing highs and below swing lows. In order to provide a solution to this problem, this indicator combines Keltner Channel trend metrics with dynamic Buyside Liquidity (BSL) and Sellside Liquidity (SSL) box tracking, identifying high-probability liquidity sweeps and trend continuation triggers directly on the chart.
The indicator aims to visualize volatility expansion, structural liquidity pools, and stop-hunt reversal zones. The core element of its calculation involves evaluating Keltner Channel moving average basis lines and Average True Range offset bands alongside swing pivot extremes.
The system establishes a dynamic trend envelope using exponential moving averages and volatility multipliers, while swing pivot detection locates key structural high and low levels. Higher values of length and multiplier settings allow the indicator to filter market noise and isolate major institutional liquidity zones.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Keltner Channel Trend Engine
Adaptive Basis Midline: Computes an Exponential Moving Average basis line that dynamically changes color based on its slope.
Volatility Bands: Projects upper and lower ATR-based channel bands with a background fill to gauge volatility expansion and contraction.
2 — SMC Liquidity Pool Tracking
Buyside & Sellside Zones: Automatically plots dynamic BSL and SSL range boxes when swing pivots form outside the Keltner Channel boundaries.
Extended Box Projections: Continuously updates and extends active liquidity boxes forward until price interacts with the structural levels.
3 — Liquidity Sweep & Mitigation Detection
Sweep Reversals: Detects when price wicks past a liquidity level (BSL/SSL) but fails to close beyond it, signaling an institutional sweep and triggering entry labels.
Structural Break Handling: Automatically terminates and restyles liquidity boxes into dashed gray zones when candles close cleanly past the levels.
🔵 HOW TO USE
Apart from the basic visualization of trend channels, this tool can also act in alternative ways to support decision-making:
Spot Institutional Liquidity Sweeps: Monitor the chart for SSL sweep or BSL sweep labels occurring when price wicks past BSL or SSL boxes outside the Keltner bands.
Trade Trend Reversals from Sweeps: Use bullish SSL sweep signals as potential long entries following a sell-side liquidity grab, and bearish BSL sweep signals as short entries after a buy-side sweep.
Track Trend Momentum via Midline: Observe the color transitions of the Keltner Channel basis line to align trades with the prevailing higher-timeframe trend direction.
🔵 NOTES
Why this implementation is unique:
It bridges traditional volatility-based Keltner Channels with advanced Smart Money Concepts liquidity pooling and sweep detection.
The dynamic box engine automatically manages box extensions, terminations, and mitigation styling.
The script is fully optimized for performance, utilizing advanced box rendering, custom styling parameters, and strict bar confirmation logic for high-precision execution.
지표

Cumulative Delta Divergence Suite## Cumulative Delta Divergence Suite
The underlying cumulative-delta calculation and CDV candle construction are adapted from “Cumulative Delta Volume” by LonesomeTheBlue, licensed under MPL 2.0. This version adds independently developed divergence detection, multi-factor scoring, higher-timeframe analysis, absorption and exhaustion conditions, alerts, timeframe presets, and historical target/stop outcome analysis.
### Overview
Cumulative Delta Divergence Suite is a multi-module volume-pressure analysis indicator built around a cumulative delta oscillator.
The script compares confirmed price pivots with confirmed cumulative-delta pivots and combines divergence analysis with configurable scoring, higher-timeframe context, absorption conditions, Z-score extreme zones, timeframe presets, alerts, and simplified historical target/stop outcome tables.
The purpose of combining these components is to examine disagreement between price structure and directional volume pressure from several related perspectives. The modules are not simply displayed independently. Divergence magnitude, delta momentum, relative volume, trend alignment, higher-timeframe agreement, and pivot spacing can contribute to a shared scoring and classification process.
The displayed conditions are analytical observations. They do not predict that price will reverse, continue, or reach a particular level.
### Cumulative delta calculation
Standard chart volume does not directly separate executed buying volume from executed selling volume.
The cumulative-delta calculation used by this script derives directional volume from each candle's:
* total volume;
* body size;
* upper wick;
* lower wick;
* closing direction.
The resulting directional volume value is accumulated over time to construct the cumulative delta series.
The oscillator is displayed as candles in a separate pane. Users can display either the raw cumulative delta candles or an internally calculated Heikin-Ashi representation.
The Heikin-Ashi option smooths the oscillator structure, but this additional averaging can delay changes and alter the location of oscillator pivots.
The calculation is derived from chart OHLCV data. It does not use exchange bid/ask transaction classifications, footprint data, or order-book data.
### Divergence framework
The script compares confirmed pivots in price with confirmed pivots in the cumulative delta oscillator.
It identifies four divergence structures:
* Regular bullish divergence occurs when price forms a lower low while cumulative delta forms a higher low.
* Regular bearish divergence occurs when price forms a higher high while cumulative delta forms a lower high.
* Hidden bullish divergence occurs when price forms a higher low while cumulative delta forms a lower low.
* Hidden bearish divergence occurs when price forms a lower high while cumulative delta forms a higher high.
Regular divergence highlights disagreement between a new price extreme and the cumulative-delta structure.
Hidden divergence highlights a different form of structural disagreement that traders commonly examine within an existing trend.
Neither type establishes what price will do afterward.
### How the modules work together
The script is designed as a cumulative-delta analysis workflow rather than a collection of unrelated indicators.
Divergence provides the primary structural condition by comparing price pivots with cumulative-delta pivots.
The scoring system then evaluates additional characteristics surrounding that divergence, including divergence magnitude, recent delta-momentum change, relative volume, trend alignment, higher-timeframe agreement, and the distance between the compared pivots.
Absorption conditions examine bars where comparatively strong directional volume occurs with limited price progress under the selected volume, range, body, and confluence filters.
Z-score zones identify cumulative-delta readings that are unusually high or low relative to their recent distribution.
Higher-timeframe analysis provides broader confirmed divergence, trend, and volume context.
These components therefore perform different roles within the same analysis process rather than simply duplicating one another.
### How to use the indicator
Apply the indicator to a symbol that provides usable volume data.
The cumulative delta candles appear in a separate pane below the price chart.
A practical workflow is:
1. Review the broader price trend and market structure.
2. Observe whether cumulative delta generally confirms or disagrees with price.
3. Wait for a confirmed regular or hidden divergence condition.
4. Inspect the optional price and oscillator divergence lines to see which pivots were compared.
5. Review the divergence strength score and A+, B, or C category.
6. Check whether confirmed higher-timeframe context agrees with the current structure.
7. Review nearby absorption conditions and Z-score extreme zones.
8. Examine support, resistance, volatility, liquidity, and candle structure separately.
9. Treat all markers as analytical conditions rather than automatic trade instructions.
10. Test settings, alerts, and historical outcome assumptions on the intended symbol and timeframe.
### Regular bullish divergence
Regular bullish divergence is confirmed when:
* price forms a lower confirmed low;
* cumulative delta forms a higher confirmed low.
Price has therefore reached a new lower pivot while the cumulative-delta oscillator has not produced a corresponding lower pivot.
Traders may examine this disagreement together with market structure, support, momentum, cumulative-delta behaviour after confirmation, Z-score context, absorption conditions, and higher-timeframe structure.
The condition can fail, and price can continue lower after confirmation.
### Regular bearish divergence
Regular bearish divergence is confirmed when:
* price forms a higher confirmed high;
* cumulative delta forms a lower confirmed high.
Price has therefore reached a new higher pivot while the cumulative-delta oscillator has not produced a corresponding higher pivot.
Traders may examine this disagreement together with market structure, resistance, momentum, cumulative-delta behaviour after confirmation, Z-score context, absorption conditions, and higher-timeframe structure.
The condition can fail, and price can continue higher after confirmation.
### Hidden bullish divergence
Hidden bullish divergence is confirmed when:
* price forms a higher confirmed low;
* cumulative delta forms a lower confirmed low.
This structure is commonly examined within an existing upward trend because price retains a higher low while cumulative delta makes a deeper retracement.
It does not guarantee that the upward trend will continue.
### Hidden bearish divergence
Hidden bearish divergence is confirmed when:
* price forms a lower confirmed high;
* cumulative delta forms a higher confirmed high.
This structure is commonly examined within an existing downward trend because price retains a lower high while cumulative delta makes a stronger retracement.
It does not guarantee that the downward trend will continue.
### Raw and Heikin-Ashi CDV candles
When Heikin-Ashi CDV candles are disabled, the script uses the raw cumulative delta candle values.
When they are enabled, the script applies an internal Heikin-Ashi transformation to the cumulative delta series.
This affects only the oscillator displayed by the indicator. It does not convert the main TradingView price chart to Heikin-Ashi candles.
The smoothed representation can make broader cumulative-delta structure easier to inspect, but it may also delay short-term changes and alter oscillator pivot locations.
### Pivot settings and confirmation delay
Pivot Left controls how many earlier bars participate in identifying a pivot.
Pivot Right controls how many later bars must pass before that pivot becomes confirmed.
Higher pivot values generally produce fewer pivots, filter more short-term movement, and confirm conditions later.
Lower pivot values generally produce more pivots and react more quickly, but they are also more sensitive to short-term movement.
A pivot-based divergence is not known on the original pivot bar.
The script must wait for the configured number of Pivot Right bars before the pivot can be confirmed.
After confirmation, divergence markers and optional connecting lines are drawn at the original pivot location so users can visually inspect the price-versus-CDV structure.
For example, when Pivot Right is 5, five subsequent bars are required before the pivot is confirmed.
Consequently, a historical divergence marker appears on the earlier pivot bar even though the condition only became known several bars later.
Alerts for pivot-based divergences occur after confirmation, not on the earlier pivot bar.
### Divergence lines
The script can draw oscillator pivot-to-pivot lines in the indicator pane and corresponding price pivot-to-pivot lines on the main chart.
These lines show the exact pair of pivots used for the divergence comparison.
For example, regular bullish divergence connects two price lows where the newer price pivot is lower while the corresponding cumulative-delta pivot is higher.
The lines can be disabled when a cleaner chart is preferred.
### Divergence strength score
The optional divergence strength value measures the relative displacement between the compared price pivots and cumulative-delta pivots.
It is derived from the magnitude of the price movement and the magnitude of the oscillator movement between the compared pivots.
It is not a probability, win rate, or forecast.
The Minimum Divergence Strength setting can suppress conditions whose calculated magnitude is below the selected value.
### Composite scoring
Each confirmed divergence can receive a configurable composite score.
The score combines several measurements:
* divergence strength;
* recent change in smoothed delta momentum;
* volume relative to its recent average;
* alignment with the script's EMA-based trend state;
* agreement with confirmed higher-timeframe divergence context;
* distance between the compared pivots.
Each component performs a different function.
Divergence strength measures the magnitude of the structural disagreement.
Delta momentum examines recent directional change in the smoothed delta series.
Relative volume measures participation around the evaluated pivot.
Trend alignment provides directional price context.
Higher-timeframe agreement measures whether the selected confirmed HTF divergence context supports the same side.
Pivot spacing distinguishes closely grouped pivots from structures developing across a wider interval.
Users can adjust the contribution of these components through the scoring weights.
The active weights are normalized before the final composite value is calculated.
The score organizes conditions according to the selected model. It is not a prediction of future performance.
### Score categories
The script assigns A+, B, or C categories according to the configured score thresholds.
These categories are internal classifications.
They are not probabilities, win rates, accuracy measurements, guarantees, or independently validated performance rankings.
An A+ category means only that the condition reached the highest configured score range.
A B category means that the condition reached the middle configured range.
A C category represents conditions below the B threshold that remain eligible under the selected filter.
The Minimum Grade setting can suppress conditions below the selected category.
### Score transformation
The Score Boost Power applies a nonlinear transformation to the composite score before the A+, B, and C thresholds are evaluated.
Lower values compress scores upward and therefore allow higher categories to occur more frequently.
Higher values keep transformed scores closer to the underlying composite values and make the upper categories more selective.
This setting changes the script's internal classification behaviour. It does not increase the probability that a condition will succeed.
### Adaptive score scaling
When Adaptive Grade Scaling is enabled, the script compares the current raw composite score with the recent distribution of composite scores.
It uses a rolling mean and standard deviation to place the current value in the context of recently observed values before the category thresholds are applied.
When adaptive scaling is disabled, category thresholds are applied to the unscaled composite score.
Because adaptive scaling is relative to recent observations, the same general type of structure can receive different categories under different market conditions.
### Higher-timeframe context
The script can evaluate divergence context from a user-selected higher timeframe.
The HTF module calculates its pivot structure, trend context, and relative-volume component using confirmed data from the requested higher timeframe.
The script uses the last fully closed higher-timeframe information rather than relying on a still-forming HTF candle.
This means higher-timeframe information becomes available only after the required higher-timeframe data has been confirmed.
The HTF module identifies regular bullish, regular bearish, hidden bullish, and hidden bearish cumulative-delta divergence structures.
Its scoring process combines HTF divergence strength with HTF trend context and HTF volume participation.
Higher-timeframe conditions can be displayed separately and can also contribute to the chart-timeframe composite score.
An independent HTF Minimum Grade setting determines which higher-timeframe categories are displayed.
Because confirmed HTF data is used, higher-timeframe conditions can appear later than chart-timeframe conditions.
Higher-timeframe context should therefore be interpreted as broader confirmed information rather than an earlier signal.
### Absorption conditions
The absorption module searches for bars where comparatively large directional delta occurs while price progress remains constrained under the selected filters.
The module evaluates:
* directional delta relative to its recent average;
* volume relative to its recent average;
* candle range relative to its average;
* candle body as a proportion of the complete range;
* an optional close opposing the delta direction;
* optional proximity to a recently graded divergence.
A bullish absorption condition is associated with comparatively strong negative delta while downward price progress remains limited under the configured filters.
A bearish absorption condition is associated with comparatively strong positive delta while upward price progress remains limited under the configured filters.
The module is derived from chart OHLCV information. It does not prove that passive limit orders absorbed aggressive market orders.
The markers should therefore be interpreted as absorption-style analytical conditions rather than direct measurements of order-book behaviour.
### Absorption confluence and filtering
Absorption conditions can be filtered using recent divergence proximity, minimum divergence category, cooldown bars, volume thresholds, delta thresholds, range thresholds, body-to-range limits, and optional opposite-close confirmation.
When divergence confluence is enabled, the absorption condition must occur within the configured number of bars following a qualifying divergence.
The absorption grade displayed with a condition is derived from the nearby qualifying divergence category.
These filters change which conditions are displayed. They do not guarantee a particular subsequent price outcome.
### Z-score extreme zones
The script calculates a Z-score from the cumulative-delta oscillator's rolling mean and standard deviation.
A lower extreme zone appears when the oscillator moves below the selected negative Z-score threshold.
An upper extreme zone appears when the oscillator moves above the selected positive threshold.
These zones identify values that are unusually high or low relative to the oscillator's recent statistical distribution.
The Z-Score Length determines how much history contributes to the rolling mean and standard deviation.
The Z-Score Threshold determines how many standard deviations the oscillator must move from its rolling mean before an extreme zone is displayed.
Higher thresholds produce fewer extreme zones. Lower thresholds produce more frequent zones.
An extreme value does not establish that buying or selling pressure is exhausted and does not establish that price will reverse.
Extreme readings can persist or become more extreme.
### Using divergence, absorption, and Z-score context together
The modules provide different forms of information.
Divergence compares price pivot structure with cumulative-delta pivot structure.
Absorption examines strong directional delta occurring with constrained price progress.
Z-score analysis measures whether cumulative delta is unusually high or low relative to recent values.
Higher-timeframe analysis provides broader confirmed structural context.
Composite scoring organizes divergence conditions according to multiple characteristics of the setup.
The purpose of combining these modules is to provide several related perspectives on price-versus-volume-pressure disagreement without treating any one module as a complete trading system.
Confluence between modules provides additional analytical context but does not automatically validate a condition or guarantee reversal or continuation.
### Timeframe presets
The script contains lower-, medium-, and higher-timeframe preset bundles.
The presets adjust selected settings including:
* pivot lengths;
* score transformation power;
* adaptive score scaling;
* Heikin-Ashi CDV display;
* absorption averaging lengths;
* absorption thresholds;
* absorption confluence lookback.
The presets are intended as starting configurations.
They are not automatically optimized for the active symbol and have not been fitted to guarantee particular historical results.
Users can disable Apply Timeframe Preset to configure the corresponding settings manually.
### Cooldown settings
Independent cooldown controls can reduce repeated conditions of the same type.
Separate cooldown settings are available for regular divergences, hidden divergences, higher-timeframe divergences, absorption conditions, and Z-score extreme conditions.
A value of zero disables the relevant cooldown.
Higher cooldown values reduce repeated same-direction markers but can also suppress nearby structures that would otherwise qualify.
### Historical target/stop outcome tables
Optional tables provide a simplified historical outcome study for confirmed divergence and absorption conditions.
When a condition is confirmed, the script records the confirmation-bar closing price and calculates a fixed percentage target and fixed percentage stop level.
The target and stop percentages are user configurable.
Outcome evaluation begins on the bar after the condition is confirmed.
This prevents price movement that occurred earlier within the confirmation bar from being counted as a subsequent target or stop event.
Each confirmed condition is tracked independently.
If another qualifying condition appears before an earlier condition has resolved, the newer condition does not replace the earlier unresolved condition in the historical study.
For each tracked condition, the script records whether the target or stop is reached first.
If both the target and stop are touched during the same evaluation candle, standard OHLC chart data does not reveal which level was reached first. In this situation the script uses a conservative convention and counts the stop as occurring first.
Separate tables are available for:
* regular bullish divergence;
* regular bearish divergence;
* hidden bullish divergence;
* hidden bearish divergence;
* bullish absorption;
* bearish absorption.
The tables display the number of target-first outcomes, stop-first outcomes, and the resulting target-first percentage for the available chart history.
These tables are intended as a basic chart-based comparison tool.
They are not TradingView Strategy Tester results and are not a complete strategy backtest.
They do not model commissions, slippage, bid/ask spread, realistic order execution, position sizing, portfolio equity, liquidity, partial fills, or complete intrabar price sequencing.
Historical results depend on the symbol, timeframe, available chart history, target and stop distances, filters, indicator settings, and available volume data.
The table percentages describe only the simplified historical study produced under those settings. They do not imply future performance.
### Evaluation target and stop lines
The script can display the fixed target and stop levels associated with the most recently confirmed qualifying condition.
The Target and Stop labels remain anchored at the left side of their respective lines. While the outcome is unresolved, the lines extend to the right. Once either the target or stop is reached, the lines end at the resolution bar and remain visible until a newer qualifying condition replaces them.
These levels use the same configurable percentage distances as the historical outcome study and are provided for visual evaluation rather than as trading recommendations.
Only the most recent Target/Stop pair is displayed to limit chart clutter, while historical conditions continue to be tracked independently by the outcome tables.
### Alerts
Alerts are available for configured divergence, absorption, and exhaustion conditions.
Pivot-based regular and hidden divergence alerts occur only after the required Pivot Right bars have confirmed the pivot.
A+ divergence alerts require the underlying divergence to qualify for the A+ category.
Absorption conditions can depend on values from the current chart bar and can therefore change while that bar is still forming.
Z-score extreme conditions can likewise change as the current chart bar develops.
Users who require closed-bar confirmation should configure their TradingView alert frequency accordingly.
Higher-timeframe divergence context uses confirmed higher-timeframe information.
### What makes the implementation distinct
The script extends a cumulative-delta framework into a broader price-versus-volume-pressure analysis workflow.
Its distinguishing structure includes:
* cumulative delta candle visualization;
* optional internal Heikin-Ashi smoothing;
* regular and hidden pivot-based price/CDV divergence analysis;
* configurable divergence strength filtering;
* multi-factor divergence scoring;
* user-adjustable scoring weights;
* nonlinear score transformation;
* adaptive score scaling;
* A+, B, and C classification and filtering;
* confirmed higher-timeframe divergence analysis;
* higher-timeframe trend and volume context;
* absorption conditions that can be linked to recently graded divergences;
* Z-score extreme analysis;
* timeframe-based parameter presets;
* independent cooldown controls;
* independent tracking of historical target/stop outcomes;
* configurable target and stop evaluation levels;
* divergence, absorption, exhaustion, and grade-based alerts.
The purpose of this combination is to evaluate price-versus-cumulative-delta disagreement using several related measurements within a single workflow.
The divergence module identifies the structural event. The score measures characteristics of that structure and its surrounding context. Higher-timeframe analysis supplies broader confirmed context. Absorption examines directional volume occurring with limited price progress. Z-score analysis identifies statistically unusual oscillator readings. The historical tables provide a simplified way to inspect what happened after past qualifying conditions.
This integration is the reason the components are combined rather than published merely as separate common indicators placed together.
### Limitations
Cumulative delta in this script is derived from candle structure and chart volume rather than exchange bid/ask transaction classifications.
Volume quality and interpretation vary between exchanges, brokers, instruments, and symbols.
Pivot-based divergences are delayed by the selected Pivot Right value.
Confirmed pivot markers and divergence lines are drawn on the earlier pivot location after confirmation, so historical marker placement is earlier than the time at which the condition became known.
Heikin-Ashi smoothing changes the cumulative-delta oscillator structure and can introduce additional delay.
Higher-timeframe analysis waits for confirmed HTF information, which can delay HTF conditions.
Divergence conditions can fail and price can continue in the same direction after a divergence has been confirmed.
Hidden divergence does not guarantee trend continuation.
Absorption conditions are OHLCV-based analytical approximations and do not directly identify passive order-book absorption.
Z-score extremes can persist or become more extreme.
Composite scores and A+, B, and C categories are model outputs, not probabilities, win rates, accuracy measurements, or independently validated performance rankings.
Adaptive scaling can change classifications as the recent score distribution changes.
Lower timeframes can produce more frequent and noisier conditions.
Timeframe presets are starting configurations and are not automatically optimized for a symbol.
Historical target/stop tables are simplified outcome studies and do not represent complete strategy backtests.
Historical target-first percentages depend heavily on the selected target/stop distances, indicator settings, symbol, timeframe, available history, and market conditions.
The indicator does not model commissions, slippage, spread, liquidity, or realistic execution.
No divergence, score category, absorption condition, Z-score reading, target/stop outcome, or combination of these elements guarantees future market behaviour.
The indicator should not be used as the sole basis for a trading decision.
This script is an analytical tool and does not provide financial advice or guaranteed trading outcomes. 지표

MAD Volatility Trail [BackQuant]MAD Volatility Trail
Overview
MAD Volatility Trail is a robust trend-following overlay built from a rolling median and Median Absolute Deviation rather than a conventional moving average and standard deviation.
The indicator estimates a central price using the rolling median, measures how widely recent prices are distributed around that median using MAD, converts that dispersion into adaptive upper and lower bands, and then transforms those bands into one-sided trailing boundaries.
The result is a persistent bullish or bearish trend regime with:
A robust median-based center.
MAD-derived volatility bands.
Optional ATR minimum band width.
One-sided trailing support and resistance.
Optional median-slope confirmation.
Bullish and bearish regime flips.
Strength-reactive gradient and glow.
Post-flip bloom visualization.
Trend-coloured candles.
Signal and alert support.
The main distinction is statistical.
Most volatility trails rely on:
Means.
Standard deviation.
ATR.
MAD Volatility Trail instead uses:
Median.
Median Absolute Deviation.
Median-based statistics are substantially less sensitive to isolated extreme observations, making the framework useful when the user wants a trend structure that is less influenced by individual spikes or outliers.
Core concept
The indicator separates the problem into four stages:
Estimate a robust rolling center using the median.
Measure robust dispersion around that center using MAD.
Build upper and lower adaptive deviation bands.
Convert those raw bands into persistent trailing trend boundaries.
The resulting trail behaves conceptually like a volatility-aware regime filter, but its volatility estimate comes primarily from the empirical distribution of price around its median.
Why median instead of mean?
A conventional arithmetic mean is calculated by summing all observations and dividing by their count.
Every value directly affects the result.
This makes the mean sensitive to outliers.
Consider a simplified sample:
100
101
101
102
150
The extreme value at 150 pulls the arithmetic mean upward substantially.
The median is simply the middle observation after sorting:
Median = 101
The single extreme observation has much less influence.
This property is called robustness .
In markets, isolated large candles, gaps, liquidation events and temporary price spikes can distort mean-based statistics. Median-based calculations intentionally reduce the influence of those individual observations.
Rolling median
For each bar, the indicator collects the selected Source values across the MAD Lookback.
It then calculates the exact median of the available observations.
For an odd number of observations, the median is the middle sorted value.
For an even number, the median lies between the two central observations according to the median implementation.
The resulting value becomes the statistical center of the trail.
Unlike an EMA or RMA, the median is not recursively smoothed.
It is recomputed from the actual distribution of values inside the current rolling window.
Early-history behaviour
At the beginning of the chart, the script ignores unavailable historical values.
This means the first valid median calculations may use fewer observations than the full MAD Lookback until sufficient chart history has accumulated.
Once the complete lookback is available, the calculation uses the full selected window.
Median Absolute Deviation
After calculating the rolling median, the script measures the absolute distance of every observation from that median:
Absolute Deviation = |Value - Median|
It then takes the median of those absolute deviations:
MAD = Median(|Xi - Median(X)|)
This is the Median Absolute Deviation .
MAD measures the typical distance of observations from the median.
It serves a role similar to standard deviation, but the mathematics and statistical behaviour are different.
Why MAD is robust
Standard deviation squares deviations from the mean.
Large deviations therefore receive disproportionately large influence.
A single extreme observation can:
Move the mean.
Create a very large squared deviation.
Increase the final standard deviation substantially.
MAD does not square deviations.
It calculates absolute distance and then takes another median.
Extreme values therefore have limited ability to change the result unless enough of the underlying sample shifts.
This gives MAD a high resistance to outliers.
In practical chart terms, one unusual wick or shock candle is less likely to inflate the statistical width as dramatically as it could under a standard-deviation model.
MAD versus standard deviation
The two measures answer related but different questions.
Standard deviation
Measures squared dispersion around the arithmetic mean.
MAD
Measures median absolute dispersion around the median.
Standard deviation is highly useful when a mean-and-variance framework is desired.
MAD is useful when robustness to unusual observations is more important.
The indicator does not claim one is universally superior.
It intentionally uses MAD because the purpose is to construct a robust trend boundary.
MAD Scale
Raw MAD is not numerically identical to standard deviation.
Under a normal distribution, MAD is usually multiplied by a consistency factor of approximately 1.4826 when the goal is to make it comparable to standard deviation.
The indicator exposes this scaling directly:
Robust Deviation = Raw MAD × MAD Scale
The script default is 1.4655.
The input remains fully adjustable, so users who want the conventional normal-consistency approximation can set the factor near 1.4826.
This scale does not change the median itself.
It changes only the size of the deviation estimate used to build the bands.
Deviation Factor
After scaling MAD, the indicator applies the Deviation Factor:
MAD Width = Scaled MAD × Deviation Factor
This acts as the main sensitivity control.
Lower values:
Create narrower raw bands.
Place the trail closer to price.
Produce more frequent regime changes.
Higher values:
Create wider bands.
Require larger movement for reversals.
Produce more persistent trend states.
The MAD Scale and Deviation Factor both affect width, but they represent different concepts.
MAD Scale calibrates the statistical dispersion estimate.
Deviation Factor determines how much of that estimated dispersion is used for the trend envelope.
Raw MAD bands
The raw bands are:
Upper MAD Band = Median + Band Width
Lower MAD Band = Median - Band Width
Before trailing logic is applied, these bands can move freely upward or downward with:
The rolling median.
MAD dispersion.
Any active ATR floor.
These are statistical envelopes around the median.
They are not yet the final trend trail.
ATR Minimum Width
MAD can become extremely small when recent prices are tightly clustered.
In very low-dispersion conditions, this may place the raw bands extremely close to the median.
That can create excessive sensitivity to minor price fluctuations.
The optional ATR Minimum Width provides a secondary floor.
The script calculates:
ATR Floor = ATR(ATR Length) × ATR Floor Multiplier
When enabled:
Band Width = max(MAD Width, ATR Floor)
This means MAD remains the primary volatility model, but the bands cannot contract below the selected ATR-based threshold.
Why use an ATR floor?
MAD and ATR measure different aspects of market behaviour.
MAD measures:
Dispersion of the selected source around its rolling median.
ATR measures:
Bar-to-bar trading range.
Gaps relative to the previous close.
A market can have:
Low median dispersion.
But still produce meaningful intrabar range.
The ATR floor can prevent the trail from becoming unrealistically tight under those conditions.
ATR floor disabled
With ATR Minimum Width disabled, the entire structural width comes from:
MAD × MAD Scale × Deviation Factor
This produces the purest MAD-based version of the indicator.
ATR Length
ATR Length controls the volatility horizon used only for the optional minimum-width calculation.
It does not affect:
The rolling median.
Raw MAD.
Scaled MAD.
Note that the visual glow and bloom later in the script use a fixed ATR(14), separate from this ATR Length input.
Trailing bands
The raw MAD bands are converted into one-sided trails.
This is the stage that turns a statistical envelope into a persistent trend system.
Two independent trails are maintained:
Lower Trail.
Upper Trail.
Lower Trail
When the previous trigger remains above the previous Lower Trail, the new Lower Trail is:
max(Current Raw Lower Band, Previous Lower Trail)
This means the Lower Trail can:
Move upward.
Remain unchanged.
But cannot move downward while the condition remains active.
This creates a ratcheting support structure.
If the trigger falls below the prior Lower Trail, the trail is allowed to reset to the new raw lower band.
Upper Trail
When the previous trigger remains below the previous Upper Trail, the new Upper Trail is:
min(Current Raw Upper Band, Previous Upper Trail)
This means the Upper Trail can:
Move downward.
Remain unchanged.
But cannot move upward while the condition remains active.
This creates a ratcheting resistance structure.
If the trigger rises above the previous Upper Trail, the band can reset to the current raw upper value.
Why trailing the bands matters
A raw median-deviation envelope moves in both directions.
If those raw bands were used directly for trend changes:
The threshold itself could retreat toward price.
Small changes in median or MAD could produce unstable reversals.
The one-sided trail introduces hysteresis .
Hysteresis means that once a trend regime is established, the threshold required to reverse it remains on the opposing side.
This reduces the tendency to flip repeatedly around the rolling median.
Flip Trigger
The user can choose which series is used when evaluating trail breaks:
Close.
Source.
Close
Uses the candle close regardless of which series is used for the MAD calculation.
This is the conventional option.
Source
Uses the selected Source input.
For example, if HLC3 is selected as the Source:
The median is calculated from HLC3.
MAD is calculated from HLC3.
The trail can also be triggered by HLC3.
This keeps the center, dispersion and reversal trigger based on the same source.
Initial trend state
The trend begins in a neutral state.
Once a valid rolling median is available:
Trigger at or above Median = bullish initialization.
Trigger below Median = bearish initialization.
This initial assignment is not treated as a bullish or bearish flip.
Flip signals occur only after the indicator has already established one regime and later transitions into the opposite regime.
Bullish flip
A bullish regime change requires:
Trigger to move above the Upper Trail.
Current trend not already bullish.
Optional bullish median-slope confirmation to pass.
Once confirmed:
Trend becomes bullish.
The Lower Trail becomes the active trend boundary.
A bullish signal can be displayed.
Bearish flip
A bearish regime change requires:
Trigger to move below the Lower Trail.
Current trend not already bearish.
Optional bearish median-slope confirmation to pass.
Once confirmed:
Trend becomes bearish.
The Upper Trail becomes the active boundary.
A bearish signal can be displayed.
Active trend trail
The final displayed trend boundary depends on the regime:
Bullish = Lower Trail.
Bearish = Upper Trail.
This means the line automatically moves to the opposite side of price when a complete regime change occurs.
Median Slope Confirmation
The optional Median Slope Confirmation adds a directional requirement to trend reversals.
For a bullish flip:
Current Median > Median from Slope Lookback bars ago
For a bearish flip:
Current Median < Median from Slope Lookback bars ago
This requires the robust statistical center itself to move in the direction of the proposed new trend.
Why confirm with median slope?
Price can briefly cross a trail while the underlying median remains flat or continues moving in the opposite direction.
Slope confirmation can reject some of these events.
For example:
A bullish trail break with a still-falling median may represent:
A temporary rebound.
A liquidity sweep.
Noise inside a larger bearish structure.
Requiring the median to rise adds another layer of confirmation.
The trade-off is lag.
A genuine reversal may cross the trail before the rolling median has clearly changed direction.
Slope Lookback
Slope Lookback controls how far back the median is compared.
Lower values:
Respond more quickly.
Require only a very local median turn.
Higher values:
Require a broader directional shift.
Produce stronger confirmation.
Can delay reversals.
This same lookback is also used in the visual slope-strength calculation even when slope confirmation itself is disabled.
Break Trail On Flips
When enabled, the displayed trail is temporarily hidden on the actual regime-flip bar.
This creates a visual break between:
The previous regime’s trail.
The new regime’s trail.
Without the break, the plotting engine can draw a connecting segment from one side of the market to the other.
That connection has no analytical meaning.
Break Trail On Flips affects visualization only.
It does not affect:
Trend state.
Raw bands.
Trail calculations.
Signals.
Robust trend structure
The complete structural model can therefore be summarized as:
Rolling Median determines robust center.
MAD determines robust dispersion.
MAD Scale calibrates the dispersion.
Deviation Factor determines band distance.
Optional ATR floor prevents excessive compression.
Raw bands form the initial envelope.
Ratchet logic creates trailing support and resistance.
Opposite-trail breaks determine regime changes.
Optional median slope confirms those reversals.
This combination is what separates the indicator from simply plotting median ± MAD.
Visual strength model
The script calculates a separate Trend Strength value used only to control the presentation of the gradient and glow.
It does not alter:
Trend direction.
Trail levels.
Flip conditions.
Trend Strength combines:
Price distance from the active trail.
Absolute rolling-median slope.
Distance Strength
The script first measures:
Trail Distance = |Close - Active Trail|
This is normalized by the current band width.
The normalized distance is capped when price reaches twice the active band width away from the trail.
Conceptually:
Close to trail = low distance strength.
Far from trail = high distance strength.
This reflects how separated price is from the current structural boundary.
Slope Strength
The indicator also measures:
|Current Median - Median |
This value is normalized by the current band width and capped at one.
The purpose is to compare median movement against the current statistical width.
A steep median relative to the band width produces stronger visual slope strength.
Combined Trend Strength
The final visual strength is:
70% Distance Strength.
30% Median Slope Strength.
and is capped at one.
The distance component receives greater weight because the visual system places more emphasis on how strongly price is separated from the active trail.
Again, this number is not a probability, forecast or additional signal.
It is a visual intensity measure.
Layered gradient
The area between the active trail and current close is divided into several intermediate levels.
The script creates reference points approximately:
15% of the distance from trail to price.
35%.
60%.
82%.
Then the final segment to price.
These create five layered gradient regions.
The layers become progressively more transparent as they move away from the trail.
This gives the trail visual depth without turning the entire area between price and structure into one solid block.
Gradient direction
The geometry of the gradient is determined by whether close is above or below the active trail.
The colour itself comes from the current bullish or bearish trend regime.
The gradient therefore visualizes:
The active trend colour.
The distance between price and trail.
The relative strength of the trend visualization.
The gradient does not determine the regime.
Trend-strength gradient response
Higher Trend Strength reduces transparency in several layers.
This makes the ribbon more visible when:
Price is strongly separated from the trail.
The rolling median is moving meaningfully.
Lower strength produces a softer appearance.
This allows the visual presentation to communicate more than simple bullish or bearish state.
Flip bloom
The indicator includes a temporary post-flip bloom.
The bloom is derived from the number of bars elapsed since the most recent bullish or bearish transition.
Importantly, in the current implementation the bloom begins after the flip bar:
Flip bar: no bloom boost.
1 bar after flip: maximum bloom.
2 bars after flip: reduced bloom.
3 bars after flip: smaller residual bloom.
Afterward: bloom disappears.
The relative bloom strengths are:
1.00
0.55
0.25
This emphasizes the early bars following a newly confirmed regime change.
Why bloom after the flip?
The flip itself can optionally contain a break in the trail.
Applying the bloom to the following bars emphasizes the newly established active trail rather than drawing a large effect around a temporarily hidden flip point.
The bloom is cosmetic.
It does not modify the underlying calculations.
Trail glow
The active trail can also display a persistent glow.
Glow width is based on:
ATR(14) × a factor that increases with Trend Strength
This ATR(14) is fixed for visualization and is independent of the user-selected ATR Length used by the optional minimum-width floor.
The glow therefore becomes slightly wider as visual trend strength increases.
Two layers are used:
A tighter inner glow.
A broader outer glow.
The inner glow responds more strongly to Trend Strength and post-flip bloom.
Rolling Median display
The rolling median can be displayed independently from the trail.
This is useful for studying the difference between:
The current robust center.
The statistical raw bands.
The ratcheting trend trail.
During a bullish regime, the active Lower Trail can remain below the rolling median.
During a bearish regime, the active Upper Trail can remain above it.
The median is not itself the trend signal.
Raw MAD Bands display
The raw upper and lower MAD bands can also be shown.
These lines make it easier to see how the trailing logic differs from the unrestricted statistical envelope.
Raw bands:
Can move in either direction.
Trailing bands:
Can ratchet in only one direction while their persistence condition remains active.
The gap between raw and trailing levels illustrates the hysteresis introduced by the trend logic.
Trend candles
The script can redraw candles on the main chart using the active trend colour.
Bullish regime:
Uses the selected Bullish colour.
Bearish regime:
Uses the selected Bearish colour.
The candle colour represents the persistent trail regime, not whether each individual candle closed higher or lower.
A bearish candle can therefore remain bullish-coloured while the broader MAD Trail regime remains bullish.
Signal markers
Bullish and bearish markers appear only on complete transitions between established regimes.
A bullish marker requires:
Previous trend = bearish.
Current trend = bullish.
A bearish marker requires:
Previous trend = bullish.
Current trend = bearish.
Initial trend assignment does not generate a flip marker.
How to interpret the indicator
Bullish regime
A bullish state means price has previously broken above the opposing Upper Trail and the Lower Trail is now active.
The Lower Trail can be interpreted as:
Dynamic trend support.
A structural invalidation reference.
A trailing regime boundary.
Bearish regime
A bearish state means price has broken below the opposing Lower Trail and the Upper Trail is active.
The Upper Trail can be interpreted as:
Dynamic resistance.
A bearish invalidation reference.
A trailing regime boundary.
Price close to trail
When price approaches the active trail:
Visual distance strength decreases.
The gradient becomes softer.
The market is closer to the regime boundary.
This does not guarantee a reversal.
A healthy trend can repeatedly retest its active trail.
Price far from trail
When price moves substantially away:
Distance Strength rises.
The visual effect becomes stronger.
This indicates greater separation from the active structural boundary.
It should not automatically be interpreted as a better entry.
A market can be strongly extended and simultaneously close to exhaustion.
Median and trail rising together
During a bullish regime, a rising median combined with a rising Lower Trail indicates:
The robust center is moving upward.
The structural support boundary is also advancing.
This represents cleaner directional alignment.
Median flattening while trail remains bullish
The persistent regime can remain bullish while the median begins flattening.
This indicates:
The trend has not yet been invalidated.
But the robust center is no longer advancing as strongly.
The visual slope-strength component may weaken under this condition.
Raw band expansion
If MAD increases:
Raw bands widen.
Trail reset levels can move farther away.
This means recent source values are becoming more dispersed around the median.
Raw band contraction
If MAD falls:
The raw envelope tightens.
If the ATR floor is disabled, the structure can become substantially narrower.
If the ATR floor is enabled, contraction stops once the selected minimum width is reached.
How to use the indicator
1. Trend regime filter
Use the persistent trail state as directional context:
Bullish trail regime = prioritize long-side setups.
Bearish trail regime = prioritize short-side setups.
The trail does not define a complete trading system by itself.
2. Pullback structure
During a bullish regime, the Lower Trail can provide a dynamic reference for deeper pullbacks.
During a bearish regime, the Upper Trail can provide a reference for rallies.
The farther price moves from the trail, the greater the current structural separation.
3. Regime transitions
Bullish and bearish flips identify moments when price has crossed completely through the opposing robust-deviation trail.
These may be used as:
Trend-change alerts.
Confirmation for another entry method.
Potential exit conditions.
4. Median confirmation
Users who want more selective signals can enable Median Slope Confirmation.
This can be especially useful when:
The market is choppy.
Price frequently sweeps through statistical boundaries.
5. Pure robust-volatility mode
Disable the ATR Minimum Width to make band width depend only on:
Rolling MAD.
MAD Scale.
Deviation Factor.
This produces the purest version of the model.
6. Hybrid robust-volatility mode
Enable ATR Minimum Width when the MAD channel becomes too narrow for the instrument or timeframe.
This preserves MAD as the primary engine while adding a conventional range-based safety floor.
Input guide
Source
Series used for the rolling median and MAD calculation.
MAD Lookback
Controls the number of observations used for the rolling median and dispersion estimate.
Shorter values adapt faster.
Longer values create a broader and more stable distribution.
MAD Scale
Multiplier applied directly to raw MAD.
The commonly cited normal-distribution consistency factor is approximately 1.4826; the script default is 1.4655.
Deviation Factor
Controls the final width of the MAD envelope.
ATR Minimum Width
Prevents the active band width from falling below an ATR-derived floor.
ATR Length
Controls the ATR used by the optional floor.
ATR Floor
Controls the minimum width as a multiple of ATR.
Median Slope Confirmation
Requires the rolling median to move in the direction of a proposed trend flip.
Slope Lookback
Controls how far back the current median is compared.
It also influences the visual slope-strength calculation.
Flip Trigger
Selects Close or Source for trail-break detection.
Break Trail On Flips
Creates a visual discontinuity on transition bars.
How this differs from a standard Supertrend
A conventional Supertrend generally uses:
A price midpoint such as HL2.
ATR as the full band-width model.
MAD Volatility Trail instead uses:
Rolling median as its center.
Median Absolute Deviation as its primary width.
ATR only as an optional minimum floor.
The trail mechanics are conceptually related, but the statistical foundation is different.
How this differs from Bollinger Bands
Bollinger Bands normally use:
A moving average.
Standard deviation.
Symmetrical raw bands.
MAD Volatility Trail uses:
Rolling median.
Median Absolute Deviation.
One-sided trailing bands.
Persistent trend-state logic.
Bollinger Bands are primarily a statistical envelope.
MAD Volatility Trail converts its robust statistical envelope into a trend-regime system.
How this differs from median ± MAD alone
A simple median-MAD indicator would plot:
Median.
Median + MAD width.
Median - MAD width.
Those bands would move freely.
This indicator adds:
Ratchet logic.
Persistent bullish/bearish state.
Opposite-trail break conditions.
Optional median-slope confirmation.
Signals and alerts.
The raw statistical model is therefore only the first stage.
MAD versus ATR
ATR measures the size of trading ranges.
MAD measures dispersion of the selected source around its median.
They can behave very differently.
For example:
A volatile but mean-reverting market can have large ATR with relatively controlled median dispersion.
A persistent directional displacement can produce increasing MAD even if individual candle ranges are moderate.
The optional floor allows both concepts to coexist without replacing the MAD foundation.
Robust statistics and financial markets
Financial return and price distributions frequently contain:
Outliers.
Large jumps.
Skew.
Fat tails.
Mean-and-standard-deviation models remain extremely useful, but robust alternatives can provide different information when unusual observations are present.
Median and MAD belong to a family of robust statistical tools designed to reduce sensitivity to extreme sample values.
This does not make the resulting indicator immune to market shocks.
If enough of the rolling window moves, the median and MAD will also move.
The advantage is primarily that one isolated observation has less influence.
Strengths
Uses an exact rolling median.
Uses exact Median Absolute Deviation rather than an approximation.
More resistant to isolated outliers than mean/standard-deviation envelopes.
Provides a configurable MAD scale.
Supports a pure MAD or MAD-plus-ATR hybrid width.
Converts robust statistics into persistent trend boundaries.
Uses one-sided trail logic to reduce rapid regime switching.
Provides optional median-direction confirmation.
Separates signal logic from visual strength.
Includes dynamic gradient, glow and post-flip visualization.
Exposes raw MAD, scaled MAD, active band width and Trend Strength in the Data Window.
Limitations
The indicator is reactive rather than predictive.
Robust statistics do not eliminate whipsaws.
A very short MAD Lookback can still react sharply.
A very long lookback can delay adaptation to new regimes.
Median calculations can remain unchanged across several bars and then move discretely as the rolling sample changes.
Higher Deviation Factors reduce reversals but increase confirmation lag.
The ATR floor changes the model from pure MAD dispersion to a hybrid MAD/ATR structure.
Median Slope Confirmation can reject false breaks but also delay genuine reversals.
Extreme readings in the visual-strength system are not probabilities of continuation.
Glow and bloom are cosmetic and should not be treated as separate signals.
Computational considerations
Unlike many moving averages, the exact rolling median and MAD calculations require the script to build and process the values inside the selected window.
For each bar:
The rolling source sample is collected.
Its median is calculated.
Absolute deviations from that median are calculated.
A second median is calculated from those deviations.
Larger MAD Lookbacks therefore require more work than a simple recursive EMA or ATR calculation.
This is the cost of calculating the robust statistics directly.
Causality and live-bar behaviour
The indicator uses current and historical values without intentional future-looking references.
On completed historical bars, the model is causal.
On a live unfinished bar:
The Source can change.
The current rolling median can change.
MAD can change.
Raw bands can change.
A trail break can appear or disappear.
Users who require confirmed regime changes should evaluate signals at bar close.
Data Window
The indicator exposes four useful diagnostic values.
Raw MAD
The unscaled median absolute deviation.
Scaled MAD
Raw MAD multiplied by the selected MAD Scale.
Active Band Width
The actual band width after:
MAD scaling.
Deviation Factor.
Optional ATR minimum floor.
Trend Strength
The visual-strength score expressed from approximately 0 to 100.
This is calculated from trail distance and median movement.
It is not part of the trend-flip logic.
Alerts
The indicator includes:
MAD Trail Bullish: established bearish regime changes to bullish.
MAD Trail Bearish: established bullish regime changes to bearish.
MAD Trail Flip: either regime transition occurs.
Summary
MAD Volatility Trail builds a trend-following regime from robust statistics.
The calculation begins with an exact rolling median of the selected Source.
Rather than measuring dispersion with standard deviation, the script calculates the Median Absolute Deviation:
MAD = Median(|X - Median(X)|)
The raw MAD is scaled and multiplied by a configurable Deviation Factor to create the statistical width around the rolling median.
The resulting raw upper and lower bands are:
Median + Band Width.
Median - Band Width.
An optional ATR minimum floor prevents these bands from becoming excessively narrow during low-dispersion conditions.
The raw envelope is then transformed into one-sided trailing boundaries.
The Lower Trail can ratchet upward while price remains above it, while the Upper Trail can ratchet downward while price remains below it.
These trails create hysteresis and form the actual regime-switching structure.
A bearish regime turns bullish only when the selected trigger breaks above the opposing Upper Trail, optionally while the rolling median itself is rising.
A bullish regime turns bearish only when the trigger breaks below the Lower Trail, optionally while the median is falling.
The active Lower Trail is displayed during bullish regimes and the active Upper Trail during bearish regimes.
A separate visual-strength model measures price-to-trail distance and median slope relative to the active band width. That score controls gradient and glow intensity but does not alter signals.
The result is a robust alternative to conventional mean-, standard-deviation- and ATR-centered trend trails.
Rather than allowing individual extreme prices to dominate its statistical center and dispersion estimate, MAD Volatility Trail uses the median twice: once to define the center of the distribution and again to define the typical absolute distance from that center.
This creates a trend framework designed around robust location, robust dispersion and persistent trailing structure .
지표

StormCore Engine: OTE, Alligator & Volume ProfileThe StormCore Engine is a modular, all-in-one technical analysis tool designed to consolidate three powerful trading methodologies into a single, highly optimized script. By combining Optimal Trade Entry (OTE) zones, a modernized Williams Alligator, and a dynamic Volume Profile with node detection, this engine helps traders identify liquidity zones, trend alignments, and key volume clusters without exhausting indicator limits on the chart.
This script is built with a modular architecture, meaning every core component can be toggled on or off via a "Master Toggle" in the settings, keeping your workspace clean and reducing CPU load when specific tools are not in use.
### Core Modules
1. Optimal Trade Entry (OTE)
This module automatically plots Fibonacci retracement levels (including the 62% and 79% "sweet spot" boxes) anchored either to the visible chart area, custom date ranges, or higher timeframe swings.
- Features fractal detection to identify potential market structure shifts.
- Customizable Fibonacci extensions for dynamic profit-taking targets.
2. Super Alligator
A modernized take on the classic Bill Williams Alligator indicator. It utilizes SMMA-based Jaw, Teeth, and Lips to gauge trend direction and momentum.
- Signal Generation: Prints explicit Buy/Sell markers only when the "mouth" is fully open and the gap between the close price and the Lips exceeds a user-defined percentage.
- Trend Filters: Includes optional SMA 200 and VWAP filters to ensure signals only fire in the direction of the macro trend or intraday fair value.
3. Volume Profile & Node Detection
Calculates the trading volume at specific price levels over a user-defined lookback period.
- Displays the Point of Control (POC) and Value Area High/Low (VAH/VAL).
- Node Detection Algorithm: Highlights high-volume Peaks and low-volume Troughs within the profile, which often act as significant support and resistance barriers.
### Practical Application (How to Use)
A high-probability setup occurs when multiple modules align:
- Wait for the price to retrace into the OTE 70% box.
- Check if this zone coincides with a Volume Profile Peak (indicating strong historical liquidity).
- Await a confirming signal from the Super Alligator (e.g., a Buy triangle firing above the VWAP filter) to execute the trade.
All modules are calculated independently but rendered cleanly to avoid chart clutter. Adjust the settings for your specific asset and timeframe.
Developed by Andy Storm | AI-StormCore. 지표

Macro HUDMacro HUD is an on-chart panel that shows the macro context around the instrument you are trading, so you can read price with the broader backdrop in view rather than in isolation.
Most indicators transform the price already on your chart into another form of the same price. Macro HUD does something different: it reads a set of other markets and presents their current state as context on a single panel, so you do not have to open several extra charts or an economic calendar to see the wider picture. It is a context dashboard, not a signal generator.
What it shows
The panel has four sections:
Macro engine — the US Dollar Index (DXY), the US 10-year and 2-year Treasury yields, crude oil, and the VIX. Each row shows its current value and a direction arrow measured over a lookback you set. The VIX row adds a volatility-regime band: Calm, Normal, Stressed, or Panic.
Regime — two plain-language reads derived from the rows above: a dollar read (bid or offered, from its recent direction) and a risk read (risk-on, risk-off, or mixed, from a chosen index's trend together with the VIX band).
Watchlist — up to five instruments of your choice, each labelled Bull or Bear depending on whether its price sits above or below a moving average, so you can see the directional state of a whole basket at a glance.
Event — an optional manual countdown to your next key economic releases. You enter the events yourself; the panel displays whichever is soonest and turns red inside a stand-down window you define.
How it works
Every value in the panel is requested from another symbol on a timeframe you choose (Daily by default) using request.security. The direction arrows compare the current value to the value a set number of bars earlier. The VIX band and the dollar and risk reads are simple threshold and trend rules applied to those requested values — the band uses fixed volatility thresholds, and the risk read combines an index's position relative to its moving average with the VIX band. The watchlist Bull/Bear flags compare each requested symbol's price to an EMA of its own price. The event countdown compares the current time to the timestamps you enter and shows the nearest upcoming one. Nothing in the panel is predictive; it reports the current state of external data.
Why it is original, and why these parts are combined
Macro HUD is not a single built-in republished, and it is not a mashup of overlapping signals. Each component answers a different question, and they are gathered together because a discretionary trader usually needs all of them at once before acting:
The macro engine answers "what is the broad backdrop?" — the dollar, rates, oil, and volatility.
The regime rows condense that backdrop into a plain read that can be absorbed at a glance.
The watchlist answers "what state is my basket in right now?" across several instruments without switching charts.
The event row answers "is it safe to act, or is a major release imminent?" — the one piece Pine cannot source on its own.
The purpose of the combination is to assemble, on one panel, the external context a trader would otherwise gather from several separate windows plus an economic calendar. No component duplicates another; each covers a distinct part of the question "should I be looking at this market now, and with what lean?" That specific, purpose-built combination is what the script contributes.
How to use it
Add it to any chart. Open the settings and point the macro and watchlist symbols at instruments your data plan supports, set the read timeframe (Daily gives the broad regime regardless of your chart timeframe), and choose the EMA length used for the Bull/Bear flags. If you follow economic events, type your next few releases into the event slots. The panel then updates live. Panel text colour is theme-aware by default and can be forced to black or white.
Limitations and things to be aware of
Pine cannot read the economic calendar or news, so the event slots are filled in by hand. If you do not maintain them, the event row simply shows that no event is set.
The direction arrows show short-term direction over your chosen lookback, not the absolute level. A market can show a down arrow while still being historically high, so read the arrow as recent drift, not position.
The regime reads are deliberately simple threshold and trend rules, not a proprietary model. They are a quick summary, not a forecast.
Some symbols (DXY, yields, VIX) depend on your TradingView data plan. If a row shows "n/a", open the settings and replace that symbol with one your plan provides. The script handles missing symbols without failing.
All values reflect the chosen read timeframe and update on that basis.
Scope
Macro HUD assembles context. It does not generate buy or sell signals, predict direction, or tell you what to do, and it makes no performance claims. The interpretation and every trading decision remain entirely yours.
This script is open-source. The full Pine code is available on this page for anyone to read, verify, and build upon.
지표

전략
