Smart Trader, Episode 04, by Ata Sabanci, Candles and Z ScoresSmart Trader, Episode 04
Candles and Z-Scores: A Statistical Approach to Market Analysis
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
OVERVIEW
This indicator applies Z-Score statistical analysis to measure how unusual current market conditions are compared to historical norms. It simultaneously analyzes five key metrics: Price, Total Volume, Buy Volume, Sell Volume, and Delta (Buy minus Sell) . The system detects 60 academically-researched market scenarios and provides visual feedback through Z-Lines (support/resistance levels), Event Markers, Trend Channels, and a comprehensive Dashboard.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CORE CONCEPT: WHY Z-SCORE?
A Z-Score measures how many standard deviations a value is from its mean. In financial markets, extreme Z-Scores indicate statistically rare events that often precede significant price movements.
Mathematical Formula:
Z = (Current Value - Mean) / Standard Deviation
Interpretation:
โข Z โฅ +2.0: Extremely high (occurs approximately 2.5% of the time)
โข Z โฅ +1.0: Above average
โข Z โ 0: Normal (near the mean)
โข Z โค -1.0: Below average
โข Z โค -2.0: Extremely low (occurs approximately 2.5% of the time)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ACADEMIC FOUNDATION
This indicator is inspired by / grounded in market microstructure literature (abbreviated citations in-script) from market microstructure literature:
โข Price-Volume Relationship - Karpoff (1987), Journal of Financial and Quantitative Analysis, Cambridge
Volume is positively correlated with price change magnitude
โข Order Flow Imbalance - Cont, Kukanov, Stoikov (2014), Journal of Financial Econometrics
Order imbalance drives price more reliably than raw volume
โข Informed Trading (PIN Model) - Easley, Kiefer, O'Hara, Paperman (1996), Journal of Finance
Buy/Sell imbalance reveals informed trader activity
โข Mixture of Distributions - Tauchen & Pitts (1983), Clark (1973)
Volume clusters with volatility regimes
โข Volume Predictability - Gervais, Kaniel, Mingelgrin (2001)
Volume shocks predict future returns
โข Liquidity & Order Imbalance - Chordia, Roll, Subrahmanyam (2002)
Order imbalance affects short-term returns
โข Volume-Return Dynamics - Llorente, Michaely, Saar, Wang (2002)
Speculation vs. risk-sharing patterns
โข Reversal vs. Continuation - Campbell, Grossman, Wang (MIT)
High volume predicts lower autocorrelation
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
VOLUME ENGINE
The indicator offers two methods for decomposing total volume into Buy and Sell components:
Method 1: Geometry (Approximation)
Uses candle structure to estimate buying and selling pressure:
Buy Volume = Total Volume ร (Close - Low) / (High - Low)
Sell Volume = Total Volume ร (High - Close) / (High - Low)
โข Works on all instruments without additional data requirements
โข Fast calculation
โข Less precise than intrabar method
Method 2: Intrabar (Precise)
Uses Lower Timeframe (LTF) tick/second data to aggregate actual up-ticks versus down-ticks:
โข More accurate volume decomposition
โข Requires LTF data availability
โข Configurable LTF: 1T (tick), 1S, 15S, 1M
Delta Calculation:
Delta = Buy Volume - Sell Volume
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Z-SCORE SYSTEM
The system calculates Z-Scores for five metrics simultaneously, using a configurable lookback period (default: 20 bars):
โข Zp (Price Z-Score): Measures price deviation from its mean
โข Zv (Volume Z-Score): Measures total volume deviation
โข Zbuy (Buy Volume Z-Score): Measures buying pressure deviation
โข Zsell (Sell Volume Z-Score): Measures selling pressure deviation
โข Zฮ (Delta Z-Score): Measures order flow imbalance deviation
Threshold Constants:
โข ZH (Z High) = 2.0: Extreme threshold
โข ZM (Z Medium) = 1.0: Moderate threshold
โข Z0 (Z Zero) = 0.5: Near-zero threshold
Group System:
The analysis window is divided into groups (default: 5 groups ร 20 bars = 100 bar total window). Group numbers (1, 2, 3...) are displayed above candles when enabled, helping identify the relative age of detected levels.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Z-LINES (SUPPORT/RESISTANCE LEVELS)
When any metric reaches an extreme Z-Score, the system marks that price level as a significant support or resistance zone.
Detection Logic:
โข Upper Z-Line: Drawn from the HIGH when Z โฅ upper threshold (default +2.0)
โข Lower Z-Line: Drawn from the LOW when Z โค lower threshold (default -2.0)
Multi-Metric Detection:
Z-Lines can be triggered by any of the five metrics (Price, Volume, Buy, Sell, Delta). When multiple metrics trigger at similar price levels, they are clustered together into a single combined label showing all contributing metrics.
Persistence:
Z-Lines persist for the entire analysis window (Period ร Groups bars) and are NOT removed when price touches them. This allows traders to see historical support/resistance levels that may still be relevant.
Anti-Overlap System:
Labels are automatically repositioned to prevent overlap. The "Label Min Gap (%)" setting controls minimum vertical separation between ALL labels (both upper and lower), ensuring readability even when multiple levels cluster together.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
EVENT DETECTION ENGINE (60 SCENARIOS)
The system analyzes 60 distinct market scenarios based on Z-Score combinations. Each scenario is derived from academic research and assigned a confidence score based on signal strength and alignment.
Notation:
โข Zp = Price Z-Score
โข Zv = Total Volume Z-Score
โข Zbuy = Buy Volume Z-Score
โข Zsell = Sell Volume Z-Score
โข Zฮ = Delta Z-Score
โข dirP = Price direction (+1 if Zp > 0.5, -1 if Zp < -0.5, else 0)
โข = Previous bar value
โข ZH = 2.0 (High threshold)
โข ZM = 1.0 (Medium threshold)
โข Z0 = 0.5 (Zero threshold)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY A: PRICE-VOLUME (Events 1-10)
Based on: Karpoff (1987), Tauchen-Pitts (1983), Clark (1973)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 1: Breakout Confirmed
|Zp| โฅ ZH AND Zv โฅ ZH AND sign(Zฮ) = dirP AND dirP โ 0
Direction: Bullish/Bearish (follows price direction)
Event 2: Trend Strength Confirmed
|Zp| โฅ ZH AND Zv โฅ ZH
Direction: Follows price direction
Event 3: Fragile Move
|Zp| โฅ ZH AND Zv โค -ZM
Direction: Warning (price move without volume support)
Event 4: Weak Rally
Zp โฅ ZH AND Zv โค -ZH
Direction: Warning (price up without volume)
Event 5: Weak Selloff
Zp โค -ZH AND Zv โค -ZH
Direction: Warning (price down without volume)
Event 6: Momentum Build
ZM โค |Zp| < ZH AND Zv โฅ ZH
Direction: Follows price direction
Event 7: Churn
|Zp| โค Z0 AND Zv โฅ ZH
Direction: Neutral (high volume, low price movement)
Event 8: Quiet Compression
|Zp| โค Z0 AND Zv โค -ZH
Direction: Neutral (low volume, low price movement)
Event 9: High Volume Regime
Zv โฅ ZH
Direction: Neutral
Event 10: Low Volume Regime
Zv โค -ZH
Direction: Neutral
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY B: ORDER-FLOW / DELTA (Events 11-16)
Based on: Cont, Kukanov, Stoikov (2014), Easley, Kiefer, O'Hara, Paperman (1996)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 11: Imbalance Drives Price
|Zฮ| โฅ ZH AND sign(Zฮ) = dirP AND dirP โ 0
Direction: Follows price direction (dirP), with delta alignment required
Event 12: Divergence Top
Zp โฅ ZH AND Zฮ โค -ZH
Direction: Warning (distribution at top)
Event 13: Divergence Bottom
Zp โค -ZH AND Zฮ โฅ ZH
Direction: Warning (accumulation at bottom)
Event 14: Absorption Positive
|Zp| โค Z0 AND Zv โฅ ZH AND Zฮ โฅ ZH
Direction: Bullish (buy absorption, support forming)
Event 15: Absorption Negative
|Zp| โค Z0 AND Zv โฅ ZH AND Zฮ โค -ZH
Direction: Bearish (sell absorption, resistance forming)
Event 16: Depth Wall
Zv โฅ ZH AND |Zฮ| โฅ ZH AND |Zp| โค Z0
Direction: Neutral (market depth absorbing)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY C: BUY VS SELL (Events 17-23)
Based on: Easley, Kiefer, O'Hara, Paperman (1996), Chordia, Roll, Subrahmanyam (2002)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 17: Aggressive Buy Dominance
Zbuy โฅ ZH AND Zฮ โฅ ZH AND Zsell โค -ZM
Direction: Bullish
Event 18: Aggressive Sell Dominance
Zsell โฅ ZH AND Zฮ โค -ZH AND Zbuy โค -ZM
Direction: Bearish
Event 19: Two-Sided Battle
Zbuy โฅ ZH AND Zsell โฅ ZH AND |Zฮ| โค Z0
Direction: Neutral (buyers and sellers equally strong)
Event 20: Battle with Buy Edge
Zbuy โฅ ZH AND Zsell โฅ ZH AND ZM โค Zฮ < ZH
Direction: Bullish
Event 21: Battle with Sell Edge
Zbuy โฅ ZH AND Zsell โฅ ZH AND -ZH < Zฮ โค -ZM
Direction: Bearish
Event 22: Hidden Accumulation
Zbuy โฅ ZH AND |Zp| โค Z0 AND Zv โฅ ZH
Direction: Bullish (buy shock without price movement)
Event 23: Hidden Distribution
Zsell โฅ ZH AND |Zp| โค Z0 AND Zv โฅ ZH
Direction: Bearish (sell shock without price movement)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY D: PREDICTABILITY (Events 24-26)
Based on: Gervais, Kaniel, Mingelgrin (2001), Karpoff (1987)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 24: Volume Shock Positive Drift
Zv โฅ ZH AND |Zp| โค ZM
Direction: Follows price direction
Event 25: Volume Shock Negative Drift
Zv โค -ZH AND |Zp| โค ZM
Direction: Opposite to price direction
Event 26: Abnormal Volume Info Arrival
Zv โฅ ZH
Direction: Neutral
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY E: REVERSAL VS CONTINUATION (Events 27-30)
Based on: Campbell, Grossman, Wang (MIT), Llorente, Michaely, Saar, Wang (2002)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 27: High Vol Reversal Risk
Zv โฅ ZH
Direction: Warning (high volume implies lower positive autocorrelation)
Event 28: Low Vol Continuation Risk
Zv โค -ZH
Direction: Follows price direction (trend likely continues)
Event 29: Speculation Continuation
Zv โฅ ZH AND |Zฮ| โฅ ZM AND sign(Zฮ) = dirP AND dirP โ 0
Direction: Follows price direction
Event 30: Risk Sharing Reversal
Zv โฅ ZH AND |Zฮ| โค Z0
Direction: Warning (potential reversal)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY F: IMBALANCE LAG (Events 31-33)
Based on: Chordia, Roll, Subrahmanyam (2002)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 31: Persistent Imbalance Push
|Zฮ| โฅ ZM AND |Zฮ | โฅ ZM AND sign(Zฮ) = sign(Zฮ )
Direction: Follows delta direction (persistent pressure)
Event 32: Imbalance Pressure Decay
(Zฮ โฅ ZM AND Zฮ โค -ZM) OR (Zฮ โค -ZM AND Zฮ โฅ ZM)
Direction: Warning (imbalance sign flip)
Event 33: Intraday Imbalance Predicts
|Zฮ| โฅ ZM
Direction: Follows delta direction
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY G: SUPPORT/RESISTANCE (Events 34-36)
Based on: Peskir (Manchester)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 34: SR Barrier Event
|Zp| โค Z0 AND Zv โฅ ZH
Direction: Neutral (price stalls with high volume)
Event 35: Volume Backed SR Level
|Zp| โค Z0 AND Zv โฅ ZH AND |Zฮ| โฅ ZM
Direction: Follows delta direction
Event 36: Volume Poor SR Level
|Zp| โค Z0 AND Zv โค -ZM
Direction: Warning (weak S/R without volume)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY H: EXTENDED ANALYSIS (Events 37-50)
Based on: Extended market microstructure analysis
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 37: Climax Buy
Zbuy โฅ ZH AND Zp โฅ ZH AND Zv โฅ ZH
Direction: Warning (extreme buying exhaustion, potential top)
Event 38: Climax Sell
Zsell โฅ ZH AND Zp โค -ZH AND Zv โฅ ZH
Direction: Warning (extreme selling exhaustion, potential bottom)
Event 39: Stealth Accumulation
Zbuy โฅ ZM AND |Zp| โค Z0 AND Zv โค Z0
Direction: Bullish (quiet buying)
Event 40: Stealth Distribution
Zsell โฅ ZM AND |Zp| โค Z0 AND Zv โค Z0
Direction: Bearish (quiet selling)
Event 41: Volume Divergence Bull
Zp โค -ZM AND Zv โค -ZM
Direction: Bullish (price down but volume declining)
Event 42: Volume Divergence Bear
Zp โฅ ZM AND Zv โค -ZM
Direction: Bearish (price up but volume declining)
Event 43: Delta Price Alignment
|Zp| โฅ ZM AND |Zฮ| โฅ ZM AND sign(Zp) = sign(Zฮ)
Direction: Follows price direction (strong trend confirmation)
Event 44: Extreme Compression
|Zp| โค Z0 AND Zv โค -ZH
Direction: Neutral (very low volatility)
Event 45: Volatility Expansion
|Zp| โฅ ZH AND Zv โฅ ZH
Direction: Follows price direction (breakout from compression)
Event 46: Buy Exhaustion
Zbuy โฅ ZH AND Zp โค Z0
Direction: Warning (high buy but price fails)
Event 47: Sell Exhaustion
Zsell โฅ ZH AND Zp โฅ -Z0
Direction: Warning (high sell but price holds)
Event 48: Trend Acceleration
|Zp| โฅ ZM AND |Zp| > |Zp | AND Zv โฅ ZM
Direction: Follows price direction (increasing momentum)
Event 49: Trend Deceleration
|Zp| โฅ ZM AND |Zp| < |Zp | AND sign(Zp) = sign(Zp )
Direction: Warning (decreasing momentum)
Event 50: Multi Divergence
(Zp โฅ ZM AND Zฮ โค -ZM) OR (Zp โค -ZM AND Zฮ โฅ ZM) + |Zp| โฅ ZM AND Zv โค -ZM
Direction: Warning (multiple divergence signals)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CATEGORY I: TREND-INTEGRATED (Events 51-60)
Based on: Combined price-volume-delta trend analysis
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Event 51: Trend Breakout Confirmed
|Zp| โฅ ZH AND Zv โฅ ZH AND |Zฮ| โฅ ZM AND sign(Zฮ) = dirP AND dirP โ 0
Direction: Follows price direction
Event 52: Trend Support Test
Zp โฅ ZM AND Z0 โค Zp < ZM AND Zฮ โฅ Z0
Direction: Bullish (pullback in uptrend)
Event 53: Trend Resistance Test
Zp โค -ZM AND -ZM < Zp โค -Z0 AND Zฮ โค -Z0
Direction: Bearish (rally in downtrend)
Event 54: Trend Reversal Signal
sign(Zp) โ sign(Zp ) AND |Zp| โฅ ZM AND |Zp | โฅ ZM
Direction: Follows new price direction (momentum flip)
Event 55: Channel Absorption
|Zp| โค Z0 AND Zv โฅ ZH
Direction: Neutral (range-bound with volume)
Event 56: Trend Continuation Volume
|Zp| โฅ ZM AND Zv โฅ ZM AND sign(Zฮ) = dirP AND dirP โ 0
Direction: Follows price direction (healthy trend with volume)
Event 57: Trend Exhaustion
|Zp| โฅ ZM AND Zv โค -ZM AND |Zp| < |Zp |
Direction: Warning (trend losing steam)
Event 58: Range Breakout Pending
|Zp| โค Z0 AND Zv โค -ZH AND |Zฮ| โฅ ZM
Direction: Follows delta direction (compression with imbalance)
Event 59: Trend Quality High
|Zp| โฅ ZM AND sign(Zฮ) = dirP AND Zv โฅ Z0 AND dirP โ 0
Direction: Follows price direction (strong aligned signals)
Event 60: Trend Quality Low
|Zp| โฅ ZM AND sign(Zฮ) โ dirP AND dirP โ 0
Direction: Warning (conflicting signals)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
TREND CHANNEL SYSTEM
The trend channel system is adapted from Smart Trader Episode 03 to provide consistent visual context for price action analysis.
How It Works:
โข Divides the chart into blocks based on Z-Score groups
โข Calculates OHLC (Open, High, Low, Close) for each block
โข Detects Higher Highs/Higher Lows (uptrend) or Lower Highs/Lower Lows (downtrend) patterns
โข Draws channel lines connecting block extremes
โข Classifies by angle: steep angles indicate trends, flat angles indicate ranges
Channel Classifications:
โข UPTREND: Higher highs and higher lows detected
โข DOWNTREND: Lower highs and lower lows detected
โข RANGE: Channel angle below threshold (default 10 degrees)
Label Information:
โข Trend direction (UPTREND/DOWNTREND/RANGE)
โข Channel boundary prices
โข Distance from current price (absolute and percentage)
โข Channel angle in degrees
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DASHBOARD
The dashboard provides a comprehensive real-time view of all Z-Score metrics and detected events.
Dashboard Sections:
1. Header Row
Displays indicator name and current calculation mode (CLOSED or LIVE).
2. Metric Rows (Price, Total Volume, Buy Volume, Sell Volume, Delta)
Each row displays:
โข Value: Current metric value
โข Z: Calculated Z-Score
โข Visual: Graphical Z-bar showing position relative to mean
โข Status: Interpretation (Extreme High, Above Avg, Normal, Below Avg, Extreme Low)
โข Upper: Oldest active upper Z-Line in window (Label Mirror)
โข Lower: Oldest active lower Z-Line in window (Label Mirror)
3. Event Detection Section
โข Count of triggered events out of 60 total scenarios
โข Market Bias: Bull/Bear/Neutral percentage with visual bar
โข Strongest Event: Highest confidence event currently triggered
โข #2 Event: Second highest confidence event
4. Footer
Shows engine type (Geometry/Intrabar), Z-Score period, calculation basis, and number of valid bars.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ALERT SYSTEM
The indicator uses native alertcondition() functions, keeping the settings menu clean while providing comprehensive alert options in TradingView's alert dialog.
Available Alert Categories:
โข Master Alerts: Any event, Any bullish, Any bearish, Any warning
โข Single Event Alerts: Individual alerts for key events (Breakout, Climax, Divergence, etc.)
โข Category Alerts: Alerts by event category (Price-Volume, Order-Flow, etc.)
โข Confluence Alerts: 2+, 3+, 4+, or 5+ aligned events
โข Bias Shift Alerts: 10%, 20%, or 30% shifts in market bias
โข High Confidence Alerts: Events with 60%+, 70%+, 80%+, or 90%+ confidence
โข Divergence Alerts: Price vs Volume or Price vs Delta divergences
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DATA ACCURACY AND LIMITATIONS
This indicator is 100% VOLUME-BASED and requires Lower Timeframe (LTF) intrabar data for accurate calculations when using the Intrabar method.
Data Accuracy Levels:
โข 1T (Tick): Most accurate, real volume distribution per tick
โข 1S (1 Second): Reasonably accurate approximation
โข 15S (15 Seconds): Good approximation, longer historical data available
โข 1M (1 Minute): Rough approximation, maximum historical data range
Backtest and Replay Limitations:
โข Replay mode results may differ from live trading due to data availability
โข For longer backtest periods, use higher LTF settings (15S or 1M)
โข Not all symbols/exchanges support tick-level data
โข Crypto and Forex typically have better LTF data availability than stocks
A Note on Data Access:
Higher TradingView plans provide access to more historical intrabar data, which directly impacts the accuracy of volume-based calculations. More precise volume data leads to more reliable calculations.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
LANGUAGE SUPPORT (TRI-LINGUAL UI)
This indicator includes a built-in language switch with three interface languages :
โข English (EN)
โข Tรผrkรงe (TR)
โข ํ๊ตญ์ด (KO)
The selected language updates key interface text such as the Dashboard headers/rows , tooltips , and the Event Engine outputs (event names, category names, and direction labels). Turkish diacritics and Korean Hangul are supported for clean, native readability.
Why only three languages?
Each additional language requires duplicating strings throughout the code, which increases script size/memory usage and compilation time. To keep the indicator optimized and responsive, language options are intentionally limited to three.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๏ธ DISCLAIMER
FOR EDUCATIONAL AND RESEARCH PURPOSES ONLY
This indicator is designed as an educational and research tool based on academic market microstructure literature. It is NOT financial advice and should NOT be used as the sole basis for trading decisions.
Important Notices:
โข Past performance does not guarantee future results
โข All trading involves risk of substantial loss
โข The indicator's signals are statistical probabilities, not certainties
โข Always conduct your own research and consult qualified financial advisors
โข The creator assumes no responsibility for trading losses
Research Sources:
This indicator is built upon peer-reviewed academic research from:
โข Journal of Financial and Quantitative Analysis (Cambridge University Press)
โข Journal of Finance
โข Journal of Financial Econometrics
โข MIT Working Papers
โข arXiv Financial Mathematics
Goldprediction
Adaptive Trend Flow (ATF)Adaptive Trend Flow (ATF) is a custom trend-following indicator designed to work reliably across all markets and all timeframes.
It uses an adaptive moving average that automatically adjusts to market conditions, combined with trend slope analysis and a volatility filter to reduce noise during ranging periods.
Unlike traditional fixed moving averages, ATF reacts faster during strong trends and slows down during consolidation, helping traders stay aligned with meaningful price movements.
๐ How It Works
Uses an adaptive smoothing algorithm to track price efficiently
Confirms trend direction using trend slope
Filters out low-volatility and choppy conditions using ATR-based logic
Does not repaint โ signals are based only on confirmed data
๐ Visual Interpretation
๐ข Green line / background โ Bullish trend
๐ด Red line / background โ Bearish trend
โช Gray โ No clear trend (range / low volatility)
โ๏ธ Features
Works on Crypto, Forex, Stocks, Futures
Compatible with all timeframes
Optional trend-change signals
Optional background highlighting
Fully customizable inputs
Alert-ready
๐ฏ Best Use Cases
Trend filter for entries and exits
Directional bias for scalping, day trading, or swing trading
Strategy backbone when combined with price action or momentum tools
โ ๏ธ Disclaimer
This indicator is for educational and analytical purposes only and does not constitute financial advice. Always manage risk appropriately.
Anchored VWAP PercentageINDICATOR: ANCHORED VWAP PERCENTAGE (AVWAP)
1. Overview
The Anchored VWAP Percentage (AVWAP) is a quantitative momentum and mean-reversion tool. It measures the percentage distance between the current price and a Volume Weighted Average Price (VWAP) that resets automatically based on specific time cycles. It allows traders to identify overextended market conditions relative to institutional value.
---
2. Core Logic & Calculation
The script tracks the relationship between price and volume starting from a specific Anchor Point .
* Volume-Weighted Foundation: Unlike simple moving averages, this indicator uses the VWAP formula: sum(Volume * Price) / sum(Volume) .
* Automatic Anchoring: The starting point (Anchor) resets automatically depending on the chart timeframe (e.g., resets weekly on a 15m chart, or yearly on a Daily chart).
* Percentage Deviation: It calculates the precise gap between the price and the VWAP, plotted as an oscillator: ((Price - VWAP) / VWAP) * 100 .
---
3. Adaptive Intelligence (Multi-Asset & Multi-TF)
The AVWAP is built with an internal database of 85th Percentile (P85) volatility thresholds. It recognizes that different assets have different "stretching" limits:
1. Asset-Specific Calibration: It includes optimized data for Bitcoin, Ethereum, Altcoins, Forex, and Indices .
2. Dynamic Timeframe Mapping: The anchor period and the exhaustion thresholds adjust automatically. For example:
* Intraday (1m-5m): Anchors to an 8-hour (480 min) cycle.
* Mid-Term (15m-60m): Anchors to a Weekly (W) cycle.
* Swing (Daily): Anchors to a Yearly (12M) cycle.
---
4. Visual Anatomy
The indicator is designed for high-speed decision-making:
* The Histogram:
* Green: Price is trading above the VWAP (Bullish premium).
* Red: Price is trading below the VWAP (Bearish discount).
* P85 Threshold Lines:
* These lines represent the 85th percentile of historical deviations . Historically, the price stays within these boundaries 85% of the time.
* Background Highlighting: When the histogram crosses the P85 line, the background glows, signaling a Statistical Exhaustion Zone where a retracement to the mean is highly probable.
---
5. How to Trade with AVWAP
* Mean Reversion: When the histogram reaches the P85 Zone , the price is "statistically overextended." This is a prime area to look for reversals or to take profits on existing trends.
* Trend Strength: If the histogram stays near the Zero Line while the price moves, the trend is supported by healthy volume.
* Value Area: The Zero Line represents the Fair Value . Buying near the Zero Line during a bullish histogram (Green) offers a high-probability entry with low risk.
---
6. Technical Parameters
* Asset Selection: A dropdown to switch between Crypto, Forex, and Indices.
* Color Customization: User-defined colors for bullish and bearish sentiment.
* Precision Control: 4-decimal precision for accurate tracking of thin-margin assets like Forex.
ICT Liquidity + BOS + FVG + Entries (NY)ICT Liquidity + BOS + FVG + Entries (NY Session)
This indicator is designed for ICT / Smart Money Concepts traders, focusing on high-probability New York session setups, especially for Gold (XAUUSD) on lower timeframes like M5.
It automates the classic ICT execution model:
Liquidity โ Break of Structure โ Fair Value Gap โ Entry
Smart Money Volume Matrix [Ata]Smart Money Volume Matrix
The Smart Money Volume Matrix (SMV Matrix) is an advanced volume-spread analysis (VSA) dashboard and charting tool designed to identify significant market anomalies by analyzing the relationship between price extremes and volume flow.
Unlike traditional indicators that rely solely on moving averages or oscillators, this tool performs a "Snapshot Analysis" of a defined lookback period (default: 100 bars) to rank price action based on Order Flow Dominance. It isolates the Top 10 Highest and Lowest Close prices and scrutinizes the volume behind them to categorize market sentiment into four distinct phases: Distribution, No Demand, Absorption, and Exhaustion.
Core Logic & Methodology
The script operates on a Zero-Lag Snapshot Engine. It does not print historical signals bar-by-bar; instead, it evaluates the current market structure relative to the recent history (Lookback Period).
1. Ranking Engine: The script scans the lookback period to find the Top 10 Highest Closes and Top 10 Lowest Closes.
2. Volume Classification: For each ranked bar, it calculates the "Intrabar Buy/Sell Volume" (or approximates it using candle geometry if Intrabar data is unavailable).
3. Dominance Detection: It compares Buying Volume vs. Selling Volume to determine who is in control at critical price levels.
Signal Classifications (VSA Logic)
The indicator generates labels on the chart and updates the dashboard table based on the following logic:
1. At Price Tops (Resistance Areas):
- Distribution (Supply): High Price + High Total Volume + Sellers Dominant.
Interpretation: Indicates heavy institutional selling into rising prices. Often precedes a reversal.
- Buy Climax: High Price + High Total Volume + Buyers Dominant.
Interpretation: Extreme buying frenzy. While bullish, it often marks a "trap" or temporary top due to exhaustion.
- No Demand: High Price + Low Volume.
Interpretation: Prices drifted higher but lack institutional participation. A sign of weakness.
2. At Price Bottoms (Support Areas):
- Absorption: Low Price + High Total Volume + Buyers Dominant.
Interpretation: Institutional money is absorbing selling pressure (passive buying). A strong sign of accumulation.
- Panic Sell: Low Price + High Total Volume + Sellers Dominant.
Interpretation: Extreme fear. High volume at lows typically indicates capitulation and potential hands-changing.
- Exhaustion: Low Price + Low Volume.
Interpretation: Selling pressure has dried up. The market may float upward due to lack of sellers.
Key Features
- Dashboard Matrix Table:
Displays the exact Close Price, Buy/Sell Volume, and Market State (Group) for the Top 10 ranking bars.
Smart Footer: Automatically detects the active "Resistance Zone" (derived from G1 Distribution levels) and "Support Zone" (derived from G3 Absorption levels) and reports the current price status relative to these zones (e.g., "Testing Resistance", "Breakout", "At Support").
- Smart Zones (Auto S/R):
Automatically draws Support and Resistance boxes extending into the future based on the most significant volume clusters found in the rankings. Includes logic to detect "Flips" (e.g., when Support breaks, it is labeled as a flip to Resistance).
- Average Trend Channels:
Calculates a Linear Regression trend line based specifically on the coordinates of the Top 10 Highs and Top 10 Lows, providing a "Best Fit" channel for the current market structure.
- Visual Clarity:
Labels utilize a "Smart Stacking" algorithm to prevent overlap on the chart. Guide lines connect labels to their respective candles for precise identification.
Settings & Configuration
- Matrix Settings: Lookback Period (default 100 bars) and Top Rank Count.
- Volume Engine: Choose between "Intrabar (Precise)" for accurate order flow or "Geometry (Approx)" for standard volume estimation.
- Visuals: Toggle Table, Labels, Lines, Zones, and Trend Lines. Adjust transparency and font sizes.
IMPORTANT NOTE ON SNAPSHOT LOGIC
This indicator is designed as a Real-Time Dashboard. It continuously updates the "Top 10" list as new candles form. Therefore, a label that appears on a candle may disappear if that candle falls out of the Top 10 ranking or leaves the lookback window. This is intended behavior to ensure the chart always reflects the current most critical levels, rather than a historical record of past signals. It is best used for live market analysis rather than historical back testing.
Disclaimer: This tool is for educational and analytical purposes only. Volume analysis is subjective and should be used in conjunction with other methods of technical analysis.
Liquidity Swap Detector Ultimate - Cedric JeanjeanAdvanced Smart Money Concepts indicator designed to detect high-probability liquidity sweeps and institutional order flow reversals. This professional-grade tool combines multiple ICT (Inner Circle Trader) strategies to identify optimal entry points.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ KEY FEATURES:
โ
Smart Swing Detection
- Identifies confirmed swing highs and lows using adaptive lookback periods
- Eliminates false signals through double-confirmation logic
- Detects liquidity grabs at key market structure points
โ
Fair Value Gap (FVG) Analysis
- Multi-timeframe FVG detection for enhanced accuracy
- Filters imbalances by minimum size threshold
- Combines current timeframe and higher timeframe FVGs
โ
Advanced Volatility Filter
- ATR-based volatility analysis to avoid low-quality setups
- Adjustable volatility threshold (default 0.35%)
- Ensures entries during optimal market conditions
โ
Precision Signal Generation
- LONG signals: Confirmed swing lows + FVG + volatility confirmation
- SHORT signals: Confirmed swing highs + FVG + volatility confirmation
- Clear visual markers with price labels
โ
Comprehensive Alert System
- Three alert types: Simple, Detailed, JSON (for webhooks)
- Separate LONG/SHORT alert controls
- Compatible with MT5 integration via webhooks
- TradingView native alertcondition support
โ
Professional Dashboard
- Real-time ATR monitoring
- Volatility percentage display
- FVG status indicator
- Alert status tracker
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ๏ธ CUSTOMIZABLE PARAMETERS:
๐น Lookback Swing (1-50): Defines swing detection sensitivity
๐น ATR Multiplier: Controls wick filter strength
๐น Volatility Filter: Minimum required market volatility (%)
๐น FVG Filter: Minimum fair value gap size (%)
๐น FVG Timeframe: Higher timeframe for multi-TF analysis
๐น Visual Options: Toggle swing marks, FVG zones, labels
๐น Alert Controls: Enable/disable LONG/SHORT notifications
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ HOW IT WORKS:
1. The indicator scans for confirmed swing points using a robust double-confirmation algorithm
2. Simultaneously analyzes Fair Value Gaps on both current and higher timeframes
3. Validates market volatility to ensure sufficient price movement
4. Generates precise entry signals when all conditions align
5. Triggers customizable alerts for instant notification
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ BEST PRACTICES:
- Use on liquid markets (Forex majors, indices, crypto)
- Recommended timeframes: 15m, 1H, 4H
- Combine with support/resistance for confirmation
- Adjust lookback period based on market volatility
- Test alert settings before live trading
- Use JSON alerts for automated trading integration
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โก ALERT CONFIGURATION:
1. Click the Alert icon (bell) in TradingView
2. Select "Liquidity Swap Detector Ultimate - TITAN v6"
3. Choose your preferred alert condition:
- LONG Signal: Only bullish setups
- SHORT Signal: Only bearish setups
- ANY Signal: All trading opportunities
4. Set expiration and notification preferences
5. For MT5 integration: Select "JSON" message type and configure webhook URL
Aurum DCX AVE Gold and Silver StrategySummary in one paragraph
Aurum DCX AVE is a volatility break strategy for gold and silver on intraday and swing timeframes. It aligns a new Directional Convexity Index with an Adaptive Volatility Envelope and an optional USD/DXY bias so trades appear only when direction quality and expansion agree. It is original because it fuses three pieces rarely combined in one model for metals: a convexity aware trend strength score, a percentile based envelope that widens with regime heat, and an intermarket DXY filter.
Scope and intent
โข Markets. Gold and silver futures or spot, other liquid commodities, major indices
โข Timeframes. Five minutes to one day. Defaults to 30min for swing pace
โข Default demo used in this publication. TVC:GOLD on 30m
โข Purpose. Enter confirmed volatility breaks while muting chop using regime heat and USD bias
โข Limits. This is a strategy. Orders are simulated on standard candles only
Originality and usefulness
โข Unique fusion. DCX combines DI strength with path efficiency and curvature. AVE blends ATR with a high TR percentile and widens with DCX heat. DXY adds an intermarket bias
โข Failure mode addressed. False starts inside compression and unconfirmed breakouts during USD swings
โข Testability. Each component has a named input. Entry names L and S are visible in the list of trades
โข Portable yardstick. Weekly ATR for stops and R multiples for targets
โข Open source. Method and implementation are disclosed for community review
Method overview in plain language
You score direction quality with DCX, size an adaptive envelope with a blend of ATR and a high TR percentile, and only allow breaks that clear the band while DCX is above a heat threshold in the same direction. An optional DXY filter favors long when USD weakens and short when USD strengthens. Orders are bracketed with a Weekly ATR stop and an R multiple target, with optional trailing to the envelope.
Base measures
โข Range basis. True Range and ATR over user windows. A high TR percentile captures expansion tails used by AVE
โข Return basis. Not required
Components
โข Directional Convexity Index DCX. Measures directional strength with DX, multiplies by path efficiency, blends a curvature term from acceleration, scales to 0 to 100, and uses a rise window
โข Adaptive Volatility Envelope AVE. Midline ALMA or HMA or EMA plus bands sized by a blend of ATR and a high TR percentile. The blend weight follows volatility of volatility. Band width widens with DCX heat
โข DXY Bias optional. Daily EMA trend of DXY. Long bias when USD weakens. Short bias when USD strengthens
โข Risk block. Initial stop equals Weekly ATR times a multiplier. Target equals an R multiple of the initial risk. Optional trailing to AVE band
Fusion rule
โข All gates must pass. DCX above threshold and rising. Directional lead agrees. Price breaks the AVE band in the same direction. DXY bias agrees when enabled
Signal rule
โข Long. Close above AVE upper and DCX above threshold and DCX rising and plus DI leads and DXY bias is bearish
โข Short. Close below AVE lower and DCX above threshold and DCX falling and minus DI leads and DXY bias is bullish
โข Exit and flip. Bracket exit at stop or target. Optional trailing to AVE band
Inputs with guidance
Setup
โข Symbol. Default TVC:GOLD (Correlation Asset for internal logic)
โข Signal timeframe. Blank follows the chart
โข Confirm timeframe. Default 1 day used by the bias block
Directional Convexity Index
โข DCX window. Typical 10 to 21. Higher filters more. Lower reacts earlier
โข DCX rise bars. Typical 3 to 6. Higher demands continuation
โข DCX entry threshold. Typical 15 to 35. Higher avoids soft moves
โข Efficiency floor. Typical 0.02 to 0.06. Stability in quiet tape
โข Convexity weight 0..1. Typical 0.25 to 0.50. Higher gives curvature more influence
Adaptive Volatility Envelope
โข AVE window. Typical 24 to 48. Higher smooths more
โข Midline type. ALMA or HMA or EMA per preference
โข TR percentile 0..100. Typical 75 to 90. Higher favors only strong expansions
โข Vol of vol reference. Typical 0.05 to 0.30. Controls how much the percentile term weighs against ATR
โข Base envelope mult. Typical 1.4 to 2.2. Width of bands
โข Regime adapt 0..1. Typical 0.6 to 0.95. How much DCX heat widens or narrows the bands
Intermarket Bias
โข Use DXY bias. Default ON
โข DXY timeframe. Default 1 day
โข DXY trend window. Typical 10 to 50
Risk
โข Risk percent per trade. Reporting field. Keep live risk near one to two percent
โข Weekly ATR. Default 14. Basis for stops
โข Stop ATR weekly mult. Typical 1.5 to 3.0
โข Take profit R multiple. Typical 1.5 to 3.0
โข Trail with AVE band. Optional. OFF by default
Properties visible in this publication
โข Initial capital. 20000
โข Base currency. USD
โข request.security lookahead off everywhere
โข Commission. 0.03 percent
โข Slippage. 5 ticks
โข Default order size method percent of equity with value 3% of the total capital available
โข Pyramiding 0
โข Process orders on close ON
โข Bar magnifier ON
โข Recalculate after order is filled OFF
โข Calc on every tick OFF
Realism and responsible publication
โข No performance claims. Past results never guarantee future outcomes
โข Shapes can move while a bar forms and settle on close
โข Strategies use standard candles for signals and orders only
Honest limitations and failure modes
โข Economic releases and thin liquidity can break assumptions behind the expansion logic
โข Gap heavy symbols may prefer a longer ATR window
โข Very quiet regimes can reduce signal contrast. Consider higher DCX thresholds or wider bands
โข Session time follows the exchange of the chart and can change symbol to symbol
โข Symbol sensitivity is expected. Use the gates and length inputs to find stable settings
Open source reuse and credits
โข None
Mode
Public open source. Source is visible and free to reuse within TradingView House Rules
Legal
Education and research only. Not investment advice. You are responsible for your decisions. Test on historical data and in simulation before any live use. Use realistic costs.
SuperTrade ST1 StrategyOverview
The SuperTrade ST1 Strategy is a long-only trend-following strategy that combines a Supertrend indicator with a 200-period EMA filter to isolate high-probability bullish trade setups. It is designed to operate in trending markets, using volatility-based exits with a strict 1:4 Risk-to-Reward (R:R) ratio, meaning that each trade targets a profit 4ร the size of its predefined risk.
This strategy is ideal for traders looking to align with medium- to long-term trends, while maintaining disciplined risk control and minimal trade frequency.
How It Works
This strategy leverages three key components:
Supertrend Indicator
A trend-following indicator based on Average True Range (ATR).
Identifies bullish/bearish trend direction by plotting a trailing stop line that moves with price volatility.
200-period Exponential Moving Average (EMA) Filter
Trades are only taken when the price is above the EMA, ensuring participation only during confirmed uptrends.
Helps filter out counter-trend entries during market pullbacks or ranges.
ATR-Based Stop Loss and Take Profit
Each trade uses the ATR to calculate volatility-adjusted exit levels.
Stop Loss: 1ร ATR below entry.
Take Profit: 4ร ATR above entry (1:4 R:R).
This asymmetry ensures that even with a lower win rate, the strategy can remain profitable.
Entry Conditions
A long trade is triggered when:
Supertrend flips from bearish to bullish (trend reversal).
Price closes above the Supertrend line.
Price is above the 200 EMA (bullish market bias).
Exit Logic
Once a long position is entered:
Stop loss is set 1 ATR below entry.
Take profit is set 4 ATR above entry.
The strategy automatically exits the position on either target.
Backtest Settings
This strategy is configured for realistic backtesting, including:
$10,000 account size
2% equity risk per trade
0.1% commission
1 tick slippage
These settings aim to simulate real-world conditions and avoid overly optimistic results.
How to Use
Apply the script to any timeframe, though higher timeframes (1H, 4H, Daily) often yield more reliable signals.
Works best in clearly trending markets (especially in crypto, stocks, indices).
Can be paired with alerts for live trading or analysis.
Important Notes
This version is long-only by design. No short positions are executed.
Ideal for swing traders or position traders seeking asymmetric returns.
Users can modify the ATR period, Supertrend factor, or EMA filter length based on asset behavior.







