Turtle Soup ICT Strategy [TradingFinder] FVG + CHoCH/CSD๐ต Introduction
The ICT Turtle Soup trading setup, designed in the ICT style, operates by hunting or sweeping liquidity zones to exploit false breakouts and failed breakouts in key liquidity Zones, such as recent highs, lows, or major support and resistance levels.
This setup identifies moments when the price breaches these liquidity zones, triggering stop orders placed (Stop Hunt) by other traders, and then quickly reverses direction. These movements are often associated with liquidity sweeps that create temporary market imbalances.
The reversal is typically confirmed by one of three structural shifts : a Market Structure Shift (MSS), a Change of Character (CHoCH), or a break of the Change in State of Delivery (CISD). Each of these structural shifts provides a reliable signal to interpret market intent and align trading decisions with the expected price movement. After the structural shift, the price frequently pullback to a Fair Value Gap (FVG), offering a precise entry point for trades.
By integrating key concepts such as liquidity, liquidity sweeps, stop order activation, structural shifts (MSS, CHoCH, CISD), and price imbalances, the ICT Turtle Soup setup enables traders to identify reversal points and key entry zones with high accuracy.
This strategy is highly versatile, making it applicable across markets such as forex, stocks, cryptocurrencies, and futures. It offers traders a robust and systematic approach to understanding price movements and optimizing their trading strategies
๐ฃ Bullish and Bearish Setups
Bullish Setup : The price first sweeps below a Sell-Side Liquidity (SSL) zone, then reverses upward after forming an MSS or CHoCH, and finally pulls back to an FVG, creating a buying opportunity.
Bearish Setup : The price first sweeps above a Buy-Side Liquidity (BSL) zone, then reverses downward after forming an MSS or CHoCH, and finally pulls back to an FVG, creating a selling opportunity.
๐ต How to Use
To effectively utilize the ICT Turtle Soup trading setup, begin by identifying key liquidity zones, such as recent highs, lows, or support and resistance levels, in higher timeframes.
Then, monitor lower timeframes for a Liquidity Sweep and confirmation of a Market Structure Shift (MSS) or Change of Character (CHoCH).
After the structural shift, the price typically pulls back to an FVG, offering an optimal trade entry point. Below, the bullish and bearish setups are explained in detail.
๐ฃ Bullish Turtle Soup Setup
Identify Sell-Side Liquidity (SSL) : In a higher timeframe (e.g., 1-hour or 4-hour), identify recent price lows or support levels that serve as SSL zones, typically the location of stop-loss orders for traders.
Observe a Liquidity Sweep : On a lower timeframe (e.g., 15-minute or 30-minute), the price must move below one of these liquidity zones and then reverse. This movement indicates a liquidity sweep.
Confirm Market Structure Shift : After the price reversal, look for a structural shift (MSS or CHoCH) indicated by the formation of a Higher Low (HL) and Higher High (HH).
Enter the Trade : Once the structural shift is confirmed, the price typically pulls back to an FVG. Enter a buy trade in this zone, set a stop-loss slightly below the recent low, and target Buy-Side Liquidity (BSL) in the higher timeframe for profit.
๐ฃ Bearish Turtle Soup Setup
Identify Buy-Side Liquidity (BSL) : In a higher timeframe, identify recent price highs or resistance levels that serve as BSL zones, typically the location of stop-loss orders for traders.
Observe a Liquidity Sweep : On a lower timeframe, the price must move above one of these liquidity zones and then reverse. This movement indicates a liquidity sweep.
Confirm Market Structure Shift : After the price reversal, look for a structural shift (MSS or CHoCH) indicated by the formation of a Lower High (LH) and Lower Low (LL).
Enter the Trade : Once the structural shift is confirmed, the price typically pulls back to an FVG. Enter a sell trade in this zone, set a stop-loss slightly above the recent high, and target Sell-Side Liquidity (SSL) in the higher timeframe for profit.
๐ต Settings
Higher TimeFrame Levels : This setting allows you to specify the higher timeframe (e.g., 1-hour, 4-hour, or daily) for identifying key liquidity zones.
Swing period : You can set the swing detection period.
Max Swing Back Method : It is in two modes "All" and "Custom". If it is in "All" mode, it will check all swings, and if it is in "Custom" mode, it will check the swings to the extent you determine.
Max Swing Back : You can set the number of swings that will go back for checking.
FVG Length : Default is 120 Bar.
MSS Length : Default is 80 Bar.
FVG Filter : This refines the number of identified FVG areas based on a specified algorithm to focus on higher quality signals and reduce noise.
Types of FVG filter s:
Very Aggressive Filter: Adds a condition where, for an upward FVG, the last candle's highest price must exceed the middle candle's highest price, and for a downward FVG, the last candle's lowest price must be lower than the middle candle's lowest price. This minimally filters out FVGs.
Aggressive Filter: Builds on the Very Aggressive mode by ensuring the middle candle is not too small, filtering out more FVGs.
Defensive Filter: Adds criteria regarding the size and structure of the middle candle, requiring it to have a substantial body and specific polarity conditions, filtering out a significant number of FVGs.
Very Defensive Filter: Further refines filtering by ensuring the first and third candles are not small-bodied doji candles, retaining only the highest quality signals.
In the indicator settings, you can customize the visibility of various elements, including MSS, FVG, and HTF Levels. Additionally, the color of each element can be adjusted to match your preferences. This feature allows traders to tailor the chart display to their specific needs, enhancing focus on the key data relevant to their strategy.
๐ต Conclusion
The ICT Turtle Soup trading setup is a powerful tool in the ICT style, enabling traders to exploit false breakouts in key liquidity zones. By combining concepts of liquidity, liquidity sweeps, market structure shifts (MSS and CHoCH), and pullbacks to FVG, this setup helps traders identify precise reversal points and execute trades with reduced risk and increased accuracy.
With applications across various markets, including forex, stocks, crypto, and futures, and its customizable indicator settings, the ICT Turtle Soup setup is ideal for both beginner and advanced traders. By accurately identifying liquidity zones in higher timeframes and confirming structure shifts in lower timeframes, this setup provides a reliable strategy for navigating volatile market conditions.
Ultimately, success with this setup requires consistent practice, precise market analysis, and proper risk management, empowering traders to make smarter decisions and achieve their trading goals.
Cari dalam skrip untuk "sweep"
Adaptive Market Wave TheoryAdaptive Market Wave Theory
๐ CORE INNOVATION: PROBABILISTIC PHASE DETECTION WITH MULTI-AGENT CONSENSUS
Adaptive Market Wave Theory (AMWT) represents a fundamental paradigm shift in how traders approach market phase identification. Rather than counting waves subjectively or drawing static breakout levels, AMWT treats the market as a hidden state machine โusing Hidden Markov Models, multi-agent consensus systems, and reinforcement learning algorithms to quantify what traditional methods leave to interpretation.
The Wave Analysis Problem:
Traditional wave counting methodologies (Elliott Wave, harmonic patterns, ABC corrections) share fatal weaknesses that AMWT directly addresses:
1. Non-Falsifiability : Invalid wave counts can always be "recounted" or "adjusted." If your Wave 3 fails, it becomes "Wave 3 of a larger degree" or "actually Wave C." There's no objective failure condition.
2. Observer Bias : Two expert wave analysts examining the same chart routinely reach different conclusions. This isn't a featureโit's a fundamental methodology flaw.
3. No Confidence Measure : Traditional analysis says "This IS Wave 3." But with what probability? 51%? 95%? The binary nature prevents proper position sizing and risk management.
4. Static Rules : Fixed Fibonacci ratios and wave guidelines cannot adapt to changing market regimes. What worked in 2019 may fail in 2024.
5. No Accountability : Wave methodologies rarely track their own performance. There's no feedback loop to improve.
The AMWT Solution:
AMWT addresses each limitation through rigorous mathematical frameworks borrowed from speech recognition, machine learning, and reinforcement learning:
โข Non-Falsifiability โ Hard Invalidation : Wave hypotheses die permanently when price violates calculated invalidation levels. No recounting allowed.
โข Observer Bias โ Multi-Agent Consensus : Three independent analytical agents must agree. Single-methodology bias is eliminated.
โข No Confidence โ Probabilistic States : Every market state has a calculated probability from Hidden Markov Model inference. "72% probability of impulse state" replaces "This is Wave 3."
โข Static Rules โ Adaptive Learning : Thompson Sampling multi-armed bandits learn which agents perform best in current conditions. The system adapts in real-time.
โข No Accountability โ Performance Tracking : Comprehensive statistics track every signal's outcome. The system knows its own performance.
The Core Insight:
"Traditional wave analysis asks 'What count is this?' AMWT asks 'What is the probability we are in an impulsive state, with what confidence, confirmed by how many independent methodologies, and anchored to what liquidity event?'"
๐ฌ THEORETICAL FOUNDATION: HIDDEN MARKOV MODELS
Why Hidden Markov Models?
Markets exist in hidden states that we cannot directly observeโonly their effects on price are visible. When the market is in an "impulse up" state, we see rising prices, expanding volume, and trending indicators. But we don't observe the state itselfโwe infer it from observables.
This is precisely the problem Hidden Markov Models (HMMs) solve. Originally developed for speech recognition (inferring words from sound waves), HMMs excel at estimating hidden states from noisy observations.
HMM Components:
1. Hidden States (S) : The unobservable market conditions
2. Observations (O) : What we can measure (price, volume, indicators)
3. Transition Matrix (A) : Probability of moving between states
4. Emission Matrix (B) : Probability of observations given each state
5. Initial Distribution (ฯ) : Starting state probabilities
AMWT's Six Market States:
State 0: IMPULSE_UP
โข Definition: Strong bullish momentum with high participation
โข Observable Signatures: Rising prices, expanding volume, RSI >60, price above upper Bollinger Band, MACD histogram positive and rising
โข Typical Duration: 5-20 bars depending on timeframe
โข What It Means: Institutional buying pressure, trend acceleration phase
State 1: IMPULSE_DN
โข Definition: Strong bearish momentum with high participation
โข Observable Signatures: Falling prices, expanding volume, RSI <40, price below lower Bollinger Band, MACD histogram negative and falling
โข Typical Duration: 5-20 bars (often shorter than bullish impulsesโmarkets fall faster)
โข What It Means: Institutional selling pressure, panic or distribution acceleration
State 2: CORRECTION
โข Definition: Counter-trend consolidation with declining momentum
โข Observable Signatures: Sideways or mild counter-trend movement, contracting volume, RSI returning toward 50, Bollinger Bands narrowing
โข Typical Duration: 8-30 bars
โข What It Means: Profit-taking, digestion of prior move, potential accumulation for next leg
State 3: ACCUMULATION
โข Definition: Base-building near lows where informed participants absorb supply
โข Observable Signatures: Price near recent lows but not making new lows, volume spikes on up bars, RSI showing positive divergence, tight range
โข Typical Duration: 15-50 bars
โข What It Means: Smart money buying from weak hands, preparing for markup phase
State 4: DISTRIBUTION
โข Definition: Top-forming near highs where informed participants distribute holdings
โข Observable Signatures: Price near recent highs but struggling to advance, volume spikes on down bars, RSI showing negative divergence, widening range
โข Typical Duration: 15-50 bars
โข What It Means: Smart money selling to late buyers, preparing for markdown phase
State 5: TRANSITION
โข Definition: Regime change period with mixed signals and elevated uncertainty
โข Observable Signatures: Conflicting indicators, whipsaw price action, no clear momentum, high volatility without direction
โข Typical Duration: 5-15 bars
โข What It Means: Market deciding next direction, dangerous for directional trades
The Transition Matrix:
The transition matrix A captures the probability of moving from one state to another. AMWT initializes with empirically-derived values then updates online:
From/To IMP_UP IMP_DN CORR ACCUM DIST TRANS
IMP_UP 0.70 0.02 0.20 0.02 0.04 0.02
IMP_DN 0.02 0.70 0.20 0.04 0.02 0.02
CORR 0.15 0.15 0.50 0.10 0.10 0.00
ACCUM 0.30 0.05 0.15 0.40 0.05 0.05
DIST 0.05 0.30 0.15 0.05 0.40 0.05
TRANS 0.20 0.20 0.20 0.15 0.15 0.10
Key Insights from Transition Probabilities:
โข Impulse states are sticky (70% self-transition): Once trending, markets tend to continue
โข Corrections can transition to either impulse direction (15% each): The next move after correction is uncertain
โข Accumulation strongly favors IMP_UP transition (30%): Base-building leads to rallies
โข Distribution strongly favors IMP_DN transition (30%): Topping leads to declines
The Viterbi Algorithm:
Given a sequence of observations, how do we find the most likely state sequence? This is the Viterbi algorithmโdynamic programming to find the optimal path through the state space.
Mathematical Formulation:
ฮด_t(j) = max_i ร B_j(O_t)
Where:
ฮด_t(j) = probability of most likely path ending in state j at time t
A_ij = transition probability from state i to state j
B_j(O_t) = emission probability of observation O_t given state j
AMWT Implementation:
AMWT runs Viterbi over a rolling window (default 50 bars), computing the most likely state sequence and extracting:
โข Current state estimate
โข State confidence (probability of current state vs alternatives)
โข State sequence for pattern detection
Online Learning (Baum-Welch Adaptation):
Unlike static HMMs, AMWT continuously updates its transition and emission matrices based on observed market behavior:
f_onlineUpdateHMM(prev_state, curr_state, observation, decay) =>
// Update transition matrix
A *= decay
A += (1.0 - decay)
// Renormalize row
// Update emission matrix
B *= decay
B += (1.0 - decay)
// Renormalize row
The decay parameter (default 0.85) controls adaptation speed:
โข Higher decay (0.95): Slower adaptation, more stable, better for consistent markets
โข Lower decay (0.80): Faster adaptation, more reactive, better for regime changes
Why This Matters for Trading:
Traditional indicators give you a number (RSI = 72). AMWT gives you a probabilistic state assessment :
"There is a 78% probability we are in IMPULSE_UP state, with 15% probability of CORRECTION and 7% distributed among other states. The transition matrix suggests 70% chance of remaining in IMPULSE_UP next bar, 20% chance of transitioning to CORRECTION."
This enables:
โข Position sizing by confidence : 90% confidence = full size; 60% confidence = half size
โข Risk management by transition probability : High correction probability = tighten stops
โข Strategy selection by state : IMPULSE = trend-follow; CORRECTION = wait; ACCUMULATION = scale in
๐ฐ THE 3-BANDIT CONSENSUS SYSTEM
The Multi-Agent Philosophy:
No single analytical methodology works in all market conditions. Trend-following excels in trending markets but gets chopped in ranges. Mean-reversion excels in ranges but gets crushed in trends. Structure-based analysis works when structure is clear but fails in chaotic markets.
AMWT's solution: employ three independent agents , each analyzing the market from a different perspective, then use Thompson Sampling to learn which agents perform best in current conditions.
Agent 1: TREND AGENT
Philosophy : Markets trend. Follow the trend until it ends.
Analytical Components:
โข EMA Alignment: EMA8 > EMA21 > EMA50 (bullish) or inverse (bearish)
โข MACD Histogram: Direction and rate of change
โข Price Momentum: Close relative to ATR-normalized movement
โข VWAP Position: Price above/below volume-weighted average price
Signal Generation:
Strong Bull: EMA aligned bull AND MACD histogram > 0 AND momentum > 0.3 AND close > VWAP
โ Signal: +1 (Long), Confidence: 0.75 + |momentum| ร 0.4
Moderate Bull: EMA stack bull AND MACD rising AND momentum > 0.1
โ Signal: +1 (Long), Confidence: 0.65 + |momentum| ร 0.3
Strong Bear: EMA aligned bear AND MACD histogram < 0 AND momentum < -0.3 AND close < VWAP
โ Signal: -1 (Short), Confidence: 0.75 + |momentum| ร 0.4
Moderate Bear: EMA stack bear AND MACD falling AND momentum < -0.1
โ Signal: -1 (Short), Confidence: 0.65 + |momentum| ร 0.3
When Trend Agent Excels:
โข Trend days (IB extension >1.5x)
โข Post-breakout continuation
โข Institutional accumulation/distribution phases
When Trend Agent Fails:
โข Range-bound markets (ADX <20)
โข Chop zones after volatility spikes
โข Reversal days at major levels
Agent 2: REVERSION AGENT
Philosophy: Markets revert to mean. Extreme readings reverse.
Analytical Components:
โข Bollinger Band Position: Distance from bands, percent B
โข RSI Extremes: Overbought (>70) and oversold (<30)
โข Stochastic: %K/%D crossovers at extremes
โข Band Squeeze: Bollinger Band width contraction
Signal Generation:
Oversold Bounce: BB %B < 0.20 AND RSI < 35 AND Stochastic < 25
โ Signal: +1 (Long), Confidence: 0.70 + (30 - RSI) ร 0.01
Overbought Fade: BB %B > 0.80 AND RSI > 65 AND Stochastic > 75
โ Signal: -1 (Short), Confidence: 0.70 + (RSI - 70) ร 0.01
Squeeze Fire Bull: Band squeeze ending AND close > upper band
โ Signal: +1 (Long), Confidence: 0.65
Squeeze Fire Bear: Band squeeze ending AND close < lower band
โ Signal: -1 (Short), Confidence: 0.65
When Reversion Agent Excels:
โข Rotation days (price stays within IB)
โข Range-bound consolidation
โข After extended moves without pullback
When Reversion Agent Fails:
โข Strong trend days (RSI can stay overbought for days)
โข Breakout moves
โข News-driven directional moves
Agent 3: STRUCTURE AGENT
Philosophy: Market structure reveals institutional intent. Follow the smart money.
Analytical Components:
โข Break of Structure (BOS): Price breaks prior swing high/low
โข Change of Character (CHOCH): First break against prevailing trend
โข Higher Highs/Higher Lows: Bullish structure
โข Lower Highs/Lower Lows: Bearish structure
โข Liquidity Sweeps: Stop runs that reverse
Signal Generation:
BOS Bull: Price breaks above prior swing high with momentum
โ Signal: +1 (Long), Confidence: 0.70 + structure_strength ร 0.2
CHOCH Bull: First higher low after downtrend, breaking structure
โ Signal: +1 (Long), Confidence: 0.75
BOS Bear: Price breaks below prior swing low with momentum
โ Signal: -1 (Short), Confidence: 0.70 + structure_strength ร 0.2
CHOCH Bear: First lower high after uptrend, breaking structure
โ Signal: -1 (Short), Confidence: 0.75
Liquidity Sweep Long: Price sweeps below swing low then reverses strongly
โ Signal: +1 (Long), Confidence: 0.80
Liquidity Sweep Short: Price sweeps above swing high then reverses strongly
โ Signal: -1 (Short), Confidence: 0.80
When Structure Agent Excels:
โข After liquidity grabs (stop runs)
โข At major swing points
โข During institutional accumulation/distribution
When Structure Agent Fails:
โข Choppy, structureless markets
โข During news events (structure becomes noise)
โข Very low timeframes (noise overwhelms structure)
Thompson Sampling: The Bandit Algorithm
With three agents giving potentially different signals, how do we decide which to trust? This is the multi-armed bandit problem โbalancing exploitation (using what works) with exploration (testing alternatives).
Thompson Sampling Solution:
Each agent maintains a Beta distribution representing its success/failure history:
Agent success rate modeled as Beta(ฮฑ, ฮฒ)
Where:
ฮฑ = number of successful signals + 1
ฮฒ = number of failed signals + 1
On Each Bar:
1. Sample from each agent's Beta distribution
2. Weight agent signals by sampled probabilities
3. Combine weighted signals into consensus
4. Update ฮฑ/ฮฒ based on trade outcomes
Mathematical Implementation:
// Beta sampling via Gamma ratio method
f_beta_sample(alpha, beta) =>
g1 = f_gamma_sample(alpha)
g2 = f_gamma_sample(beta)
g1 / (g1 + g2)
// Thompson Sampling selection
for each agent:
sampled_prob = f_beta_sample(agent.alpha, agent.beta)
weight = sampled_prob / sum(all_sampled_probs)
consensus += agent.signal ร agent.confidence ร weight
Why Thompson Sampling?
โข Automatic Exploration : Agents with few samples get occasional chances (high variance in Beta distribution)
โข Bayesian Optimal : Mathematically proven optimal solution to exploration-exploitation tradeoff
โข Uncertainty-Aware : Small sample size = more exploration; large sample size = more exploitation
โข Self-Correcting : Poor performers naturally get lower weights over time
Example Evolution:
Day 1 (Initial):
Trend Agent: Beta(1,1) โ samples ~0.50 (high uncertainty)
Reversion Agent: Beta(1,1) โ samples ~0.50 (high uncertainty)
Structure Agent: Beta(1,1) โ samples ~0.50 (high uncertainty)
After 50 Signals:
Trend Agent: Beta(28,23) โ samples ~0.55 (moderate confidence)
Reversion Agent: Beta(18,33) โ samples ~0.35 (underperforming)
Structure Agent: Beta(32,19) โ samples ~0.63 (outperforming)
Result: Structure Agent now receives highest weight in consensus
Consensus Requirements by Mode:
Aggressive Mode:
โข Minimum 1/3 agents agreeing
โข Consensus threshold: 45%
โข Use case: More signals, higher risk tolerance
Balanced Mode:
โข Minimum 2/3 agents agreeing
โข Consensus threshold: 55%
โข Use case: Standard trading
Conservative Mode:
โข Minimum 2/3 agents agreeing
โข Consensus threshold: 65%
โข Use case: Higher quality, fewer signals
Institutional Mode:
โข Minimum 2/3 agents agreeing
โข Consensus threshold: 75%
โข Additional: Session quality >0.65, mode adjustment +0.10
โข Use case: Highest quality signals only
๐ INTELLIGENT CHOP DETECTION ENGINE
The Chop Problem:
Most trading losses occur not from being wrong about direction, but from trading in conditions where direction doesn't exist . Choppy, range-bound markets generate false signals from every methodologyโtrend-following, mean-reversion, and structure-based alike.
AMWT's chop detection engine identifies these low-probability environments before signals fire, preventing the most damaging trades.
Five-Factor Chop Analysis:
Factor 1: ADX Component (25% weight)
ADX (Average Directional Index) measures trend strength regardless of direction.
ADX < 15: Very weak trend (high chop score)
ADX 15-20: Weak trend (moderate chop score)
ADX 20-25: Developing trend (low chop score)
ADX > 25: Strong trend (minimal chop score)
adx_chop = (i_adxThreshold - adx_val) / i_adxThreshold ร 100
Why ADX Works: ADX synthesizes +DI and -DI movements. Low ADX means price is moving but not directionallyโthe definition of chop.
Factor 2: Choppiness Index (25% weight)
The Choppiness Index measures price efficiency using the ratio of ATR sum to price range:
CI = 100 ร LOG10(SUM(ATR, n) / (Highest - Lowest)) / LOG10(n)
CI > 61.8: Choppy (range-bound, inefficient movement)
CI < 38.2: Trending (directional, efficient movement)
CI 38.2-61.8: Transitional
chop_idx_score = (ci_val - 38.2) / (61.8 - 38.2) ร 100
Why Choppiness Index Works: In trending markets, price covers distance efficiently (low ATR sum relative to range). In choppy markets, price oscillates wildly but goes nowhere (high ATR sum relative to range).
Factor 3: Range Compression (20% weight)
Compares recent range to longer-term range, detecting volatility squeezes:
recent_range = Highest(20) - Lowest(20)
longer_range = Highest(50) - Lowest(50)
compression = 1 - (recent_range / longer_range)
compression > 0.5: Strong squeeze (potential breakout imminent)
compression < 0.2: No compression (normal volatility)
range_compression_score = compression ร 100
Why Range Compression Matters: Compression precedes expansion. High compression = market coiling, preparing for move. Signals during compression often fail because the breakout hasn't occurred yet.
Factor 4: Channel Position (15% weight)
Tracks price position within the macro channel:
channel_position = (close - channel_low) / (channel_high - channel_low)
position 0.4-0.6: Center of channel (indecision zone)
position <0.2 or >0.8: Near extremes (potential reversal or breakout)
channel_chop = abs(0.5 - channel_position) < 0.15 ? high_score : low_score
Why Channel Position Matters: Price in the middle of a range is in "no man's land"โequally likely to go either direction. Signals in the channel center have lower probability.
Factor 5: Volume Quality (15% weight)
Assesses volume relative to average:
vol_ratio = volume / SMA(volume, 20)
vol_ratio < 0.7: Low volume (lack of conviction)
vol_ratio 0.7-1.3: Normal volume
vol_ratio > 1.3: High volume (conviction present)
volume_chop = vol_ratio < 0.8 ? (1 - vol_ratio) ร 100 : 0
Why Volume Quality Matters: Low volume moves lack institutional participation. These moves are more likely to reverse or stall.
Combined Chop Intensity:
chopIntensity = (adx_chop ร 0.25) + (chop_idx_score ร 0.25) +
(range_compression_score ร 0.20) + (channel_chop ร 0.15) +
(volume_chop ร i_volumeChopWeight ร 0.15)
Regime Classifications:
Based on chop intensity and component analysis:
โข Strong Trend (0-20%): ADX >30, clear directional momentum, trade aggressively
โข Trending (20-35%): ADX >20, moderate directional bias, trade normally
โข Transitioning (35-50%): Mixed signals, regime change possible, reduce size
โข Mid-Range (50-60%): Price trapped in channel center, avoid new positions
โข Ranging (60-70%): Low ADX, price oscillating within bounds, fade extremes only
โข Compression (70-80%): Volatility squeeze, expansion imminent, wait for breakout
โข Strong Chop (80-100%): Multiple chop factors aligned, avoid trading entirely
Signal Suppression:
When chop intensity exceeds the configurable threshold (default 80%), signals are suppressed entirely. The dashboard displays "โ ๏ธ CHOP ZONE" with the current regime classification.
Chop Box Visualization:
When chop is detected, AMWT draws a semi-transparent box on the chart showing the chop zone. This visual reminder helps traders avoid entering positions during unfavorable conditions.
๐ง LIQUIDITY ANCHORING SYSTEM
The Liquidity Concept:
Markets move from liquidity pool to liquidity pool. Stop losses cluster at predictable locationsโbelow swing lows (buy stops become sell orders when triggered) and above swing highs (sell stops become buy orders when triggered). Institutions know where these clusters are and often engineer moves to trigger them before reversing.
AMWT identifies and tracks these liquidity events, using them as anchors for signal confidence.
Liquidity Event Types:
Type 1: Volume Spikes
Definition: Volume > SMA(volume, 20) ร i_volThreshold (default 2.8x)
Interpretation: Sudden volume surge indicates institutional activity
โข Near swing low + reversal: Likely accumulation
โข Near swing high + reversal: Likely distribution
โข With continuation: Institutional conviction in direction
Type 2: Stop Runs (Liquidity Sweeps)
Definition: Price briefly exceeds swing high/low then reverses within N bars
Detection:
โข Price breaks above recent swing high (triggering buy stops)
โข Then closes back below that high within 3 bars
โข Signal: Bullish stop run complete, reversal likely
Or inverse for bearish:
โข Price breaks below recent swing low (triggering sell stops)
โข Then closes back above that low within 3 bars
โข Signal: Bearish stop run complete, reversal likely
Type 3: Absorption Events
Definition: High volume with small candle body
Detection:
โข Volume > 2x average
โข Candle body < 30% of candle range
โข Interpretation: Large orders being filled without moving price
โข Implication: Accumulation (at lows) or distribution (at highs)
Type 4: BSL/SSL Pools (Buy-Side/Sell-Side Liquidity)
BSL (Buy-Side Liquidity):
โข Cluster of swing highs within ATR proximity
โข Stop losses from shorts sit above these highs
โข Breaking BSL triggers short covering (fuel for rally)
SSL (Sell-Side Liquidity):
โข Cluster of swing lows within ATR proximity
โข Stop losses from longs sit below these lows
โข Breaking SSL triggers long liquidation (fuel for decline)
Liquidity Pool Mapping:
AMWT continuously scans for and maps liquidity pools:
// Detect swing highs/lows using pivot function
swing_high = ta.pivothigh(high, 5, 5)
swing_low = ta.pivotlow(low, 5, 5)
// Track recent swing points
if not na(swing_high)
bsl_levels.push(swing_high)
if not na(swing_low)
ssl_levels.push(swing_low)
// Display on chart with labels
Confluence Scoring Integration:
When signals fire near identified liquidity events, confluence scoring increases:
โข Signal near volume spike: +10% confidence
โข Signal after liquidity sweep: +15% confidence
โข Signal at BSL/SSL pool: +10% confidence
โข Signal aligned with absorption zone: +10% confidence
Why Liquidity Anchoring Matters:
Signals "in a vacuum" have lower probability than signals anchored to institutional activity. A long signal after a liquidity sweep below swing lows has trapped shorts providing fuel. A long signal in the middle of nowhere has no such catalyst.
๐ SIGNAL GRADING SYSTEM
The Quality Problem:
Not all signals are created equal. A signal with 6/6 factors aligned is fundamentally different from a signal with 3/6 factors aligned. Traditional indicators treat them the same. AMWT grades every signal based on confluence.
Confluence Components (100 points total):
1. Bandit Consensus Strength (25 points)
consensus_str = weighted average of agent confidences
score = consensus_str ร 25
Example:
Trend Agent: +1 signal, 0.80 confidence, 0.35 weight
Reversion Agent: 0 signal, 0.50 confidence, 0.25 weight
Structure Agent: +1 signal, 0.75 confidence, 0.40 weight
Weighted consensus = (0.80ร0.35 + 0ร0.25 + 0.75ร0.40) / (0.35 + 0.40) = 0.77
Score = 0.77 ร 25 = 19.25 points
2. HMM State Confidence (15 points)
score = hmm_confidence ร 15
Example:
HMM reports 82% probability of IMPULSE_UP
Score = 0.82 ร 15 = 12.3 points
3. Session Quality (15 points)
Session quality varies by time:
โข London/NY Overlap: 1.0 (15 points)
โข New York Session: 0.95 (14.25 points)
โข London Session: 0.70 (10.5 points)
โข Asian Session: 0.40 (6 points)
โข Off-Hours: 0.30 (4.5 points)
โข Weekend: 0.10 (1.5 points)
4. Energy/Participation (10 points)
energy = (realized_vol / avg_vol) ร 0.4 + (range / ATR) ร 0.35 + (volume / avg_volume) ร 0.25
score = min(energy, 1.0) ร 10
5. Volume Confirmation (10 points)
if volume > SMA(volume, 20) ร 1.5:
score = 10
else if volume > SMA(volume, 20):
score = 5
else:
score = 0
6. Structure Alignment (10 points)
For long signals:
โข Bullish structure (HH + HL): 10 points
โข Higher low only: 6 points
โข Neutral structure: 3 points
โข Bearish structure: 0 points
Inverse for short signals
7. Trend Alignment (10 points)
For long signals:
โข Price > EMA21 > EMA50: 10 points
โข Price > EMA21: 6 points
โข Neutral: 3 points
โข Against trend: 0 points
8. Entry Trigger Quality (5 points)
โข Strong trigger (multiple confirmations): 5 points
โข Moderate trigger (single confirmation): 3 points
โข Weak trigger (marginal): 1 point
Grade Scale:
Total Score โ Grade
85-100 โ A+ (Exceptionalโall factors aligned)
70-84 โ A (Strongโhigh probability)
55-69 โ B (Acceptableโproceed with caution)
Below 55 โ C (Marginalโfiltered by default)
Grade-Based Signal Brightness:
Signal arrows on the chart have transparency based on grade:
โข A+: Full brightness (alpha = 0)
โข A: Slight fade (alpha = 15)
โข B: Moderate fade (alpha = 35)
โข C: Significant fade (alpha = 55)
This visual hierarchy helps traders instantly identify signal quality.
Minimum Grade Filter:
Configurable filter (default: C) sets the minimum grade for signal display:
โข Set to "A" for only highest-quality signals
โข Set to "B" for moderate selectivity
โข Set to "C" for all signals (maximum quantity)
๐ SESSION INTELLIGENCE
Why Sessions Matter:
Markets behave differently at different times. The London open is fundamentally different from the Asian lunch hour. AMWT incorporates session-aware logic to optimize signal quality.
Session Definitions:
Asian Session (18:00-03:00 ET)
โข Characteristics: Lower volatility, range-bound tendency, fewer institutional participants
โข Quality Score: 0.40 (40% of peak quality)
โข Strategy Implications: Fade extremes, expect ranges, smaller position sizes
โข Best For: Mean-reversion setups, accumulation/distribution identification
London Session (03:00-12:00 ET)
โข Characteristics: European institutional activity, volatility pickup, trend initiation
โข Quality Score: 0.70 (70% of peak quality)
โข Strategy Implications: Watch for trend development, breakouts more reliable
โข Best For: Initial trend identification, structure breaks
New York Session (08:00-17:00 ET)
โข Characteristics: Highest liquidity, US institutional activity, major moves
โข Quality Score: 0.95 (95% of peak quality)
โข Strategy Implications: Best environment for directional trades
โข Best For: Trend continuation, momentum plays
London/NY Overlap (08:00-12:00 ET)
โข Characteristics: Peak liquidity, both European and US participants active
โข Quality Score: 1.0 (100%โmaximum quality)
โข Strategy Implications: Highest probability for successful breakouts and trends
โข Best For: All signal typesโthis is prime time
Off-Hours
โข Characteristics: Thin liquidity, erratic price action, gaps possible
โข Quality Score: 0.30 (30% of peak quality)
โข Strategy Implications: Avoid new positions, wider stops if holding
โข Best For: Waiting
Smart Weekend Detection:
AMWT properly handles the Sunday evening futures open:
// Traditional (broken):
isWeekend = dayofweek == saturday OR dayofweek == sunday
// AMWT (correct):
anySessionActive = not na(asianTime) or not na(londonTime) or not na(nyTime)
isWeekend = calendarWeekend AND NOT anySessionActive
This ensures Sunday 6pm ET (when futures open) correctly shows "Asian Session" rather than "Weekend."
Session Transition Boosts:
Certain session transitions create trading opportunities:
โข Asian โ London transition: +15% confidence boost (volatility expansion likely)
โข London โ Overlap transition: +20% confidence boost (peak liquidity approaching)
โข Overlap โ NY-only transition: -10% confidence adjustment (liquidity declining)
โข Any โ Off-Hours transition: Signal suppression recommended
๐ TRADE MANAGEMENT SYSTEM
The Signal Spam Problem:
Many indicators generate signal after signal, creating confusion and overtrading. AMWT implements a complete trade lifecycle management system that prevents signal spam and tracks performance.
Trade Lock Mechanism:
Once a signal fires, the system enters a "trade lock" state:
Trade Lock Duration: Configurable (default 30 bars)
Early Exit Conditions:
โข TP3 hit (full target reached)
โข Stop Loss hit (trade failed)
โข Lock expiration (time-based exit)
During lock:
โข No new signals of same type displayed
โข Opposite signals can override (reversal)
โข Trade status tracked in dashboard
Target Levels:
Each signal generates three profit targets based on ATR:
TP1 (Conservative Target)
โข Default: 1.0 ร ATR
โข Purpose: Quick partial profit, reduce risk
โข Action: Take 30-40% off position, move stop to breakeven
TP2 (Standard Target)
โข Default: 2.5 ร ATR
โข Purpose: Main profit target
โข Action: Take 40-50% off position, trail stop
TP3 (Extended Target)
โข Default: 5.0 ร ATR
โข Purpose: Runner target for trend days
โข Action: Close remaining position or continue trailing
Stop Loss:
โข Default: 1.9 ร ATR from entry
โข Purpose: Define maximum risk
โข Placement: Below recent swing low (longs) or above recent swing high (shorts)
Invalidation Level:
Beyond stop loss, AMWT calculates an "invalidation" level where the wave hypothesis dies:
invalidation = entry - (ATR ร INVALIDATION_MULT ร 1.5)
If price reaches invalidation, the current market interpretation is wrongโnot just the trade.
Visual Trade Management:
During active trades, AMWT displays:
โข Entry arrow with grade label (โฒA+, โผB, etc.)
โข TP1, TP2, TP3 horizontal lines in green
โข Stop Loss line in red
โข Invalidation line in orange (dashed)
โข Progress indicator in dashboard
Persistent Execution Markers:
When targets or stops are hit, permanent markers appear:
โข TP hit: Green dot with "TP1"/"TP2"/"TP3" label
โข SL hit: Red dot with "SL" label
These persist on the chart for review and statistics.
๐ฐ PERFORMANCE TRACKING & STATISTICS
Tracked Metrics:
โข Total Trades: Count of all signals that entered trade lock
โข Winning Trades: Signals where at least TP1 was reached before SL
โข Losing Trades: Signals where SL was hit before any TP
โข Win Rate: Winning / Total ร 100%
โข Total R Profit: Sum of R-multiples from winning trades
โข Total R Loss: Sum of R-multiples from losing trades
โข Net R: Total R Profit - Total R Loss
Currency Conversion System:
AMWT can display P&L in multiple formats:
R-Multiple (Default)
โข Shows risk-normalized returns
โข "Net P&L: +4.2R | 78 trades" means 4.2 times initial risk gained over 78 trades
โข Best for comparing across different position sizes
Currency Conversion (USD/EUR/GBP/JPY/INR)
โข Converts R-multiples to currency based on:
- Dollar Risk Per Trade (user input)
- Tick Value (user input)
- Selected currency
Example Configuration:
Dollar Risk Per Trade: $100
Display Currency: USD
If Net R = +4.2R
Display: Net P&L: +$420.00 | 78 trades
Ticks
โข For futures traders who think in ticks
โข Converts based on tick value input
Statistics Reset:
Two reset methods:
1. Toggle Reset
โข Turn "Reset Statistics" toggle ON then OFF
โข Clears all statistics immediately
2. Date-Based Reset
โข Set "Reset After Date" (YYYY-MM-DD format)
โข Only trades after this date are counted
โข Useful for isolating recent performance
๐จ VISUAL FEATURES
Macro Channel:
Dynamic regression-based channel showing market boundaries:
โข Upper/lower bounds calculated from swing pivot linear regression
โข Adapts to current market structure
โข Shows overall trend direction and potential reversal zones
Chop Boxes:
Semi-transparent overlay during high-chop periods:
โข Purple/orange coloring indicates dangerous conditions
โข Visual reminder to avoid new positions
Confluence Heat Zones:
Background shading indicating setup quality:
โข Darker shading = higher confluence
โข Lighter shading = lower confluence
โข Helps identify optimal entry timing
EMA Ribbon:
Trend visualization via moving average fill:
โข EMA 8/21/50 with gradient fill between
โข Green fill when bullish aligned
โข Red fill when bearish aligned
โข Gray when neutral
Absorption Zone Boxes:
Marks potential accumulation/distribution areas:
โข High volume + small body = absorption
โข Boxes drawn at these levels
โข Often act as support/resistance
Liquidity Pool Lines:
BSL/SSL levels with labels:
โข Dashed lines at liquidity clusters
โข "BSL" label above swing high clusters
โข "SSL" label below swing low clusters
Six Professional Themes:
โข Quantum: Deep purples and cyans (default)
โข Cyberpunk: Neon pinks and blues
โข Professional: Muted grays and greens
โข Ocean: Blues and teals
โข Matrix: Greens and blacks
โข Ember: Oranges and reds
๐ PROFESSIONAL USAGE PROTOCOL
Phase 1: Learning the System (Week 1)
Goal: Understand AMWT concepts and dashboard interpretation
Setup:
โข Signal Mode: Balanced
โข Display: All features enabled
โข Grade Filter: C (see all signals)
Actions:
โข Paper trade ONLYโno real money
โข Observe HMM state transitions throughout the day
โข Note when agents agree vs disagree
โข Watch chop detection engage and disengage
โข Track which grades produce winners vs losers
Key Learning Questions:
โข How often do A+ signals win vs B signals? (Should see clear difference)
โข Which agent tends to be right in current market? (Check dashboard)
โข When does chop detection save you from bad trades?
โข How do signals near liquidity events perform vs signals in vacuum?
Phase 2: Parameter Optimization (Week 2)
Goal: Tune system to your instrument and timeframe
Signal Mode Testing:
โข Run 5 days on Aggressive mode (more signals)
โข Run 5 days on Conservative mode (fewer signals)
โข Compare: Which produces better risk-adjusted returns?
Grade Filter Testing:
โข Track A+ only for 20 signals
โข Track A and above for 20 signals
โข Track B and above for 20 signals
โข Compare win rates and expectancy
Chop Threshold Testing:
โข Default (80%): Standard filtering
โข Try 70%: More aggressive filtering
โข Try 90%: Less filtering
โข Which produces best results for your instrument?
Phase 3: Strategy Development (Weeks 3-4)
Goal: Develop personal trading rules based on system signals
Position Sizing by Grade:
โข A+ grade: 100% position size
โข A grade: 75% position size
โข B grade: 50% position size
โข C grade: 25% position size (or skip)
Session-Based Rules:
โข London/NY Overlap: Take all A/A+ signals
โข NY Session: Take all A+ signals, selective on A
โข Asian Session: Only A+ signals with extra confirmation
โข Off-Hours: No new positions
Chop Zone Rules:
โข Chop >70%: Reduce position size 50%
โข Chop >80%: No new positions
โข Chop <50%: Full position size allowed
Phase 4: Live Micro-Sizing (Month 2)
Goal: Validate paper trading results with minimal risk
Setup:
โข 10-20% of intended full position size
โข Take ONLY A+ signals initially
โข Follow trade management religiously
Tracking:
โข Log every trade: Entry, Exit, Grade, HMM State, Chop Level, Agent Consensus
โข Calculate: Win rate by grade, by session, by chop level
โข Compare to paper trading (should be within 15%)
Red Flags:
โข Win rate diverges significantly from paper trading: Execution issues
โข Consistent losses during certain sessions: Adjust session rules
โข Losses cluster when specific agent dominates: Review that agent's logic
Phase 5: Scaling Up (Months 3-6)
Goal: Gradually increase to full position size
Progression:
โข Month 3: 25-40% size (if micro-sizing profitable)
โข Month 4: 40-60% size
โข Month 5: 60-80% size
โข Month 6: 80-100% size
Scale-Up Requirements:
โข Minimum 30 trades at current size
โข Win rate โฅ50%
โข Net R positive
โข No revenge trading incidents
โข Emotional control maintained
๐ก DEVELOPMENT INSIGHTS
Why HMM Over Simple Indicators:
Early versions used standard indicators (RSI >70 = overbought, etc.). Win rates hovered at 52-55%. The problem: indicators don't capture state. RSI can stay "overbought" for weeks in a strong trend.
The insight: markets exist in states, and state persistence matters more than indicator levels. Implementing HMM with state transition probabilities increased signal quality significantly. The system now knows not just "RSI is high" but "we're in IMPULSE_UP state with 70% probability of staying in IMPULSE_UP."
The Multi-Agent Evolution:
Original version used a single analytical methodologyโtrend-following. Performance was inconsistent: great in trends, destroyed in ranges. Added mean-reversion agent: now it was inconsistent the other way.
The breakthrough: use multiple agents and let the system learn which works . Thompson Sampling wasn't the first attemptโtried simple averaging, voting, even hard-coded regime switching. Thompson Sampling won because it's mathematically optimal and automatically adapts without manual regime detection.
Chop Detection Revelation:
Chop detection was added almost as an afterthought. "Let's filter out obviously bad conditions." Testing revealed it was the most impactful single feature. Filtering chop zones reduced losing trades by 35% while only reducing total signals by 20%. The insight: avoiding bad trades matters more than finding good ones.
Liquidity Anchoring Discovery:
Watched hundreds of trades. Noticed pattern: signals that fired after liquidity events (stop runs, volume spikes) had significantly higher win rates than signals in quiet markets. Implemented liquidity detection and anchoring. Win rate on liquidity-anchored signals: 68% vs 52% on non-anchored signals.
The Grade System Impact:
Early system had binary signals (fire or don't fire). Adding grading transformed it. Traders could finally match position size to signal quality. A+ signals deserved full size; C signals deserved caution. Just implementing grade-based sizing improved portfolio Sharpe ratio by 0.3.
๐จ LIMITATIONS & CRITICAL ASSUMPTIONS
What AMWT Is NOT:
โข NOT a Holy Grail : No system wins every trade. AMWT improves probability, not certainty.
โข NOT Fully Automated : AMWT provides signals and analysis; execution requires human judgment.
โข NOT News-Proof : Exogenous shocks (FOMC surprises, geopolitical events) invalidate all technical analysis.
โข NOT for Scalping : HMM state estimation needs time to develop. Sub-minute timeframes are not appropriate.
Core Assumptions:
1. Markets Have States : Assumes markets transition between identifiable regimes. Violation: Random walk markets with no regime structure.
2. States Are Inferable : Assumes observable indicators reveal hidden states. Violation: Market manipulation creating false signals.
3. History Informs Future : Assumes past agent performance predicts future performance. Violation: Regime changes that invalidate historical patterns.
4. Liquidity Events Matter : Assumes institutional activity creates predictable patterns. Violation: Markets with no institutional participation.
Performs Best On:
โข Liquid Futures : ES, NQ, MNQ, MES, CL, GC
โข Major Forex Pairs : EUR/USD, GBP/USD, USD/JPY
โข Large-Cap Stocks : AAPL, MSFT, TSLA, NVDA (>$5B market cap)
โข Liquid Crypto : BTC, ETH on major exchanges
Performs Poorly On:
โข Illiquid Instruments : Low volume stocks, exotic pairs
โข Very Low Timeframes : Sub-5-minute charts (noise overwhelms signal)
โข Binary Event Days : Earnings, FDA approvals, court rulings
โข Manipulated Markets : Penny stocks, low-cap altcoins
Known Weaknesses:
โข Warmup Period : HMM needs ~50 bars to initialize properly. Early signals may be unreliable.
โข Regime Change Lag : Thompson Sampling adapts over time, not instantly. Sudden regime changes may cause short-term underperformance.
โข Complexity : More parameters than simple indicators. Requires understanding to use effectively.
โ ๏ธ RISK DISCLOSURE
Trading futures, stocks, options, forex, and cryptocurrencies involves substantial risk of loss and is not suitable for all investors. Adaptive Market Wave Theory, while based on rigorous mathematical frameworks including Hidden Markov Models and multi-armed bandit algorithms, does not guarantee profits and can result in significant losses.
AMWT's methodologiesโHMM state estimation, Thompson Sampling agent selection, and confluence-based gradingโhave theoretical foundations but past performance is not indicative of future results.
Hidden Markov Model assumptions may not hold during:
โข Major news events disrupting normal market behavior
โข Flash crashes or circuit breaker events
โข Low liquidity periods with erratic price action
โข Algorithmic manipulation or spoofing
Multi-agent consensus assumes independent analytical perspectives provide edge. Market conditions change. Edges that existed historically can diminish or disappear.
Users must independently validate system performance on their specific instruments, timeframes, and broker execution environment. Paper trade extensively before risking capital. Start with micro position sizing.
Never risk more than you can afford to lose completely. Use proper position sizing. Implement stop losses without exception.
By using this indicator, you acknowledge these risks and accept full responsibility for all trading decisions and outcomes.
"Elliott Wave was a first-order approximation of market phase behavior. AMWT is the secondโprobabilistic, adaptive, and accountable."
Initial Public Release
Core Engine:
โข True Hidden Markov Model with online Baum-Welch learning
โข Viterbi algorithm for optimal state sequence decoding
โข 6-state market regime classification
Agent System:
โข 3-Bandit consensus (Trend, Reversion, Structure)
โข Thompson Sampling with true Beta distribution sampling
โข Adaptive weight learning based on performance
Signal Generation:
โข Quality-based confluence grading (A+/A/B/C)
โข Four signal modes (Aggressive/Balanced/Conservative/Institutional)
โข Grade-based visual brightness
Chop Detection:
โข 5-factor analysis (ADX, Choppiness Index, Range Compression, Channel Position, Volume)
โข 7 regime classifications
โข Configurable signal suppression threshold
Liquidity:
โข Volume spike detection
โข Stop run (liquidity sweep) identification
โข BSL/SSL pool mapping
โข Absorption zone detection
Trade Management:
โข Trade lock with configurable duration
โข TP1/TP2/TP3 targets
โข ATR-based stop loss
โข Persistent execution markers
Session Intelligence:
โข Asian/London/NY/Overlap detection
โข Smart weekend handling (Sunday futures open)
โข Session quality scoring
Performance:
โข Statistics tracking with reset functionality
โข 7 currency display modes
โข Win rate and Net R calculation
Visuals:
โข Macro channel with linear regression
โข Chop boxes
โข EMA ribbon
โข Liquidity pool lines
โข 6 professional themes
Dashboards:
โข Main Dashboard: Market State, Consensus, Trade Status, Statistics
๐ AMWT vs AMWT-PRO:
This version includes all core AMWT functionality:
โ Full Hidden Markov Model state estimation
โ 3-Bandit Thompson Sampling consensus system
โ Complete 5-factor chop detection engine
โ All four signal modes
โ Full trade management with TP/SL tracking
โ Main dashboard with complete statistics
โ All visual features (channels, zones, pools)
โ Identical signal generation to PRO
โ Six professional themes
โ Full alert system
The PRO version adds the AMWT Advisor panelโa secondary dashboard providing:
โข Real-time Market Pulse situation assessment
โข Agent Matrix visualization (individual agent votes)
โข Structure analysis breakdown
โข "Watch For" upcoming setups
โข Action Command coaching
Both versions generate identical signals . The Advisor provides additional guidance for interpreting those signals.
Taking you to school. - Dskyz, Trade with probability. Trade with consensus. Trade with AMWT.
Swing Failure Signals [AlgoAlpha]๐ OVERVIEW
This script detects swing failure patterns by tracking how price interacts with recent swing highs and lows, then confirming those sweeps with a change in candle behavior. The goal is to highlight areas where price briefly breaks a key level, fails to continue, and then shifts direction. These events often occur around liquidity runs, where stops are triggered before price reverses. The script draws levels, colors bars, and prints clear markers to help visualize where these failures occur and when they are confirmed.
๐ CONCEPTS
The logic starts with pivot-based swing detection. Recent swing highs and lows are stored and monitored. When price trades beyond one of these levels within a defined historical window, it is treated as a sweep. A sweep alone is not enough. The script then waits for a Change in State of Delivery (CISD), which is defined by a shift in candle structure that shows follow-through in the opposite direction. A tolerance filter measures how far price traveled beyond the level relative to the reaction that followed. If the reaction is strong enough and happens within a limited number of bars, the sweep is validated as a swing failure. In short: the swing defines the reference, the sweep shows intent, and the CISD confirms acceptance or rejection.
๐ FEATURES
Sweep detection with a maximum lookback to avoid outdated levels
CISD confirmation using candle structure and price expansion
Alert conditions for bullish and bearish swing failures
๐ USAGE
Setup : Add the script to your chart. It works on any market and timeframe. Lower timeframes highlight intraday liquidity runs, while higher timeframes show structural failures. Start with the default inputs before adjusting.
Read the chart : A bullish swing failure occurs when price sweeps a prior low, then reverses and confirms with a bullish CISD. A bearish swing failure is the opposite, sweeping a prior high and confirming with a bearish CISD. Dashed lines mark the swept swing. Solid lines mark the CISD level. Bars are colored while the SFP state is active.
Settings that matter : Increasing Pivot Detection Length finds more significant swings but fewer signals. Reducing Max Pivot Point Edge limits how far back sweeps are allowed, keeping signals more current. The Patience setting controls how many bars are allowed for confirmation after a sweep. The Trend Noise Filter raises or lowers how strong the reaction must be to qualify as a valid failure.
SiCInside Sweep Close (ISC):
This concept captures a specific price action behavior and can help refine trading strategies for better precision. Here's a detailed explanation:
Inside:
The closing price of the candle stays within the range of the previous candle.
This indicates a containment of price action, suggesting indecision or preparation for a significant move.
Sweep:
The wick of the candle takes out (or "sweeps") the low (or high) of the previous candle.
This sweep can trigger stop-losses of retail traders or activate pending orders, often used by smart money strategies.
Close:
The candle ultimately closes inside the range of the previous candle.
This close signifies that the sweep was a liquidity grab rather than a genuine breakout, providing an actionable trading signal.
How ISC Can Be Used in Trading:
Liquidity Grab Recognition:
ISC can indicate when liquidity is swept from the market, making it an ideal entry point for traders anticipating a reversal or continuation.
Smart Money Concept (SMC) Synergy:
If you follow SMC principles, ISC aligns with key concepts like liquidity sweeps, order blocks, and mitigation zones.
Risk Management:
By identifying the ISC setup, you can place tighter stop-loss levels just outside the sweep, optimizing risk-reward ratios.
Entry Signals:
When you spot an ISC, you can enter trades at the close of the candle, anticipating a move in the direction opposite to the sweep.
Example of ISC in Action:
Imagine a bearish candle:
The wick sweeps the low of the previous candle, possibly triggering stop-losses.
However, the close stays inside the previous candleโs range.
This setup might indicate a reversal, where price moves upward after grabbing liquidity.
Why This Name Works:
Itโs concise, professional, and directly linked to the trading action youโre describing.
The short form, ISC, is easy to remember and discuss within trading circles or while teaching others.
It ties into widely known concepts like smart money, price action, and liquidity sweeps, making it relatable yet unique.
Does this align with how you envision using the concept? Let me know if youโd like more refinements or visual examples!
MTF Candles [Fadi x MMT]MTF Candles
Overview
The MTF Candles indicator is a powerful tool designed for traders who want to visualize higher timeframe (HTF) candles directly on their current chart. Built with flexibility and precision in mind, this Pine Script indicator displays up to six higher timeframe candles, complete with customizable styling, sweeps, midpoints, fair value gaps (FVGs), volume imbalances, and trace lines. Itโs perfect for multi-timeframe analysis, helping traders identify key levels, market structure, and potential trading opportunities with ease.
Key Features
- Multi-Timeframe Candles : Display up to six higher timeframe candles (e.g., 5m, 15m, 30m, 4H, 1D, 1W) on your chart, with configurable timeframes and visibility.
- Sweeps Detection : Identify liquidity sweeps (highs/lows) with customizable line styles, widths, and colors, plus optional alerts for confirmed bullish or bearish sweeps.
- Midpoint Lines : Plot the midpoint (average of high and low) of the previous HTF candle, with customizable color, width, and style for enhanced market analysis.
- Fair Value Gaps (FVGs) : Highlight gaps between non-adjacent candles, indicating potential areas of interest for price action.
- Volume Imbalances : Detect and display volume imbalances between adjacent candles, aiding in spotting significant price levels.
- Trace Lines : Connect HTF candle open, close, high, and low prices to their respective chart bars, with customizable styles and optional price labels.
- Custom Daily Open Times : Support for custom daily candle open times (Midnight, 8:30, or 9:30) to align with specific market sessions.
- Dynamic Labels : Show timeframe names, remaining time until the next HTF candle, and interval labels (e.g., day of the week for daily candles) with adjustable positions and sizes.
- Highly Customizable : Fine-tune candle appearance, spacing, padding, and visual elements to suit your trading style.
How It Works
The indicator renders HTF candles as boxes (bodies) and lines (wicks) on the right side of the chart, with each timeframe offset for clarity. It dynamically updates candles in real-time, tracks their highs and lows, and displays sweeps and midpoints when conditions are met. FVGs and volume imbalances are calculated based on candle relationships, and trace lines link HTF candle levels to their originating bars on the chart.
Sweep Logic
- A bearish sweep occurs when the current candleโs high exceeds the previous candleโs high, but the close is below it.
- A bullish sweep occurs when the current candleโs low falls below the previous candleโs low, but the close is above it.
- Sweeps are visualized as horizontal lines and can trigger alerts when confirmed on the next candle.
Midpoint Logic
- A midpoint line is drawn at the average of the previous HTF candleโs high and low, extending until the next HTF candle forms.
- Useful for identifying potential support/resistance or mean reversion levels.
Imbalance Detection
- FVGs : Identified when a candleโs low is above the next-but-one candleโs high (or vice versa), indicating a price gap.
- Volume Imbalances : Detected between adjacent candles where the body of one candle doesnโt overlap with the next, signaling potential liquidity zones.
Settings
Timeframe Settings
- HTF 1โ6 : Enable/disable up to six higher timeframes (default: 5m, 15m, 30m, 4H, 1D, 1W) and set the maximum number of candles to display per timeframe (default: 4).
- Limit to Next HTFs : Restrict the number of active timeframes (1โ6).
Styling
- Body, Border, Wick Colors : Customize bull and bear candle colors (default: light gray for bulls, dark gray for bears).
- Candle Width : Adjust the width of HTF candles (1โ4).
- Padding and Spacing : Set the offset from the current price action and spacing between candles and timeframes.
Label Settings
- HTF Label : Show/hide timeframe labels (e.g., "15m", "4H") at the top/bottom of candle sets.
- Remaining Time : Display the countdown to the next HTF candle.
Interval Value: Show day of the week for daily candles or time for intraday candles.
- Label Position/Alignment : Choose to display labels at the top, bottom, or both, and align them with the highest/lowest candles or follow individual candle sets.
Imbalance Settings
- Fair Value Gap : Enable/disable FVGs with customizable color (default: semi-transparent gray).
- Volume Imbalance : Enable/disable volume imbalances with customizable color (default: semi-transparent red).
Trace Settings
- Trace Lines : Enable/disable lines connecting HTF candle levels to their chart bars, with customizable colors, styles (solid, dashed, dotted), and sizes.
- Price Labels : Show price levels for open, close, high, and low trace lines.
- Anchor : Choose whether trace lines anchor to the first or last enabled timeframe.
Sweep Settings
- Show Sweeps : Enable/disable sweep detection and visualization.
- Sweep Line : Customize color, width, and style (solid, dashed, dotted).
- Sweep Alert : Enable alerts for confirmed sweeps.
Midpoint Settings
- Show Midpoint : Enable/disable midpoint lines.
- Midpoint Line : Customize color (default: orange), width, and style (solid, dashed, dotted).
Custom Daily Open
Custom Daily Candle Open : Choose between Midnight, 8:30, or 9:30 (America/New_York) for daily candle opens.
Usage
- Add the indicator to your TradingView chart.
- Configure the desired higher timeframes (HTF 1โ6) and enable/disable features via the settings panel.
- Adjust styling, labels, and spacing to match your chart preferences.
Use sweeps, midpoints, FVGs, and volume imbalances to identify key levels for trading decisions.
- Enable sweep alerts to receive notifications for confirmed liquidity sweeps.
Notes
Performance: The indicator is optimized for up to 500 boxes, lines, and labels, with a maximum of 5000 bars back. Can be slow at a time
Time Zone: Custom daily opens use the America/New_York time zone for consistency with major financial markets.
Compatibility: Ensure selected HTFs are valid (higher than the chartโs timeframe and divisible by it for intraday periods).
Fibonacci Bands [BigBeluga]The Fibonacci Band indicator is a powerful tool for identifying potential support, resistance, and mean reversion zones based on Fibonacci ratios. It overlays three sets of Fibonacci ratio bands (38.2%, 61.8%, and 100%) around a central trend line, dynamically adapting to price movements. This structure enables traders to track trends, visualize potential liquidity sweep areas, and spot reversal points for strategic entries and exits.
๐ต KEY FEATURES & USAGE
Fibonacci Bands for Support & Resistance:
The Fibonacci Band indicator applies three key Fibonacci ratios (38.2%, 61.8%, and 100%) to construct dynamic bands around a smoothed price. These levels often act as critical support and resistance areas, marked with labels displaying the percentage and corresponding price. The 100% band level is especially crucial, signaling potential liquidity sweep zones and reversal points.
Mean Reversion Signals at 100% Bands:
When price moves above or below the 100% band, the indicator generates mean reversion signals.
Trend Detection with Midline:
The central line acts as a trend-following tool: when solid, it indicates an uptrend, while a dashed line signals a downtrend. This adaptive midline helps traders assess the prevailing market direction while keeping the chart clean and intuitive.
Extended Price Projections:
All Fibonacci bands extend to future bars (default 30) to project potential price levels, providing a forward-looking perspective on where price may encounter support or resistance. This feature helps traders anticipate market structure in advance and set targets accordingly.
Liquidity Sweep:
--
-Liquidity Sweep at Previous Lows:
The price action moves below a previous low, capturing sell-side liquidity (stop-losses from long positions or entries for breakout traders).
The wick suggests that the price quickly reversed, leaving a failed breakout below support.
This is a classic liquidity grab, often indicating a bullish reversal .
-Liquidity Sweep at Previous Highs:
The price spikes above a prior high, sweeping buy-side liquidity (stop-losses from short positions or breakout entries).
The wick signifies rejection, suggesting a failed breakout above resistance.
This is a bearish liquidity sweep , often followed by a mean reversion or a downward move.
Display Customization:
To declutter the chart, traders can choose to hide Fibonacci levels and only display overbought/oversold zones along with the trend-following midline and mean reversion signals. This option enables a clearer focus on key reversal areas without additional distractions.
๐ต CUSTOMIZATION
Period Length: Adjust the length of the smoothed moving average for more reactive or smoother bands.
Channel Width: Customize the width of the Fibonacci channel.
Fibonacci Ratios: Customize the Fibonacci ratios to reflect personal preference or unique market behaviors.
Future Projection Extension: Set the number of bars to extend Fibonacci bands, allowing flexibility in projecting price levels.
Hide Fibonacci Levels: Toggle the visibility of Fibonacci levels for a cleaner chart focused on overbought/oversold regions and midline trend signals.
Liquidity Sweep: Toggle the visibility of Liquidity Sweep points
The Fibonacci Band indicator provides traders with an advanced framework for analyzing market structure, liquidity sweeps, and trend reversals. By integrating Fibonacci-based levels with trend detection and mean reversion signals, this tool offers a robust approach to navigating dynamic price action and finding high-probability trading opportunities.
Advanced ICT Theory - A-ICT๐ Advanced ICT Theory (A-ICT): The Institutional Manipulation Detector
Are you tired of being the liquidity? Stop chasing shadows and start tracking the architects of price movement.
This is not another lagging indicator. This is a complete framework for viewing the market through the lens of institutional traders. Advanced ICT Theory (A-ICT) is an all-in-one, military-grade analysis engine designed to decode the complex language of "Smart Money." It automates the core tenets of Inner Circle Trader (ICT) methodology, moving beyond simple patterns to build a dynamic, real-time narrative of market manipulation, liquidity engineering, and institutional order flow.
AIT provides a living blueprint of the market, identifying high-probability zones, tracking structural shifts, and scoring the quality of setups with a sophisticated, multi-factor algorithm. This is your X-ray into the market's true intentions.
๐ฌ THE CORE ENGINE: DECODING THE THEORY & FORMULAS
A-ICT is built upon a sophisticated, multi-layered logic system that interprets price action as a story of cause and effect. It does not guess; it confirms. Here is the foundational theory that drives the engine:
1. Market Structure: The Blueprint of Trend
The script first establishes a deep understanding of the market's skeleton through multi-level pivot analysis. It uses ta.pivothigh and ta.pivotlow to identify significant swing points.
Internal Structure (iBOS): Minor swings that show the short-term order flow. A break of internal structure is the first whisper of a potential shift.
External Structure (eBOS): Major swing points that define the primary trend. A confirmed break of external structure is a powerful statement of trend continuation. AIT validates this with optional Volume Confirmation (volume > volumeSMA * 1.2) and Candle Confirmation to ensure the break is driven by institutional force, not just a random spike.
Change of Character (CHoCH): This is the earthquake. A CHoCH occurs when a confirmed eBOS happens against the prevailing trend (e.g., a bearish eBOS in a clear uptrend). A-ICT flags this immediately, as it is the strongest signal that the primary trend is under threat of reversal.
2. Liquidity Engineering: The Fuel of the Market
Institutions don't buy into strength; they buy into weakness. They need liquidity. A-ICT maps these liquidity pools with forensic precision:
Buyside & Sellside Liquidity (BSL/SSL): Using ta.highest and ta.lowest, AIT identifies recent highs and lows where clusters of stop-loss orders (liquidity) are resting. These are institutional targets.
Liquidity Sweeps: This is the "manipulation" part of the detector. AIT has a specific formula to detect a sweep: high > bsl and close < bsl . This signifies that institutions pushed price just high enough to trigger buy-stops before aggressively sellingโa classic "stop hunt." This event dramatically increases the quality score of subsequent patterns.
3. The Element Lifecycle: From Potential to Power
This is the revolutionary heart of A-ICT. Zones are not static; they have a lifecycle. AIT tracks this with its dynamic classification engine.
Phase 1: PENDING (Yellow): The script identifies a potential zone of interest based on a specific candle formation (a "displacement"). It is marked as "Pending" because its true nature is unknown. It is a question.
Phase 2: CLASSIFICATION: After the zone is created, AIT watches what happens next. The zone's identity is defined by its actions:
ORDER BLOCK (Blue): The highest-grade element. A zone is classified as an Order Block if it directly causes a Break of Structure (BOS) . This is the footprint of institutions entering the market with enough force to validate the new trend direction.
TRAP ZONE (Orange): A zone is classified as a Trap Zone if it is directly involved in a Liquidity Sweep . This indicates the zone was used to engineer liquidity, setting a "trap" for retail traders before a reversal.
REVERSAL / S&R ZONE (Green): If a zone is not powerful enough to cause a BOS or a major sweep, but still serves as a pivot point, it's classified as a general support/resistance or reversal zone.
4. Market Inefficiencies: Gaps in the Matrix
Fair Value Gaps (FVG): AIT detects FVGsโa 3-bar pattern indicating an imbalanceโwith a strict formula: low > high (for a bullish FVG) and gapSize > atr14 * 0.5. This ensures only significant, volatile gaps are shown. An FVG co-located with an Order Block is a high-confluence setup.
5. Premium & Discount: The Law of Value
Institutions buy at wholesale (Discount) and sell at retail (Premium). AIT uses a pdLookback to define the current dealing range and divides it into three zones: Premium (sell zone), Discount (buy zone), and Equilibrium. An element's quality score is massively boosted if it aligns with this principle (e.g., a bullish Order Block in a Discount zone).
โ๏ธ THE CONTROL PANEL: A COMPLETE GUIDE TO THE INPUTS MENU
Every setting is a lever, allowing you to tune the AIT engine to your exact specifications. Master these to unlock the script's full potential.
๐ฏ A-ICT Detection Engine
Min Displacement Candles: Controls the sensitivity of element detection. How it works: It defines the number of subsequent candles that must be "inside" a large parent candle. Best practice: Use 2-3 for a balanced view on most timeframes. A higher number (4-5) will find only major, more significant zones, ideal for swing trading. A lower number (1) is highly sensitive, suitable for scalping.
Mitigation Method: Defines when a zone is considered "used up" or mitigated. How it works: Cross triggers as soon as price touches the zone's boundary. Close requires a candle to fully close beyond it. Best practice: Cross is more responsive for fast-moving markets. Close is more conservative and helps filter out fake-outs caused by wicks, making it safer for confirmations.
Min Element Size (ATR): A crucial noise filter. How it works: It requires a detected zone to be at least this multiple of the Average True Range (ATR). Best practice: Keep this around 0.5. If you see too many tiny, irrelevant zones, increase this value to 0.8 or 1.0. If you feel the script is missing smaller but valid zones, decrease it to 0.3.
Age Threshold & Pending Timeout: These manage visual clutter. How they work: Age Threshold removes old, mitigated elements after a set number of bars. Pending Timeout removes a "Pending" element if it isn't classified within a certain window. Best practice: The default settings are optimized. If your chart feels cluttered, reduce the Age Threshold. If pending zones disappear too quickly, increase the Pending Timeout.
Min Quality Threshold: Your primary visual filter. How it works: It hides all elements (boxes, lines, labels) that do not meet this minimum quality score (0-100). Best practice: Start with the default 30. To see only A- or B-grade setups, increase this to 60 or 70 for an exceptionally clean, high-probability view.
๐๏ธ Market Structure
Lookbacks (Internal, External, Major): These define the sensitivity of the trend analysis. How they work: They set the number of bars to the left and right for pivot detection. Best practice: Use smaller values for Internal (e.g., 3) to see minor structure and larger values for External (e.g., 10-15) to map the main trend. For a macro, long-term view, increase the Major Swing Lookback.
Require Volume/Candle Confirmation: Toggles for quality control on BOS/CHoCH signals. Best practice: It is highly recommended to keep these enabled. Disabling them will result in more structure signals, but many will be false alarms. They are your filter against market noise.
... (Continue this detailed breakdown for every single input group: Display Configuration, Zones Style, Levels Appearance, Colors, Dashboards, MTF, Liquidity, Premium/Discount, Sessions, and IPDA).
๐ THE INTELLIGENCE DASHBOARDS: YOUR COMMAND CENTER
The dashboards synthesize all the complex analysis into a simple, actionable intelligence briefing.
Main Dashboard (Bottom Right)
ICT Metrics & Breakdown: This is your statistical overview. Total Elements shows how much structure the script is tracking. High Quality instantly tells you if there are any A/B grade setups nearby. Unmitigated vs. Mitigated shows the balance of fresh opportunities versus resolved price action. The breakdown by Order Blocks, Trap Zones, etc., gives you a quick read on the market's recent character.
Structure & Market Context: This is your core bias. Order Flow tells you the current script-determined trend. Last BOS shows you the most recent structural event. CHoCH Active is a critical warning. HTF Bias shows if you are aligned with the higher timeframeโthe checkmark (โ) for alignment is one of the most important confluence factors.
Smart Money Flow: A volume-based sentiment gauge. Net Flow shows the raw buying vs. selling pressure, while the Bias provides an interpretation (e.g., "STRONG BULLISH FLOW").
Key Guide (Large Dashboard only): A built-in legend so you never have to guess. It defines every pattern, structure type, and special level visually.
๐ Narrative Dashboard (Bottom Left)
This is the "story" of the market, updated in real-time. It's designed to build your trading thesis.
Recent Elements Table: A live list of the most recent, high-quality setups. It displays the Type , its Narrative Role (e.g., "Bullish OB caused BOS"), its raw Quality percentage, and its final Trade Score grade. This is your at-a-glance opportunity scanner.
Market Narrative Section: This is the soul of A-ICT. It combines all data points into a human-readable story:
๐ Current Phase: Tells you if you are in a high-volatility Killzone or a consolidation phase like the Asian Range.
๐ฏ Bias & Alignment: Your primary direction, with a clear indicator of HTF alignment or conflict.
๐ Events: A causal sequence of recent events, like "๐ง Sell-side liquidity swept โ
๐ Bullish BOS โ ๐ฏ Active Order Block".
๐ฏ Next Expectation: The script's logical conclusion. It provides a specific, forward-looking hypothesis, such as "๐ Pullback expected to bullish OB at 1.2345 before continuation up."
๐จ READING THE BATTLEFIELD: A VISUAL INTERPRETATION GUIDE
Every color and line is a piece of information. Learn to read them together to see the full picture.
The Core Zones (Boxes):
Blue Box (Order Block): Highest probability zone for trend continuation. Look for entries here.
Orange Box (Trap Zone): A manipulation footprint. Expect a potential reversal after price interacts with this zone.
Green Box (Reversal/S&R): A standard pivot area. A good reference point but requires more confluence.
Purple Box (FVG): A market imbalance. Acts as a magnet for price. An FVG inside an Order Block is an A+ confluence.
The Structural Lines:
Green/Red Line (eBOS): Confirms the trend direction. A break above the green line is bullish; a break below the red line is bearish.
Thick Orange Line (CHoCH): WARNING. The previous trend is now in question. The market character has changed.
Blue/Red Lines (BSL/SSL): Liquidity targets. Expect price to gravitate towards these lines. A dotted line with a checkmark (โ) means the liquidity has been "swept" or "purged."
How to Synthesize: The magic is in the confluence. A perfect setup might look like this: Price sweeps below a red SSL line , enters a green Discount Zone during the NY Killzone , and forms a blue Order Block which then causes a green eBOS . This sequence, visible at a glance, is the story of a high-probability long setup.
๐ง THE ARCHITECT'S VISION: THE DEVELOPMENT JOURNEY
A-ICT was forged from the frustration of using lagging indicators in a market that is forward-looking. Traditional tools are reactive; they tell you what happened. The vision for A-ICT was to create a proactive engine that could anticipate institutional behavior by understanding their objectives: liquidity and efficiency. The development process was centered on creating a "lifecycle" for price patternsโthe idea that a zone's true meaning is only revealed by its consequence. This led to the post-breakout classification system and the narrative-building engine. It's designed not just to show you patterns, but to tell you their story.
โ ๏ธ RISK DISCLAIMER & BEST PRACTICES
Advanced ICT Theory (A-ICT) is a professional-grade analytical tool and does not provide financial advice or direct buy/sell signals. Its analysis is based on historical price action and probabilities. All forms of trading involve substantial risk. Past performance is not indicative of future results. Always use this tool as part of a comprehensive trading plan that includes your own analysis and a robust risk management strategy. Do not trade based on this indicator alone.
่ฆณใฎ็ฎใคใใใ่ฆใฎ็ฎใใใ
"Kan no me tsuyoku, ken no me yowaku"
โ Miyamoto Musashi, The Book of Five Rings
English: "Perceive that which cannot be seen with the eye."
โ Dskyz, Trade with insight. Trade with anticipation.
CBC Strategy with Trend Confirmation & Separate Stop LossCBC Flip Strategy with Trend Confirmation and ATR-Based Targets
This strategy is based on the CBC Flip concept taught by MapleStax and inspired by the original CBC Flip indicator by AsiaRoo. It focuses on identifying potential reversals or trend continuation points using a combination of candlestick patterns (CBC Flips), trend filters, and a time-based entry window. This approach helps traders avoid false signals and increase trade accuracy.
What is a CBC Flip?
The CBC Flip is a candlestick-based pattern that identifies moments when the market is likely to change direction or strengthen its trend. It checks for a shift in price behavior between consecutive candles, signaling a bullish (upward) or bearish (downward) move.
However, not all flips are created equal! This strategy differentiates between Strong Flips and All Flips, allowing traders to choose between a more conservative or aggressive approach.
Strong Flips vs. All Flips
Strong Flips
A Strong Flip is a high-probability setup that occurs only after liquidity is swept from the previous candleโs high or low.
What is a liquidity sweep? This happens when the price briefly moves beyond the high or low of the previous candle, triggering stop-losses and trapping traders in the wrong direction. These sweeps often create fuel for the next move, making them powerful reversal signals.
Examples:
Long Setup: The price dips below the previous candleโs low (sweeping liquidity) and then closes higher, signaling a potential bullish move.
Short Setup: The price moves above the previous candleโs high and then closes lower, signaling a potential bearish move.
Why Use Strong Flips?
They provide fewer signals, but the accuracy is generally higher.
Ideal for trending markets where liquidity sweeps often mark key turning points.
All Flips
All Flips are less selective, offering both Strong Flips and additional signals without requiring a liquidity sweep.
This approach gives traders more frequent opportunities but comes with a higher risk of false signals, especially in sideways markets.
Examples:
Long Setup: A CBC flip occurs without sweeping the previous low, but the trend direction is confirmed (slow EMA is still above VWAP).
Short Setup: A CBC flip occurs without sweeping the previous high, but the trend is still bearish (slow EMA below VWAP).
Why Use All Flips?
Provides more frequent entries for active or aggressive traders.
Works well in trending markets but requires caution during consolidation periods.
How This Strategy Works
The strategy combines CBC Flips with multiple filters to ensure better trade quality:
Trend Confirmation: The slow EMA (20-period) must be positioned relative to the VWAP to confirm the overall trend direction.
Long Trades: Slow EMA must be above VWAP (upward trend).
Short Trades: Slow EMA must be below VWAP (downward trend).
Time-Based Filter: Traders can specify trading hours to limit entries to a particular time window, helping avoid low-volume or high-volatility periods.
Profit Target and Stop-Loss:
Profit Target: Defined as a multiple of the 14-period ATR (Average True Range). For example, if the ATR is 10 points and the profit target multiplier is set to 1.5, the strategy aims for a 15-point profit.
Stop-Loss: Uses a dynamic, candle-based stop-loss:
Long Trades: The trade closes if the market closes below the low of two candles ago.
Short Trades: The trade closes if the market closes above the high of two candles ago.
This approach adapts to recent price behavior and protects against unexpected reversals.
Customizable Settings
Strong Flips vs. All Flips: Choose between a more selective or aggressive entry style.
Profit Target Multiplier: Adjust the ATR multiplier to control the distance for profit targets.
Entry Time Range: Define specific trading hours for the strategy.
Indicators and Visuals
Fast EMA (10-Period) โ Black Line
Slow EMA (20-Period) โ Red Line
VWAP (Volume-Weighted Average Price) โ Orange Line
Visual Labels:
โต (Triangle Up) โ Marks long entries (buy signals).
โฟ (Triangle Down) โ Marks short entries (sell signals).
Credits
CBC Flip Concept: Inspired by MapleStax, who teaches this concept.
Original Indicator: Developed by AsiaRoo, this strategy builds on the CBC Flip framework with additional features for improved trade management.
Risks and Disclaimer
This strategy is for educational purposes only and does not constitute financial advice.
Trading involves significant risk and may result in the loss of capital. Past performance does not guarantee future results. Use this strategy in a simulated environment before applying it to live trading.
Master Strategy: BTC W1 Mean Reversion [Institutional SOP]Overview This is an institutional-grade Mean Reversion and Range Rotation strategy designed specifically for Bitcoin (BTC/USDT) Perpetual Futures. It operates on the philosophy that liquidity resides at the extremes of the previous week's range (Previous Week High/Low). The strategy looks for false breakouts (Sweeps) followed by a confirmed return to the range (Reclaim), targeting the weekly equilibrium (EQ).
Core Logic: The Deviation Play Unlike standard breakout strategies, this indicator hunts for trapped liquidity.
Weekly Levels (Fixed): It calculates PWH (Previous Week High) and PWL (Previous Week Low) based on confirmed, closed weekly data. These levels act as the "Box" for the current week.
The Sweep: We wait for price to pierce the PWH or PWL (taking liquidity/stops). The script uses a dynamic ATR-based threshold to filter out noise (micro-pokes).
The Reclaim (4H Close): A signal is generated ONLY if a 4H candle closes back inside the weekly range shortly after the sweep. This confirms rejection of higher/lower prices.
The Entry: The script suggests a Limit Order at the retested level (PWH/PWL) to maximize R:R.
Institutional Quality Filters ("Kill Switches") To prevent trading in unfavorable conditions, the script includes strict SOP (Standard Operating Procedure) filters:
Trend Filter (ADX): Blocks mean reversion signals if the daily trend is too strong (ADX > 25).
Expansion Filter: Blocks signals if price accepted levels outside the range for too long (prevents fighting a true breakout).
Weekly Range Filter: Filters out weeks that are statistically too tight (chop) or too wide (expansion).
Time Filter: A reclaim must happen within a set number of 4H bars after the sweep (default: 3).
Key Features
Zero Repainting: Logic is based strictly on closed candles ( , , ).
State Machine Logic: Uses internal memory to track sweeps regardless of chart timeframe glitches.
Operational Dashboard: Displays current status, countdown to next decision candle (4H close), and exact parameters for the last valid signal (Entry, SL, TP).
Unified Alerting: A single "Any function call" alert handles both Long and Short scenarios dynamically.
Clean Visuals: Levels are plotted with line breaks to avoid visual clutter between weeks.
How to Use
Timeframe: Set your chart to 4H. This is crucial as the logic relies on 4H closes.
Signals: Wait for the "4H RECLAIM" label.
Execution: Place a Limit Order at the suggested Level (PWH/PWL).
Stop Loss: Use the calculated SL provided by the indicator (Swing extreme + ATR buffer).
Target: TP1 is always the EQ (Equilibrium/Mid-range).
Simulated Liquidation Heatmap [QuantAlgo]๐ข Overview
This indicator visualizes where clusters of stop-loss orders and liquidation levels are likely located, displayed as a 'heatmap'. It's based on the concept of market structure liquidity: large groups of stop orders tend to gather around obvious technical levels (like swing highs and lows), and these pools of orders often attract price movement from institutional traders. The indicator uses a fractal-based algorithm to identify these high-probability liquidation zones and displays them as dynamic, color-coded boxes.
The key feature is the thermal color gradient, which indicates the freshness (age) and therefore the relative relevance of the liquidity zone. Hot colors (e.g., Red/Yellow) represent fresh clusters that have just formed, suggesting strong and immediate liquidity interest. Cold colors (e.g., Blue/Purple) represent aged or decaying clusters that are becoming less relevant over time. This visualization allows traders to anticipate potential liquidity sweeps (stop hunts) and understand areas of significant retail and institutional positioning.
๐ข Key Features
1. Liquidity Zone Heatmap
The core function is the identification of swing high and swing low price points using a user-defined Lookback period. These points are where retail traders are statistically most likely to place their stop-loss orders. The indicator simulates the clustering of these orders by drawing a zone (box) around the detected swing point, with the vertical size controlled by the Stop/Liquidation Zone Width (%) setting.
โถ Cluster Lookback: Defines the sensitivity of swing point detection. Lower values detect frequent, minor zones (scalping/intraday); higher values detect major, stronger swing points (swing trading).
โถ Zone Width (%): Sets the percentage range above and below the swing point where stops are simulated to cluster, accounting for slippage and typical stop placement spread.
โถ Liquidity Decay: Zones gradually fade in color intensity and are eventually removed after the user-defined Liquidity Decay Period (Bars), ensuring the heatmap only displays relevant, current liquidity areas.
โถ Round Number Filter: An optional filter that limits the display to liquidity zones occurring only at psychologically significant round numbers (e.g., $100, $1,500.00), which typically attract higher concentrations of orders.
2. Thermal Color Gradient
The heatmap's color is a direct function of the zone's age, providing a visual proxy for immediate relevance.
โถ Freshness: Newly created zones are displayed in the Hot Color (high relevance).
โถ Decay: As bars pass, the zone color transitions along the gradient toward the Cold Color and increased transparency (lower relevance), until it is removed entirely.
โถ Color Schemes: Multiple pre-configured and custom color schemes are available to optimize the visualization for different chart themes and color preferences.
3. Liquidity Heat Thermometer
An optional visual thermometer is displayed on the chart to provide an instant, overall assessment of the current liquidation heat level in the immediate vicinity of the price.
โถ Calculation: The thermometer calculates an aggregate heat score based on the age and proximity of all liquidity zones within a user-defined Zone Detection Range (%) of the current price.
โถ Visual Feedback: A marker (triangle) points to the corresponding level on the thermometer's color gradient (Hot to Cold). A high reading indicates price is close to fresh, dense stop clusters, suggesting high volatility or an imminent liquidity sweep is probable. A low reading indicates price is in a low-density or aged liquidity area.
โถ Customization: The thermometer's resolution, position, and text size are fully customizable for optimal chart placement and readability.
๐ข Practical Applications
โถ Anticipate Sweeps: Prioritize trading in the direction of Hot (fresh) liquidity zones. For example, a hot low-side zone suggests strong sell-side liquidity (stop-losses) is available for large buyers to sweep.
โถ Filter Noise: Use the Round Number Filter to focus only on the highest probability liquidation zones, which are often at clean, psychological price levels.
โถ Validate Entries: Combine the Heat Thermometer with price action analysis. A rising heat level indicates increasing proximity to a major stop cluster, signaling a potential turn or an aggressive market move to sweep those stops.
โถ Risk Management: Understand that price often acts dynamically around these zones. High heat levels imply high risk/reward setups; stops should be placed strategically beyond the defined Liquidation Zone Width.
โถ Multi-Timeframe Context: Higher timeframes (e.g., Daily, 4-Hour) often reveal more significant, major liquidity zones. Use this indicator on lower timeframes (e.g., 5-min, 15-min) for execution, but prioritize zones that align with higher-timeframe structures.
Apex Edge โ HTF Overlay CandlesโTrade your 5m chart with the eyes of the 1H โ Apex Edge brings higher-timeframe structure and liquidity sweeps directly onto your execution chart.โ
Apex Edge โ HTF Overlay Candles
The Apex Edge โ HTF Overlay Candles indicator overlays higher-timeframe (HTF) candles directly onto your lower-timeframe chart. Instead of flipping between timeframes, you see HTF structure โbreatheโ live on your execution chart.
What It Does
โข HTF Body Boxes โ open/close zones drawn as semi-transparent rectangles.
โข HTF Wick Boxes โ high/low extremes projected as envelopes around each body.
โข Midpoint Line โ a dynamic equilibrium line that flips bias as price trades above or below.
โข Sweep Arrows โ one-time markers showing the first liquidity raid at HTF highs or lows.
Under the Hood
This isnโt just a visual overlay โ itโs engineered for accuracy and performance in PineScript.
1. HTF Data Retrieval
โข Uses request.security() to import open, high, low, close, time from any selected HTF.
โข lookahead=barmerge.lookahead_off ensures OHLC values update bar by bar as the HTF
candle builds.
โข When the HTF bar closes, boxes and midpoint lock to historical values โ matching the
native HTF chart exactly.
2. Box Construction
โข Body box: built from HTF open โ close.
โข Wick box: built from HTF high โ low.
โข Boxes extend dynamically across each HTF period, updating in real time, then freeze at
close.
3. Midpoint Logic
โข (htfOpen + htfClose) / 2 calculates intrabar midpoint.
โข Line drawn edge-to-edge across the active HTF body.
โข Style, width, color, and opacity are user-controlled.
4. Sweep Detection
โข Flags (sweepedHigh / sweepedLow) prevent clutter: only the first tap per side per HTF
candle is marked.
โข Lower-timeframe price breaking the HTF high/low triggers the sweep arrow.
โข Arrows are offset above/below wick envelopes for clean visuals.
5. Customisation
โข Every layer (body, wick, midpoint, arrows) has independent color + opacity settings.
โข Arrow size, arrow color, and transparency are adjustable.
โข Default HTF = 1H (perfect for 5m/15m traders) but can be switched to 30m, 4H, Daily,
etc.
Why Itโs Useful
โข HTF intent + LTF execution without chart hopping.
โข Liquidity mapping: see where liquidity is swept in real time.
โข Bias clarity: midpoint line defines HTF equilibrium.
โข Clean signals: only the first sweep prints โ no spam.
What Makes It Different
Most MTF overlays just plot candles or single lines. This tool:
โข Splits body vs wick zones for institutional precision.
โข Updates live intrabar (no repainting).
โข Highlights liquidity sweeps clearly.
โข Built for readability and professional use โ not another retail signal toy.
Cheat-Sheet Playbook
1๏ธโฃ Structure Bias
โข Above midpoint line = bullish intent.
โข Below midpoint line = bearish intent.
โข Chop around midpoint = no clear direction.
2๏ธโฃ Liquidity Sweeps
โข โฒ Green up arrow below wick box = sell-side liquidity taken โ watch for longs.
โข โผ Red down arrow above wick box = buy-side liquidity taken โ watch for shorts.
โข First sweep is the cleanest.
3๏ธโฃ Trade Logic
โข Body box = where institutions transact.
โข Wick box = liquidity traps.
โข Midpoint = bias filter.
โข Best setups occur when sweep + midpoint flip align.
4๏ธโฃ Example (5m + 1H Overlay)
1. โฒ Green up arrow prints below HTF wick.
2. Price reclaims the body box.
3. Midpoint flips to support.
4. Enter long โ stop below sweep โ targets = midpoint first, opposite wick second.
In short:
โข Boxes = structure
โข Wicks = liquidity pools
โข Midpoint = bias line
โข Arrows = liquidity sweeps
This is your SMC edge on one chart โ HTF structure and liquidity fused directly into your execution timeframe.
ICT Concepts [Kodexius]ICT Concepts is an all in one, chart overlay toolkit that combines several widely used ICT style components into a single, modular workflow. It is designed to help you map higher timeframe context, track directional structure, and refine execution areas with imbalance and liquidity concepts, without turning the chart into a cluttered drawing board.
Instead of plotting everything indefinitely, each module focuses on โlive relevanceโ and chart readability. Zones, lines, and labels are managed with sensible limits so the most recent and most meaningful structures remain visible while older objects are automatically retired.
Because the system is modular, you can run it like a complete toolkit:
- Use multi timeframe Order Blocks to define high probability zones
- Use Market Structure (BOS and MSS) for bias and context
- Validate intent with SMT Divergence when you want intermarket confirmation
- Refine with Imbalances (FVG, BPR, CE) and Liquidity Sweeps
- Add timing structure via Killzones and risk structure via auto Fibonacci
๐น Features
๐ธ Multi Timeframe Order Blocks (3 candle displacement OB)
The OB engine detects a strict 3 candle displacement sequence (bull and bear) and projects the โorder block candleโ as a forward extending zone. Detection can run on the chart timeframe or on a user selected higher timeframe and then be displayed on your execution chart.
๐ธ Overlap Control
Before adding a new OB, the script checks overlap against existing zones of the same direction. If a new zone intersects an existing one, it is ignored to reduce redundant stacking in the same price area.
๐ธ Automatic Extension and Mitigation for Order Blocks
OB zones extend forward on every bar and are removed once mitigation is confirmed. Mitigation is evaluated by close breaking decisively beyond the relevant boundary:
- Bullish OB mitigates when close prints below the OB bottom
- Bearish OB mitigates when close prints above the OB top
๐ธ Market Structure (BOS and MSS)
Market Structure is built from swing pivots using a configurable pivot length. When price closes through the latest swing, the script prints a structure event:
BOS (Break of Structure) for continuation
MSS (Market Structure Shift) for a directional change
To keep the chart readable, older structure drawings are capped by history limits.
๐ธ SMT Divergence with optional mini panel
SMT can compare the current instrument with a user selected symbol to highlight divergence at swing points. A divergence is flagged when one market makes a new swing extreme while the other fails to confirm.
Optional: a compact right side โcompare symbolโ candle panel can be enabled so you can visually confirm what the secondary market is doing without leaving the chart.
๐ธ Imbalances: FVG, BPR, and CE modes
You can choose between three imbalance views depending on your style:
FVG mode: Fair Value Gaps are plotted as extending zones
CE mode: Consequent Encroachment is visualized using a midpoint line and a half zone fill
BPR mode: Balanced Price Range is formed when a new FVG overlaps an opposing FVG, producing a โbalancedโ region that often behaves differently than a standalone gap
๐ธ Automatic extension, limits, and mitigation for imbalances
Imbalance objects extend forward until mitigated. Mitigation uses wick based logic:
Bullish imbalance mitigates when price wicks below the zone bottom
Bearish imbalance mitigates when price wicks above the zone top
The script also enforces per side limits and removes older items to keep performance stable.
๐ธ Liquidity sweeps (buyside and sellside)
The liquidity module tracks swing highs and lows and marks sweep events when price runs the level and then closes back through it, which often behaves like a rejection signal. Sweeps are visualized with a level line plus a small sweep highlight box, with an optional history cap.
๐ธ Auto anchored Fibonacci (EQ and OTE focus)
Fibonacci levels are automatically anchored using the most recent structure context so you do not need to manually re draw fibs every time the market evolves. EQ and OTE focused bands are plotted to support common premium discount style workflows, with optional extra levels if desired.
๐ธ Killzones (session boxes with optional range tracking)
Asian, London Open, New York AM, and New York PM killzones can be displayed using UTC-5 session definitions. Session boxes dynamically expand as new highs and lows are formed during the session, and historical zones can be retained up to a user set count. Rendering is restricted to intraday timeframes up to 60 minutes for clean scaling and performance.
๐น Calculations
1) Order Block detection (3 candle displacement)
The OB pattern is defined inside detectLogic() . The zone boundaries always come from candle (the middle candle of the 3 candle sequence).
detectLogic() =>
bool isBull = open > close and close > open and close > open and low < low and close > high
bool isBear = open < close and close < open and close < open and high > high and close < low
[isBull, high , low , time , isBear, high , low , time ]
Interpretation (bullish side):
Candle is bearish
Candle is bullish (the OB candle)
Current candle is bullish and closes above high
low undercuts low to form the sweep style condition
Bearish logic is the mirrored inverse.
2) Multi timeframe projection and duplicate control
If the timeframe input is set, detections are computed on that timeframe and projected onto the current chart using request.security . A last processed time check prevents duplicate prints.
=
request.security(syminfo.tickerid, i_tf, detectLogic())
var int lastBullTime = 0
var int lastBearTime = 0
if mtf_isBull and mtf_bullTime != lastBullTime
lastBullTime := mtf_bullTime
if mtf_isBear and mtf_bearTime != lastBearTime
lastBearTime := mtf_bearTime
3) OB overlap validation and mitigation
Overlap is checked before pushing a new zone, then zones are extended and removed once mitigated by close.
method hasOverlap(array OBs, float top, float bottom) =>
bool overlap = false
if OBs.size() > 0
for i = 0 to OBs.size() - 1
OB item = OBs.get(i)
if (top < item.top and top > item.bottom) or (bottom > item.bottom and bottom < item.top)
overlap := true
break
overlap
method isMitigated(OB this, float currentClose) =>
this.isBull ? (currentClose < this.bottom) : (currentClose > this.top)
4) Market Structure: pivots, BOS, and MSS
Swings are derived from pivots; then BOS/MSS prints when price crosses the latest swing. The script tracks trend state to decide whether the break is continuation (BOS) or shift (MSS).
float ph = ta.pivothigh(i_structLen, i_structLen)
float pl = ta.pivotlow(i_structLen, i_structLen)
bool brokenHigh = ta.crossover(close, lastHigh)
bool brokenLow = ta.crossunder(close, lastLow)
// drawStructure(..., "BOS", ...) or drawStructure(..., "MSS", ...) depending on trend state
5) SMT Divergence conditions
SMT uses pivot highs/lows on both instruments. A bearish SMT prints when the main chart makes a higher high but the compare symbol fails to exceed its prior high. A bullish SMT prints when the main chart makes a lower low but the compare symbol fails to make a lower low.
bool bearishSmt = not na(smtAHighPrev) and not na(smtBHighPrev) and (smtAHighLast > smtAHighPrev) and (smtBHighLast <= smtBHighPrev)
bool bullishSmt = not na(smtALowPrev) and not na(smtBLowPrev) and (smtALowLast < smtALowPrev) and (smtBLowLast >= smtBLowPrev)
6) FVG detection, BPR construction, and CE level
FVGs are detected via a classic 3 bar gap condition. When a new FVG overlaps an opposing FVG, the script builds a BPR using the intersecting region. CE is the midpoint (top + bottom) / 2, plotted as a dashed line plus a half fill box.
bool fvgBullDetected = low > high
bool fvgBearDetected = high < low
// CE
float ceLevel = (this.top + this.bottom) / 2
Imbalance mitigation uses wick logic:
method isMitigated(FVG this, float currentHigh, float currentLow) =>
this.isBull ? (currentLow < this.bottom) : (currentHigh > this.top)
7) Liquidity sweep trigger
A sweep is confirmed only when price runs the pivot level and closes back through it (reject style).
bool sweepBull = i_showLiq and not na(liqLastLow) and not liqLastLowSwept and low < liqLastLow and close > liqLastLow
bool sweepBear = i_showLiq and not na(liqLastHigh) and not liqLastHighSwept and high > liqLastHigh and close < liqLastHigh
8) Killzone session mapping
Sessions are defined in UTC-5 using time() session strings.
string kzTz = "UTC-5"
kzInSession(string sess) =>
not na(time(timeframe.period, sess, kzTz))
bool inAsian = kzInSession("2000-0000")
bool inLondon = kzInSession("0200-0500")
bool inNY = kzInSession("0830-1100")
TJR SEEK AND DESTROYTJR SEEK AND DESTROY โ Intraday ICT Trading Tool
Built for day traders, TJR SEEK AND DESTROY combines Smart Money concepts like order blocks, fair value gaps, and liquidity sweeps with structure breaks and daily bias to pinpoint high-probability trades during US market hours (9:30โ16:00). Ideal for scalping or intraday strategies on stocks, futures, or forex.
What Makes It Unique?
Unlike standalone ICT indicators, this script integrates:
Order Blocks with volume and range filters for precise support/resistance zones.
Fair Value Gaps (FVG) to spot pre-market price imbalances.
Break of Structure (BOS) and Liquidity Sweeps for trend and reversal signals.
A 1H MA-based Bias to align trades with the dayโs direction.
BUY/SELL Labels triggered only when bias, BOS, and sweeps align, reducing noise.
How Does It Work?
Order Blocks: Marks zones with high volume (>1.5x 20-period SMA) and low range (<0.5x ATR20) as teal boxesโpotential reversal points.
Fair Value Gap: Compares the prior dayโs close to the current open (pre- or post-9:30), shown as a purple line and label (e.g., "FVG: 0.005").
Pivot Point: Calculates (prevHigh + prevLow + prevClose) / 3 from the prior day, plotted as an orange line for equilibrium.
Break of Structure: Detects crossovers of 5-bar highs/lows (gray lines), marked with red triangles.
Liquidity Sweeps: Tracks breaches of the prior dayโs high/low (yellow lines), marked with yellow triangles.
Daily Bias: Uses 1H close vs. 20-period MA (blue line) for bullish (green background), bearish (red), or neutral (gray) context.
Signals: BUY (green label) when bias is bullish, price breaks up, and sweeps the prior high; SELL (red label) when bias is bearish, price breaks down, and sweeps the prior low.
How to Use It
Setup: Apply to 1Mโ15M charts for US session trading (9:30โ16:00 EST).
Trading:
Wait for a BUY label after a yellow sweep triangle above the prior dayโs high in a green (bullish) background.
Wait for a SELL label after a yellow sweep triangle below the prior dayโs low in a red (bearish) background.
Use order blocks (teal boxes) as support/resistance for stop-loss or take-profit.
Markets: Best for SPY, ES futures, or forex pairs with US session volatility.
Underlying Concepts
Order Blocks: High-volume, low-range bars suggest institutional activity.
FVG: Gaps between close and open indicate imbalance to be filled.
BOS & Sweeps: Price breaking key levels signals momentum or stop-hunting.
Bias: 1H MA filters trades by broader trend.
Chart Setup
Displays order blocks (teal boxes), pivot (orange), open (purple), bias (colored background), BOS/sweeps (triangles), and signals (labels). Keep other indicators off for clarity.
ES Multi-Timeframe SMC Entry SystemOverviewThis is a comprehensive Smart Money Concepts (SMC) trading strategy for ES1! (E-mini S&P 500) futures that provides simultaneous buy and sell signals across three timeframes: Daily, Weekly, and Monthly. It incorporates your complete entry checklists, confluence scoring system, and automated risk management.Core Features1. Multi-Timeframe Signal Generation
Daily Signals (D) - For intraday/swing trades (1-3 day holds)
Weekly Signals (W) - For swing trades (3-10 day holds)
Monthly Signals (M) - For position trades (weeks to months)
All three timeframes can trigger simultaneously (pyramiding enabled)
2. Smart Money Concepts ImplementationOrder Blocks (OB)
Automatically detects bullish and bearish order blocks
Bullish OB = Down candle before strong impulse up
Bearish OB = Up candle before strong impulse down
Validates freshness (< 10 bars = higher quality)
Visual boxes displayed on chart
Fair Value Gaps (FVG)
Identifies 3-candle imbalance patterns
Bullish FVG = Gap between high and current low
Bearish FVG = Gap between low and current high
Tracks unfilled gaps as targets/entry zones
Auto-removes when filled
Premium/Discount Zones
Calculates 50-period swing range
Premium = Upper 50% (short from here)
Discount = Lower 50% (long from here)
Deep zones (<30% or >70%) for higher quality setups
Visual shading: Red = Premium, Green = Discount
Liquidity Sweeps
Sell-Side Sweep (SSL) = False break below lows โ reversal up
Buy-Side Sweep (BSL) = False break above highs โ reversal down
Marked with yellow labels on chart
Valid for 10 bars after occurrence
Break of Structure (BOS)
Identifies when price breaks recent swing high/low
Confirms trend continuation
Marked with small circles on chart
3. Confluence Scoring SystemEach timeframe has a 10-point scoring system based on your checklist requirements:Daily Score (10 points max)
HTF Trend Alignment (2 pts) - 4H and Daily EMAs aligned
SMC Structure (2 pts) - OB in correct zone with HTF bias
Liquidity Sweep (1 pt) - Recent SSL/BSL occurred
Volume Confirmation (1 pt) - Volume > 1.2x 20-period average
Optimal Time (1 pt) - 9:30-12 PM or 2-4 PM ET (avoids lunch)
Risk-Reward >2:1 (1 pt) - Built into exit strategy
Clean Price Action (1 pt) - BOS occurred
FVG Present (1 pt) - Near unfilled fair value gap
Minimum Required: 6/10 (adjustable)Weekly Score (10 points max)
Weekly/Monthly Alignment (2 pts) - W and M EMAs aligned
Daily/Weekly Alignment (2 pts) - D and W trends match
Premium/Discount Correct (2 pts) - Deep zone + trend alignment
Major Liquidity Event (1 pt) - SSL/BSL sweep
Order Block Present (1 pt) - Valid OB detected
Risk-Reward >3:1 (1 pt) - Built into exit
Fresh Order Block (1 pt) - OB < 10 bars old
Minimum Required: 7/10 (adjustable)Monthly Score (10 points max)
Monthly/Weekly Alignment (2 pts) - M and W trends match
Weekly OB in Monthly Zone (2 pts) - OB in deep discount/premium
Major Liquidity Sweep (2 pts) - Significant SSL/BSL
Strong Trend Alignment (2 pts) - D, W, M all aligned
Risk-Reward >4:1 (1 pt) - Built into exit
Extreme Zone (1 pt) - Price <20% or >80% of range
Minimum Required: 8/10 (adjustable)4. Entry ConditionsDaily Long Entry
โ
Daily score โฅ 6/10
โ
4H trend bullish (price > EMAs)
โ
Price in discount zone
โ
Bullish OB OR SSL sweep OR near bullish FVG
โ
NOT during avoid times (lunch/first 5 min)Daily Short Entry
โ
Daily score โฅ 6/10
โ
4H trend bearish
โ
Price in premium zone
โ
Bearish OB OR BSL sweep OR near bearish FVG
โ
NOT during avoid timesWeekly Long Entry
โ
Weekly score โฅ 7/10
โ
Weekly trend bullish
โ
Daily trend bullish
โ
Price in discount
โ
Bullish OB OR SSL sweepWeekly Short Entry
โ
Weekly score โฅ 7/10
โ
Weekly trend bearish
โ
Daily trend bearish
โ
Price in premium
โ
Bearish OB OR BSL sweepMonthly Long Entry
โ
Monthly score โฅ 8/10
โ
Monthly trend bullish
โ
Weekly trend bullish
โ
Price in DEEP discount (<30%)
โ
Bullish order block presentMonthly Short Entry
โ
Monthly score โฅ 8/10
โ
Monthly trend bearish
โ
Weekly trend bearish
โ
Price in DEEP premium (>70%)
โ
Bearish order block present5. Automated Risk ManagementPosition Sizing (Per Entry)
Daily: 1.0% account risk per trade
Weekly: 0.75% account risk per trade
Monthly: 0.5% account risk per trade
Formula:
Contracts = (Account Equity ร Risk%) รท (Stop Points ร $50)
Minimum = 1 contractStop Losses
Daily: 12 points ($600 per contract)
Weekly: 40 points ($2,000 per contract)
Monthly: 100 points ($5,000 per contract)
Profit Targets (Risk:Reward)
Daily: 2:1 = 24 points ($1,200 profit)
Weekly: 3:1 = 120 points ($6,000 profit)
Monthly: 4:1 = 400 points ($20,000 profit)
Example with $50,000 AccountDaily Trade:
Risk = $500 (1% of $50k)
Stop = 12 points ร $50 = $600
Contracts = $500 รท $600 = 0.83 โ 1 contract
Target = 24 points = $1,200 profit
Weekly Trade:
Risk = $375 (0.75% of $50k)
Stop = 40 points ร $50 = $2,000
Contracts = $375 รท $2,000 = 0.18 โ 1 contract
Target = 120 points = $6,000 profit
Monthly Trade:
Risk = $250 (0.5% of $50k)
Stop = 100 points ร $50 = $5,000
Contracts = $250 รท $5,000 = 0.05 โ 1 contract
Target = 400 points = $20,000 profit
6. Visual Elements on ChartKey Levels
Previous Daily High/Low - Red/Green solid lines
Previous Weekly High/Low - Red/Green circles
Previous Monthly High/Low - Red/Green crosses
Equilibrium Line - White dotted line (50% of range)
Zones
Premium Zone - Light red shading (upper 50%)
Discount Zone - Light green shading (lower 50%)
SMC Markings
Bullish Order Blocks - Green boxes with "Bull OB" label
Bearish Order Blocks - Red boxes with "Bear OB" label
Bullish FVGs - Green boxes with "FVGโ"
Bearish FVGs - Red boxes with "FVGโ"
Liquidity Sweeps - Yellow "SSL" (down) or "BSL" (up) labels
Break of Structure - Small lime/red circles
Entry Signals
Daily Long - Small lime triangle โฒ with "D" below price
Daily Short - Small red triangle โผ with "D" above price
Weekly Long - Medium green triangle โฒ with "W" below price
Weekly Short - Medium maroon triangle โผ with "W" above price
Monthly Long - Large aqua triangle โฒ with "M" below price
Monthly Short - Large fuchsia triangle โผ with "M" above price
7. Information TablesConfluence Score Table (Top Right)
โโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
โ TF โ SCORE โ STATUS โ SIGNAL โ
โโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
โ ๐ DAILY โ 7/10 โ โ PASS โ ๐ผ โ
โ ๐ WEEKLYโ 6/10 โ โ WAIT โ โ โ
โ ๐ MONTH โ 9/10 โ โ PASS โ ๐ฝ โ
โโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโค
โ P&L: $2,450 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Green scores = Pass (meets minimum threshold)
Orange/Red scores = Fail (wait for better setup)
๐ผ = Long signal active
๐ฝ = Short signal active
โ = No signal
Entry Checklist Table (Bottom Right)
โโโโโโโโโโโโโโโโฌโโโโ
โ CHECKLIST โ โ โ
โโโโโโโโโโโโโโโโผโโโโค
โ โ DAILY โ โ โ
โ HTF Trend โ โ โ
โ Zone โ โ โ
โ OB โ โ โ
โ Liq Sweep โ โ โ
โ Volume โ โ โ
โ โ WEEKLY โ โ โ
โ W/M Align โ โ โ
โ Deep Zone โ โ โ
โ โ MONTHLY โ โ โ
โ M/W/D Align โ โ โ
โ Zone: Discountโ โ
โโโโโโโโโโโโโโโโดโโโโ
Green โ = Condition met
Red โ = Condition not met
Real-time updates as market conditions change
8. Alert SystemIndividual Alerts:
"Daily Long" - Triggers when daily long setup appears
"Daily Short" - Triggers when daily short setup appears
"Weekly Long" - Triggers when weekly long setup appears
"Weekly Short" - Triggers when weekly short setup appears
"Monthly Long" - Triggers when monthly long setup appears
"Monthly Short" - Triggers when monthly short setup appears
Combined Alerts:
"Any Long Signal" - Catches any bullish opportunity (D/W/M)
"Any Short Signal" - Catches any bearish opportunity (D/W/M)
Alert Messages Include:
๐ผ/๐ฝ Direction indicator
Timeframe (DAILY/WEEKLY/MONTHLY)
Current confluence score
ATAI Volume analysis with price action V 1.00ATAI Volume Analysis with Price Action
1. Introduction
1.1 Overview
ATAI Volume Analysis with Price Action is a composite indicator designed for TradingView. It combines perโside volume data โthat is, how much buying and selling occurs during each barโwith standard priceโstructure elements such as swings, trend lines and support/resistance. By blending these elements the script aims to help a trader understand which side is in control, whether a breakout is genuine, when markets are potentially exhausted and where liquidity providers might be active.
The indicator is built around TradingViewโs up/down volume feed accessed via the TradingView/ta/10 library. The following excerpt from the script illustrates how this feed is configured:
import TradingView/ta/10 as tvta
// Determine lower timeframe string based on user choice and chart resolution
string lower_tf_breakout = use_custom_tf_input ? custom_tf_input :
timeframe.isseconds ? "1S" :
timeframe.isintraday ? "1" :
timeframe.isdaily ? "5" : "60"
// Request up/down volume (both positive)
= tvta.requestUpAndDownVolume(lower_tf_breakout)
Lowerโtimeframe selection. If you do not specify a custom lower timeframe, the script chooses a default based on your chart resolution: 1โฏsecond for second charts, 1โฏminute for intraday charts, 5โฏminutes for daily charts and 60โฏminutes for anything longer. Smaller intervals provide a more precise view of buyer and seller flow but cover fewer bars. Larger intervals cover more history at the cost of granularity.
Tick vs. time bars. Many trading platforms offer a tick / intrabar calculation mode that updates an indicator on every trade rather than only on bar close. Turning on oneโtick calculation will give the most accurate split between buy and sell volume on the current bar, but it typically reduces the amount of historical data available. For the highest fidelity in live trading you can enable this mode; for studying longer histories you might prefer to disable it. When volume data is completely unavailable (some instruments and crypto pairs), all modules that rely on it will remain silent and only the priceโstructure backbone will operate.
Figure caption, Each panel shows the indicatorโs info table for a different volume sampling interval. In the left chart, the parentheses โ(5)โ beside the buyโvolume figure denote that the script is aggregating volume over fiveโminute bars; the center chart uses โ(1)โ for oneโminute bars; and the right chart uses โ(1T)โ for a oneโtick interval. These notations tell you which lower timeframe is driving the volume calculations. Shorter intervals such as 1โฏminute or 1โฏtick provide finer detail on buyer and seller flow, but they cover fewer bars; longer intervals like fiveโminute bars smooth the data and give more history.
Figure caption, The values in parentheses inside the info table come directly from the Breakout โ Settings. The first row shows the custom lower-timeframe used for volume calculations (e.g., โ(1)โ, โ(5)โ, or โ(1T)โ)
2. PriceโStructure Backbone
Even without volume, the indicator draws structural features that underpin all other modules. These features are always on and serve as the reference levels for subsequent calculations.
2.1 What it draws
โข Pivots: Swing highs and lows are detected using the pivot_left_input and pivot_right_input settings. A pivot high is identified when the high recorded pivot_right_input bars ago exceeds the highs of the preceding pivot_left_input bars and is also higher than (or equal to) the highs of the subsequent pivot_right_input bars; pivot lows follow the inverse logic. The indicator retains only a fixed number of such pivot points per side, as defined by point_count_input, discarding the oldest ones when the limit is exceeded.
โข Trend lines: For each side, the indicator connects the earliest stored pivot and the most recent pivot (oldest high to newest high, and oldest low to newest low). When a new pivot is added or an old one drops out of the lookback window, the lineโs endpointsโand therefore its slopeโare recalculated accordingly.
โข Horizontal support/resistance: The highest high and lowest low within the lookback window defined by length_input are plotted as horizontal dashed lines. These serve as shortโterm support and resistance levels.
โข Ranked labels: If showPivotLabels is enabled the indicator prints labels such as โHH1โ, โHH2โ, โLL1โ and โLL2โ near each pivot. The ranking is determined by comparing the price of each stored pivot: HH1 is the highest high, HH2 is the second highest, and so on; LL1 is the lowest low, LL2 is the second lowest. In the case of equal prices the newer pivot gets the better rank. Labels are offset from price using ยฝโฏรโฏATR ร label_atr_multiplier, with the ATR length defined by label_atr_len_input. A dotted connector links each label to the candleโs wick.
2.2 Key settings
โข length_input: Window length for finding the highest and lowest values and for determining trend line endpoints. A larger value considers more history and will generate longer trend lines and S/R levels.
โข pivot_left_input, pivot_right_input: Strictness of swing confirmation. Higher values require more bars on either side to form a pivot; lower values create more pivots but may include minor swings.
โข point_count_input: How many pivots are kept in memory on each side. When new pivots exceed this number the oldest ones are discarded.
โข label_atr_len_input and label_atr_multiplier: Determine how far pivot labels are offset from the bar using ATR. Increasing the multiplier moves labels further away from price.
โข Styling inputs for trend lines, horizontal lines and labels (color, width and line style).
Figure caption, The chart illustrates how the indicatorโs priceโstructure backbone operates. In this daily example, the script scans for bars where the high (or low) pivot_right_input bars back is higher (or lower) than the preceding pivot_left_input bars and higher or lower than the subsequent pivot_right_input bars; only those bars are marked as pivots.
These pivot points are stored and ranked: the highest high is labelled โHH1โ, the secondโhighest โHH2โ, and so on, while lows are marked โLL1โ, โLL2โ, etc. Each label is offset from the price by half of an ATRโbased distance to keep the chart clear, and a dotted connector links the label to the actual candle.
The red diagonal line connects the earliest and latest stored high pivots, and the green line does the same for low pivots; when a new pivot is added or an old one drops out of the lookback window, the endโpoints and slopes adjust accordingly. Dashed horizontal lines mark the highest high and lowest low within the current lookback window, providing visual support and resistance levels. Together, these elements form the structural backbone that other modules reference, even when volume data is unavailable.
3. Breakout Module
3.1 Concept
This module confirms that a price break beyond a recent high or low is supported by a genuine shift in buying or selling pressure. It requires price to clear the highest high (โHH1โ) or lowest low (โLL1โ) and, simultaneously, that the winning side shows a significant volume spike, dominance and ranking. Only when all volume and price conditions pass is a breakout labelled.
3.2 Inputs
โข lookback_break_input : This controls the number of bars used to compute moving averages and percentiles for volume. A larger value smooths the averages and percentiles but makes the indicator respond more slowly.
โข vol_mult_input : The โspikeโ multiplier; the current buy or sell volume must be at least this multiple of its moving average over the lookback window to qualify as a breakout.
โข rank_threshold_input (0โ100) : Defines a volume percentile cutoff: the current buyer/seller volume must be in the top (100โthreshold)%(100โthreshold)% of all volumes within the lookback window. For example, if set to 80, the current volume must be in the top 20โฏ% of the lookback distribution.
โข ratio_threshold_input (0โ1) : Specifies the minimum share of total volume that the buyer (for a bullish breakout) or seller (for bearish) must hold on the current bar; the code also requires that the cumulative buyer volume over the lookback window exceeds the seller volume (and vice versa for bearish cases).
โข use_custom_tf_input / custom_tf_input : When enabled, these inputs override the automatic choice of lower timeframe for up/down volume; otherwise the script selects a sensible default based on the chartโs timeframe.
โข Label appearance settings : Separate options control the ATR-based offset length, offset multiplier, label size and colors for bullish and bearish breakout labels, as well as the connector style and width.
3.3 Detection logic
1. Data preparation : Retrieve perโside volume from the lower timeframe and take absolute values. Build rolling arrays of the last lookback_break_input values to compute simple moving averages (SMAs), cumulative sums and percentile ranks for buy and sell volume.
2. Volume spike: A spike is flagged when the current buy (or, in the bearish case, sell) volume is at least vol_mult_input times its SMA over the lookback window.
3. Dominance test: The buyerโs (or sellerโs) share of total volume on the current bar must meet or exceed ratio_threshold_input. In addition, the cumulative sum of buyer volume over the window must exceed the cumulative sum of seller volume for a bullish breakout (and vice versa for bearish). A separate requirement checks the sign of delta: for bullish breakouts delta_breakout must be nonโnegative; for bearish breakouts it must be nonโpositive.
4. Percentile rank: The current volume must fall within the top (100 โ rank_threshold_input) percent of the lookback distributionโensuring that the spike is unusually large relative to recent history.
5. Price test: For a bullish signal, the closing price must close above the highest pivot (HH1); for a bearish signal, the close must be below the lowest pivot (LL1).
6. Labeling: When all conditions above are satisfied, the indicator prints โBreakoutโฏโโ above the bar (bullish) or โBreakoutโฏโโ below the bar (bearish). Labels are offset using half of an ATRโbased distance and linked to the candle with a dotted connector.
Figure caption, (Breakout โ example) , On this daily chart, price pushes above the red trendline and the highest prior pivot (HH1). The indicator recognizes this as a valid breakout because the buyerโside volume on the lower timeframe spikes above its recent moving average and buyers dominate the volume statistics over the lookback period; when combined with a close above HH1, this satisfies the breakout conditions. The โBreakoutโฏโโ label appears above the candle, and the info table highlights that upโvolume is elevated relative to its 11โbar average, buyer share exceeds the dominance threshold and moneyโflow metrics support the move.
Figure caption, In this daily example, price breaks below the lowest pivot (LL1) and the lower green trendline. The indicator identifies this as a bearish breakout because sellโside volume is sharply elevatedโabout twice its 11โbar averageโand sellers dominate both the bar and the lookback window. With the close falling below LL1, the script triggers a Breakout โ label and marks the corresponding row in the info table, which shows strong down volume, negative delta and a seller share comfortably above the dominance threshold.
4. Market Phase Module (Volume Only)
4.1 Concept
Not all markets trend; many cycle between periods of accumulation (buying pressure building up), distribution (selling pressure dominating) and neutral behavior. This module classifies the current bar into one of these phases without using ATR , relying solely on buyer and seller volume statistics. It looks at net flows, ratio changes and an OBVโlike cumulative line with dualโreference (1โ and 2โbar) trends. The result is displayed both as onโchart labels and in a dedicated row of the info table.
4.2 Inputs
โข phase_period_len: Number of bars over which to compute sums and ratios for phase detection.
โข phase_ratio_thresh : Minimum buyer share (for accumulation) or minimum seller share (for distribution, derived as 1 โ phase_ratio_thresh) of the total volume.
โข strict_mode: When enabled, both the 1โbar and 2โbar changes in each statistic must agree on the direction (strict confirmation); when disabled, only one of the two references needs to agree (looser confirmation).
โข Color customisation for info table cells and label styling for accumulation and distribution phases, including ATR length, multiplier, label size, colors and connector styles.
โข show_phase_module: Toggles the entire phase detection subsystem.
โข show_phase_labels: Controls whether onโchart labels are drawn when accumulation or distribution is detected.
4.3 Detection logic
The module computes three families of statistics over the volume window defined by phase_period_len:
1. Net sum (buyers minus sellers): net_sum_phase = ฮฃ(buy) โ ฮฃ(sell). A positive value indicates a predominance of buyers. The code also computes the differences between the current value and the values 1 and 2 bars ago (d_net_1, d_net_2) to derive up/down trends.
2. Buyer ratio: The instantaneous ratio TF_buy_breakout / TF_tot_breakout and the window ratio ฮฃ(buy) / ฮฃ(total). The current ratio must exceed phase_ratio_thresh for accumulation or fall below 1 โ phase_ratio_thresh for distribution. The first and second differences of the window ratio (d_ratio_1, d_ratio_2) determine trend direction.
3. OBVโlike cumulative net flow: An onโbalance volume analogue obv_net_phase increments by TF_buy_breakout โ TF_sell_breakout each bar. Its differences over the last 1 and 2 bars (d_obv_1, d_obv_2) provide trend clues.
The algorithm then combines these signals:
โข For strict mode , accumulation requires: (a) current ratio โฅ threshold, (b) cumulative ratio โฅ threshold, (c) both ratio differences โฅ 0, (d) net sum differences โฅ 0, and (e) OBV differences โฅ 0. Distribution is the mirror case.
โข For loose mode , it relaxes the directional tests: either the 1โ or the 2โbar difference needs to agree in each category.
If all conditions for accumulation are satisfied, the phase is labelled โAccumulationโ ; if all conditions for distribution are satisfied, itโs labelled โDistributionโ ; otherwise the phase is โNeutralโ .
4.4 Outputs
โข Info table row : Row 8 displays โMarket Phase (Vol)โ on the left and the detected phase (Accumulation, Distribution or Neutral) on the right. The text colour of both cells matches a userโselectable palette (typically green for accumulation, red for distribution and grey for neutral).
โข Onโchart labels : When show_phase_labels is enabled and a phase persists for at least one bar, the module prints a label above the bar ( โAccumโ ) or below the bar ( โDistโ ) with a dashed or dotted connector. The label is offset using ATR based on phase_label_atr_len_input and phase_label_multiplier and is styled according to user preferences.
Figure caption, The chart displays a red โDistโ label above a particular bar, indicating that the accumulation/distribution module identified a distribution phase at that point. The detection is based on seller dominance: during that bar, the net buyer-minus-seller flow and the OBVโstyle cumulative flow were trending down, and the buyer ratio had dropped below the preset threshold. These conditions satisfy the distribution criteria in strict mode. The label is placed above the bar using an ATRโbased offset and a dashed connector. By the time of the current bar in the screenshot, the phase indicator shows โNeutralโ in the info tableโsignaling that neither accumulation nor distribution conditions are currently metโyet the historical โDistโ label remains to mark where the prior distribution phase began.
Figure caption, In this example the market phase module has signaled an Accumulation phase. Three bars before the current candle, the algorithm detected a shift toward buyers: upโvolume exceeded its moving average, downโvolume was below average, and the buyer share of total volume climbed above the threshold while the onโbalance net flow and cumulative ratios were trending upwards. The blue โAccumโ label anchored below that bar marks the start of the phase; it remains on the chart because successive bars continue to satisfy the accumulation conditions. The info table confirms this: the โMarket Phase (Vol)โ row still reads Accumulation, and the ratio and sum rows show buyers dominating both on the current bar and across the lookback window.
5. OB/OS Spike Module
5.1 What overbought/oversold means here
In many markets, a rapid extension up or down is often followed by a period of consolidation or reversal. The indicator interprets overbought (OB) conditions as abnormally strong selling risk at or after a price rally and oversold (OS) conditions as unusually strong buying risk after a decline. Importantly, these are not direct trade signals; rather they flag areas where caution or contrarian setups may be appropriate.
5.2 Inputs
โข minHits_obos (1โ7): Minimum number of oscillators that must agree on an overbought or oversold condition for a label to print.
โข syncWin_obos: Length of a small sliding window over which oscillator votes are smoothed by taking the maximum count observed. This helps filter out choppy signals.
โข Volume spike criteria: kVolRatio_obos (ratio of current volume to its SMA) and zVolThr_obos (Zโscore threshold) across volLen_obos. Either threshold can trigger a spike.
โข Oscillator toggles and periods: Each of RSI, Stochastic (K and D), Williams %R, CCI, MFI, DeMarker and Stochastic RSI can be independently enabled; their periods are adjustable.
โข Label appearance: ATRโbased offset, size, colors for OB and OS labels, plus connector style and width.
5.3 Detection logic
1. Directional volume spikes: Volume spikes are computed separately for buyer and seller volumes. A sell volume spike (sellVolSpike) flags a potential OverBought bar, while a buy volume spike (buyVolSpike) flags a potential OverSold bar. A spike occurs when the respective volume exceeds kVolRatio_obos times its simple moving average over the window or when its Zโscore exceeds zVolThr_obos.
2. Oscillator votes: For each enabled oscillator, calculate its overbought and oversold state using standard thresholds (e.g., RSI โฅ 70 for OB and โค 30 for OS; Stochastic %K/%D โฅ 80 for OB and โค 20 for OS; etc.). Count how many oscillators vote for OB and how many vote for OS.
3. Minimum hits: Apply the smoothing window syncWin_obos to the vote counts using a maximumโofโlastโN approach. A candidate bar is only considered if the smoothed OB hit count โฅ minHits_obos (for OverBought) or the smoothed OS hit count โฅ minHits_obos (for OverSold).
4. Tieโbreaking: If both OverBought and OverSold spike conditions are present on the same bar, compare the smoothed hit counts: the side with the higher count is selected; ties default to OverBought.
5. Label printing: When conditions are met, the bar is labelled as โOverBought X/7โ above the candle or โOverSold X/7โ below it. โXโ is the number of oscillators confirming, and the bracket lists the abbreviations of contributing oscillators. Labels are offset from price using half of an ATRโscaled distance and can optionally include a dotted or dashed connector line.
Figure caption, In this chart the overbought/oversold module has flagged an OverSold signal. A sellโoff from the prior highs brought price down to the lower trendโline, where the bar marked โOverSoldโฏ3/7โฏDeMโ appears. This label indicates that on that bar the module detected a buyโside volume spike and that at least three of the seven enabled oscillatorsโin this case including the DeMarkerโwere in oversold territory. The label is printed below the candle with a dotted connector, signaling that the market may be temporarily exhausted on the downside. After this oversold print, price begins to rebound towards the upper red trendโline and higher pivot levels.
Figure caption, This example shows the overbought/oversold module in action. In the leftโhand panel you can see the OB/OS settings where each oscillator (RSI, Stochastic, Williamsย %R, CCI, MFI, DeMarker and Stochastic RSI) can be enabled or disabled, and the ATR length and label offset multiplier adjusted. On the chart itself, price has pushed up to the descending red trendline and triggered an โOverBoughtโฏ3/7โ label. That means the sellโside volume spiked relative to its average and three out of the seven enabled oscillators were in overbought territory. The label is offset above the candle by half of an ATR and connected with a dashed line, signaling that upside momentum may be overextended and a pause or pullback could follow.
6. Buyer/Seller Trap Module
6.1 Concept
A bull trap occurs when price appears to break above resistance, attracting buyers, but fails to sustain the move and quickly reverses, leaving a long upper wick and trapping late entrants. A bear trap is the opposite: price breaks below support, lures in sellers, then snaps back, leaving a long lower wick and trapping shorts. This module detects such traps by looking for price structure sweeps, orderโflow mismatches and dominance reversals. It uses a scoring system to differentiate risk from confirmed traps.
6.2 Inputs
โข trap_lookback_len: Window length used to rank extremes and detect sweeps.
โข trap_wick_threshold: Minimum proportion of a barโs range that must be wick (upper for bull traps, lower for bear traps) to qualify as a sweep.
โข trap_score_risk: Minimum aggregated score required to flag a trap risk. (The code defines a trap_score_confirm input, but confirmation is actually based on price reversal rather than a separate score threshold.)
โข trap_confirm_bars: Maximum number of bars allowed for price to reverse and confirm the trap. If price does not reverse in this window, the risk label will expire or remain unconfirmed.
โข Label settings: ATR length and multiplier for offsetting, size, colours for risk and confirmed labels, and connector style and width. Separate settings exist for bull and bear traps.
โข Toggle inputs: show_trap_module and show_trap_labels enable the module and control whether labels are drawn on the chart.
6.3 Scoring logic
The module assigns points to several conditions and sums them to determine whether a trap risk is present. For bull traps, the score is built from the following (bear traps mirror the logic with highs and lows swapped):
1. Sweep (2 points): Price trades above the high pivot (HH1) but fails to close above it and leaves a long upper wick at least trap_wick_threshold ร range. For bear traps, price dips below the low pivot (LL1), fails to close below and leaves a long lower wick.
2. Close break (1 point): Price closes beyond HH1 or LL1 without leaving a long wick.
3. Candle/delta mismatch (2 points): The candle closes bullish yet the order flow delta is negative or the seller ratio exceeds 50%, indicating hidden supply. Conversely, a bearish close with positive delta or buyer dominance suggests hidden demand.
4. Dominance inversion (2 points): The current barโs buyer volume has the highest rank in the lookback window while cumulative sums favor sellers, or vice versa.
5. Lowโvolume break (1 point): Price crosses the pivot but total volume is below its moving average.
The total score for each side is compared to trap_score_risk. If the score is high enough, a โBull Trap Riskโ or โBear Trap Riskโ label is drawn, offset from the candle by half of an ATRโscaled distance using a dashed outline. If, within trap_confirm_bars, price reverses beyond the opposite levelโdrops back below the high pivot for bull traps or rises above the low pivot for bear trapsโthe label is upgraded to a solid โBull Trapโ or โBear Trapโ . In this version of the code, there is no separate score threshold for confirmation: the variable trap_score_confirm is unused; confirmation depends solely on a successful price reversal within the specified number of bars.
Figure caption, In this example the trap module has flagged a Bear Trap Risk. Price initially breaks below the most recent low pivot (LL1), but the bar closes back above that level and leaves a long lower wick, suggesting a failed push lower. Combined with a mismatch between the candle direction and the order flow (buyers regain control) and a reversal in volume dominance, the aggregate score exceeds the risk threshold, so a dashed โBear Trap Riskโ label prints beneath the bar. The green and red trend lines mark the current low and high pivot trajectories, while the horizontal dashed lines show the highest and lowest values in the lookback window. If, within the next few bars, price closes decisively above the support, the risk label would upgrade to a solid โBear Trapโ label.
Figure caption, In this example the trap module has identified both ends of a price range. Near the highs, price briefly pushes above the descending red trendline and the recent pivot high, but fails to close there and leaves a noticeable upper wick. That combination of a sweep above resistance and orderโflow mismatch generates a Bull Trap Risk label with a dashed outline, warning that the upside break may not hold. At the opposite extreme, price later dips below the green trendline and the labelled low pivot, then quickly snaps back and closes higher. The long lower wick and subsequent price reversal upgrade the previous bearโtrap risk into a confirmed Bear Trap (solid label), indicating that sellers were caught on a false breakdown. Horizontal dashed lines mark the highest high and lowest low of the lookback window, while the red and green diagonals connect the earliest and latest pivot highs and lows to visualize the range.
7. Sharp Move Module
7.1 Concept
Markets sometimes display absorption or climax behaviorโperiods when one side steadily gains the upper hand before price breaks out with a sharp move. This module evaluates several orderโflow and volume conditions to anticipate such moves. Users can choose how many conditions must be met to flag a risk and how many (plus a price break) are required for confirmation.
7.2 Inputs
โข sharp Lookback: Number of bars in the window used to compute moving averages, sums, percentile ranks and reference levels.
โข sharpPercentile: Minimum percentile rank for the current sideโs volume; the current buy (or sell) volume must be greater than or equal to this percentile of historical volumes over the lookback window.
โข sharpVolMult: Multiplier used in the volume climax check. The current sideโs volume must exceed this multiple of its average to count as a climax.
โข sharpRatioThr: Minimum dominance ratio (current sideโs volume relative to the opposite side) used in both the instant and cumulative dominance checks.
โข sharpChurnThr: Maximum ratio of a barโs range to its ATR for absorption/churn detection; lower values indicate more absorption (large volume in a small range).
โข sharpScoreRisk: Minimum number of conditions that must be true to print a risk label.
โข sharpScoreConfirm: Minimum number of conditions plus a price break required for confirmation.
โข sharpCvdThr: Threshold for cumulative delta divergence versus price change (positive for bullish accumulation, negative for bearish distribution).
โข Label settings: ATR length (sharpATRlen) and multiplier (sharpLabelMult) for positioning labels, label size, colors and connector styles for bullish and bearish sharp moves.
โข Toggles: enableSharp activates the module; show_sharp_labels controls whether labels are drawn.
7.3 Conditions (six per side)
For each side, the indicator computes six boolean conditions and sums them to form a score:
1. Dominance (instant and cumulative):
โ Instant dominance: current buy volume โฅ sharpRatioThr ร current sell volume.
โ Cumulative dominance: sum of buy volumes over the window โฅ sharpRatioThr ร sum of sell volumes (and vice versa for bearish checks).
2. Accumulation/Distribution divergence: Over the lookback window, cumulative delta rises by at least sharpCvdThr while price fails to rise (bullish), or cumulative delta falls by at least sharpCvdThr while price fails to fall (bearish).
3. Volume climax: The current sideโs volume is โฅ sharpVolMult ร its average and the product of volume and bar range is the highest in the lookback window.
4. Absorption/Churn: The current sideโs volume divided by the barโs range equals the highest value in the window and the barโs range divided by ATR โค sharpChurnThr (indicating large volume within a small range).
5. Percentile rank: The current sideโs volume percentile rank is โฅ sharp Percentile.
6. Mirror logic for sellers: The above checks are repeated with buyer and seller roles swapped and the price break levels reversed.
Each condition that passes contributes one point to the corresponding sideโs score (0 or 1). Risk and confirmation thresholds are then applied to these scores.
7.4 Scoring and labels
โข Risk: If scoreBull โฅ sharpScoreRisk, a โSharp โ Riskโ label is drawn above the bar. If scoreBear โฅ sharpScoreRisk, a โSharp โ Riskโ label is drawn below the bar.
โข Confirmation: A risk label is upgraded to โSharp โโ when scoreBull โฅ sharpScoreConfirm and the bar closes above the highest recent pivot (HH1); for bearish cases, confirmation requires scoreBear โฅ sharpScoreConfirm and a close below the lowest pivot (LL1).
โข Label positioning: Labels are offset from the candle by ATR ร sharpLabelMult (full ATR times multiplier), not half, and may include a dashed or dotted connector line if enabled.
Figure caption, In this chart both bullish and bearish sharpโmove setups have been flagged. Earlier in the range, a โSharp โ Riskโ label appears beneath a candle: the sellโside score met the risk threshold, signaling that the combination of strong sell volume, dominance and absorption within a narrow range suggested a potential sharp decline. The price did not close below the lower pivot, so this label remains a โriskโ and no confirmation occurred. Later, as the market recovered and volume shifted back to the buy side, a โSharp โ Riskโ label prints above a candle near the top of the channel. Here, buyโside dominance, cumulative delta divergence and a volume climax aligned, but price has not yet closed above the upper pivot (HH1), so the alert is still a risk rather than a confirmed sharpโup move.
Figure caption, In this chart a Sharpโฏโ label is displayed above a candle, indicating that the sharp move module has confirmed a bullish breakout. Prior bars satisfied the risk threshold โ showing buyโside dominance, positive cumulative delta divergence, a volume climax and strong absorption in a narrow range โ and this candle closes above the highest recent pivot, upgrading the earlier โSharpโฏโ Riskโ alert to a full Sharpโฏโ signal. The green label is offset from the candle with a dashed connector, while the red and green trend lines trace the high and low pivot trajectories and the dashed horizontals mark the highest and lowest values of the lookback window.
8. MarketโMaker / SpreadโCapture Module
8.1 Concept
Liquidity providers often โcapture the spreadโ by buying and selling in almost equal amounts within a very narrow price range. These bars can signal temporary congestion before a move or reflect algorithmic activity. This module flags bars where both buyer and seller volumes are high, the price range is only a few ticks and the buy/sell split remains close to 50%. It helps traders spot potential liquidity pockets.
8.2 Inputs
โข scalpLookback: Window length used to compute volume averages.
โข scalpVolMult: Multiplier applied to each sideโs average volume; both buy and sell volumes must exceed this multiple.
โข scalpTickCount: Maximum allowed number of ticks in a barโs range (calculated as (high โ low) / minTick). A value of 1 or 2 captures ultraโsmall bars; increasing it relaxes the range requirement.
โข scalpDeltaRatio: Maximum deviation from a perfect 50/50 split. For example, 0.05 means the buyer share must be between 45% and 55%.
โข Label settings: ATR length, multiplier, size, colors, connector style and width.
โข Toggles : show_scalp_module and show_scalp_labels to enable the module and its labels.
8.3 Signal
When, on the current bar, both TF_buy_breakout and TF_sell_breakout exceed scalpVolMult times their respective averages and (high โ low)/minTick โค scalpTickCount and the buyer share is within scalpDeltaRatio of 50%, the module prints a โSpreadโฏโโ label above the bar. The label uses the same ATR offset logic as other modules and draws a connector if enabled.
Figure caption, In this chart the spreadโcapture module has identified a potential liquidity pocket. Buyer and seller volumes both spiked above their recent averages, yet the candleโs range measured only a couple of ticks and the buy/sell split stayed close to 50โฏ%. This combination met the moduleโs criteria, so it printed a grey โSpreadโฏโโ label above the bar. The red and green trend lines link the earliest and latest high and low pivots, and the dashed horizontals mark the highest high and lowest low within the current lookback window.
9. Money Flow Module
9.1 Concept
To translate volume into a monetary measure, this module multiplies each sideโs volume by the closing price. It tracks buying and selling system money default currency on a per-bar basis and sums them over a chosen period. The difference between buy and sell currencies (ฮ$) shows net inflow or outflow.
9.2 Inputs
โข mf_period_len_mf: Number of bars used for summing buy and sell dollars.
โข Label appearance settings: ATR length, multiplier, size, colors for up/down labels, and connector style and width.
โข Toggles: Use enableMoneyFlowLabel_mf and showMFLabels to control whether the module and its labels are displayed.
9.3 Calculations
โข Per-bar money: Buy $ = TF_buy_breakout ร close; Sell $ = TF_sell_breakout ร close. Their difference is ฮ$ = Buy $ โ Sell $.
โข Summations: Over mf_period_len_mf bars, compute ฮฃ Buy $, ฮฃ Sell $ and ฮฃฮ$ using math.sum().
โข Info table entries: Rows 9โ13 display these values as texts like โโ USD 1234 (1M)โ or โฮฃฮ USD โ5678 (14)โ, with colors reflecting whether buyers or sellers dominate.
โข Money flow status: If ฮ$ is positive the bar is marked โMoney flow inโ ; if negative, โMoney flow outโ ; if zero, โNeutralโ. The cumulative status is similarly derived from ฮฃฮ.Labels print at the bar that changes the sign of ฮฃฮ, offset using ATR ร label multiplier and styled per user preferences.
Figure caption, The chart illustrates a steady rise toward the highest recent pivot (HH1) with price riding between a rising green trendโline and a red trendโline drawn through earlier pivot highs. A green Money flow in label appears above the bar near the top of the channel, signaling that net dollar flow turned positive on this bar: buyโside dollar volume exceeded sellโside dollar volume, pushing the cumulative sum ฮฃฮ$ above zero. In the info table, the โMoney flow (bar)โ and โMoney flow ฮฃโ rows both read In, confirming that the indicatorโs moneyโflow module has detected an inflow at both bar and aggregate levels, while other modules (pivots, trend lines and support/resistance) remain active to provide structural context.
In this example the Money Flow module signals a net outflow. Price has been trending downward: successive high pivots form a falling red trendโline and the low pivots form a descending green support line. When the latest bar broke below the previous low pivot (LL1), both the barโlevel and cumulative net dollar flow turned negativeโselling volume at the close exceeded buying volume and pushed the cumulative ฮ$ below zero. The module reacts by printing a red โMoney flow outโ label beneath the candle; the info table confirms that the โMoney flow (bar)โ and โMoney flow ฮฃโ rows both show Out, indicating sustained dominance of sellers in this period.
10. Info Table
10.1 Purpose
When enabled, the Info Table appears in the lower right of your chart. It summarises key values computed by the indicatorโsuch as buy and sell volume, delta, total volume, breakout status, market phase, and money flowโso you can see at a glance which side is dominant and which signals are active.
10.2 Symbols
โข โ / โ โ Up (โ) denotes buy volume or money; down (โ) denotes sell volume or money.
โข MA โ Moving average. In the table it shows the average value of a series over the lookback period.
โข ฮฃ (Sigma) โ Cumulative sum over the chosen lookback period.
โข ฮ (Delta) โ Difference between buy and sell values.
โข B / S โ Buyer and seller share of total volume, expressed as percentages.
โข Ref. Price โ Reference price for breakout calculations, based on the latest pivot.
โข Status โ Indicates whether a breakout condition is currently active (True) or has failed.
10.3 Row definitions
1. Up volume / MA up volume โ Displays current buy volume on the lower timeframe and its moving average over the lookback period.
2. Down volume / MA down volume โ Shows current sell volume and its moving average; sell values are formatted in red for clarity.
3. ฮ / ฮฃฮ โ Lists the difference between buy and sell volume for the current bar and the cumulative delta volume over the lookback period.
4. ฮฃ / MA ฮฃ (Vol/MA) โ Total volume (buy + sell) for the bar, with the ratio of this volume to its moving average; the right cell shows the average total volume.
5. B/S ratio โ Buy and sell share of the total volume: current bar percentages and the average percentages across the lookback period.
6. Buyer Rank / Seller Rank โ Ranks the barโs buy and sell volumes among the last (n) bars; lower rank numbers indicate higher relative volume.
7. ฮฃ Buy / ฮฃ Sell โ Sum of buy and sell volumes over the lookback window, indicating which side has traded more.
8. Breakout UP / DOWN โ Shows the breakout thresholds (Ref. Price) and whether the breakout condition is active (True) or has failed.
9. Market Phase (Vol) โ Reports the current volumeโonly phase: Accumulation, Distribution or Neutral.
10. Money Flow โ The final rows display dollar amounts and status:
โ โ USD / ฮฃโ USD โ Buy dollars for the current bar and the cumulative sum over the moneyโflow period.
โ โ USD / ฮฃโ USD โ Sell dollars and their cumulative sum.
โ ฮ USD / ฮฃฮ USD โ Net dollar difference (buy minus sell) for the bar and cumulatively.
โ Money flow (bar) โ Indicates whether the barโs net dollar flow is positive (In), negative (Out) or neutral.
โ Money flow ฮฃ โ Shows whether the cumulative net dollar flow across the chosen period is positive, negative or neutral.
The chart above shows a sequence of different signals from the indicator. A Bull Trap Risk appears after price briefly pushes above resistance but fails to hold, then a green Accum label identifies an accumulation phase. An upward breakout follows, confirmed by a Money flow in print. Later, a Sharpย โ Risk warns of a possible sharp downturn; after price dips below support but quickly recovers, a Bear Trap label marks a false breakdown. The highlighted info table in the center summarizes key metrics at that moment, including current and average buy/sell volumes, net delta, total volume versus its moving average, breakout status (up and down), market phase (volume), and barโlevel and cumulative money flow (In/Out).
11. Conclusion & Final Remarks
This indicator was developed as a holistic study of market structure and order flow. It brings together several wellโknown concepts from technical analysisโbreakouts, accumulation and distribution phases, overbought and oversold extremes, bull and bear traps, sharp directional moves, marketโmaker spread bars and money flowโinto a single Pine Script tool. Each module is based on widely recognized trading ideas and was implemented after consulting reference materials and example strategies, so you can see in real time how these concepts interact on your chart.
A distinctive feature of this indicator is its reliance on perโside volume: instead of tallying only total volume, it separately measures buy and sell transactions on a lower time frame. This approach gives a clearer view of who is in controlโbuyers or sellersโand helps filter breakouts, detect phases of accumulation or distribution, recognize potential traps, anticipate sharp moves and gauge whether liquidity providers are active. The moneyโflow module extends this analysis by converting volume into currency values and tracking net inflow or outflow across a chosen window.
Although comprehensive, this indicator is intended solely as a guide. It highlights conditions and statistics that many traders find useful, but it does not generate trading signals or guarantee results. Ultimately, you remain responsible for your positions. Use the information presented here to inform your analysis, combine it with other tools and riskโmanagement techniques, and always make your own decisions when trading.
Session Open Candle MarkerThe "Session Open Candle Marker" is a Pine Script indicator designed for forex and futures traders using Smart Money Concepts (SMC) and RP Profits-inspired strategies. It marks the 15-minute opening range candles for the Asia, London, and NY sessions, where institutional "big players" often gather liquidity. Each sessionโs range is drawn as a rectangle with a customizable midpoint line, ideal for spotting breakouts, retests, and liquidity sweeps.
Features
Session Open Ranges: Plots rectangles for the 15m open candles of Asia (03:00 EEST), London (10:00 EEST), and NY (15:00 EEST), corresponding to 01:00, 08:00, and 13:00 GMT+1.
Customizable Visualization:
Toggle each session (Asia, London, NY) on/off.
Independent high/low label toggles for each session.
Adjustable rectangle color, midpoint line color, style (solid/dashed/dotted), and width.
Customizable rectangle duration (default: 96 bars, ~24 hours on 15m).
Timezone Flexibility: Default times are set for EEST (UTC+3). Adjust session inputs for your chartโs timezone (e.g., GMT+1: Asia 01:00, London 08:00, NY 13:00; UTC: Asia 00:00, London 07:00, NY 12:00).
Clean Design: Rectangles and labels update dynamically, with proper cleanup to avoid clutter.
Usage:
Setup: Add to a 15m chart (e.g., EURUSD, ES1!). Check your chartโs timezone (Chart Settings > Symbol > Timezone) and adjust session times if needed.
Settings:
Toggle sessions and labels to focus on desired ranges (e.g., London and NY for high volatility).
Customize colors, midpoint line style/width, and rectangle duration.
Trading:
Breakouts/Retests: Trade breakouts above/below the rectangle high/low, with retests back to the range or midpoint (aligned with RP Profits scalping).
Liquidity Sweeps: Watch for price sweeping session highs/lows, reversing for entries (SMC concept).
cd_RSI_Divergence_CxGeneral:
The Relative Strength Index (RSI) is a momentum oscillator widely used by traders in price analysis. In addition to showing overbought/oversold zones, divergences between RSI and price are also tracked to identify trading opportunities.
The general consensus is that oscillators alone are not sufficient for entries and should be evaluated together with multiple confirmations.
This oscillator is designed as an additional confirmation/compatible tool for strategies that already use higher time frame (HTF) sweeps and lower time frame (LTF) confirmations such as Change in State Delivery (CISD) or Change of Character (CHOCH).
Features:
While RSI oscillators are commonly displayed in line format (classic), this indicator also offers candlestick-style visualization.
Depending on the selected source, period length, and EMA length, RSI can be displayed as lines and/or candlesticks.
Divergence detection & tracking:
Price and RSI values are monitored on the chosen higher time frame (from the menu) to determine highs and lows. For divergence display, the user can choose between two modes:
1- Alignment with HTF Sweep
2- All
1 - Alignment with HTF Sweep:
First, the price must sweep the previous high/low of the candle on the HTF (i.e., break it) but fail to continue in that direction and return inside (sweep).
If this condition is met, RSI values are checked:
If price makes a high sweep but RSI fails to make a new high โ divergence is confirmed.
If price makes a low sweep but RSI fails to make a new low โ divergence is confirmed.
Divergence is then displayed on the chart.
2 - All:
In this mode, sweep conditions are ignored. Divergence is confirmed if:
Price makes a new high on HTF but RSI does not.
RSI makes a new high on HTF but price does not.
Price makes a new low on HTF but RSI does not.
RSI makes a new low on HTF but price does not.
Menu & Settings:
RSI visualization (source + period length + EMA period length)
Option to choose classic/candlestick style display
Color customization
Higher time frame selection
Adjustable HTF boxes and table display
Final notes:
This oscillator is designed as an additional confirmation tool for strategies based on HTF sweep + LTF CISD/CHOCH confirmation logic. The chosen HTF in the oscillator should match the time frame where sweeps are expected.
Divergence signals from this oscillator alone will not make you profitable.
For spot trades, monitoring sweeps and divergences on higher time frames is more suitable (e.g., DailyโH1 / WeeklyโH4).
My personal usage preferences:
Entry TF: 3m
HTF bias: Daily + H1
Sweep + CISD: 30m / 3m
Market Structure: 3m
RSI divergence: HTF = 30m
If all of them align bullish or bearish ( timeframe alignment ), I try to take the trade.
Iโd be glad to hear your feedback and suggestions for improvement.
Happy trading!
EBP Candle Marker### **EBP Candle Marker โ TradingView Indicator**
The **EBP Candle Marker** is a specialized TradingView indicator designed to identify and highlight potential liquidity sweep candles. This indicator visually emphasizes key price action patterns where the market sweeps previous highs or lows and closes in the opposite direction, often signaling potential reversals or liquidity grabs.
---
### ๐ **Indicator Logic:**
1. **Bullish Sweep:**
- The current candleโs **low** is lower than the previous candleโs **low** (indicating a liquidity sweep).
- The **close** is above both the **open** and **close** of the previous candle.
2. **Bearish Sweep:**
- The current candleโs **high** is higher than the previous candleโs **high** (indicating a liquidity sweep).
- The **close** is below both the **open** and **close** of the previous candle.
---
### ๐จ **Visual Representation:**
- **Yellow Candle Body:** Highlights any candle meeting the bullish or bearish sweep conditions.
---
### ๐ **Alert Functionality:**
The indicator supports setting custom alerts in TradingView for:
- **Bullish Sweep Detected** โ Notifies when a bullish sweep occurs.
- **Bearish Sweep Detected** โ Notifies when a bearish sweep occurs.
These alerts are compatible across any timeframe, providing flexibility to monitor key market conditions.
---
### ๐ **Use Cases:**
- **Liquidity Sweep Detection:** Identify areas where the market may be triggering stop-loss orders or liquidity hunts.
- **Reversal Confirmation:** Enhance trade confirmation by identifying potential reversal zones.
- **Scalping & Swing Trading:** Suitable for both short-term and long-term trading strategies across multiple timeframes.
cd_bias_profile_Cxcd_bias_profile Cx
Overview:
cd_bias_profile_Cx is an all-in-one professional analysis terminal designed to determine market direction (Bias) based on institutional trading strategies (SMC & ICT). This tool integrates multi-timeframe (MTF) data, institutional liquidity sweeps, SMT divergences, and candle closure confirmations into a single cohesive structure, providing traders with a comprehensive map of institutional Order Flow.
๐ Advanced Hierarchical Profile Architecture
The indicator visualizes the market through a three-layered hierarchy (Major, Middle, Plot), allowing you to see exactly which higher-tier structure the current price action is serving.
โข Smart Timeframe (Auto-TF) Logic: In "Auto" mode, the system automatically selects the most logical hierarchy based on your chart interval using the following sequence:
.
o Example Scenario: If your chart is set to 5-Minute (5m):
๏ง Major (Macro Structure): H4 (The outermost container candle)
๏ง Middle (Intermediate Structure): H1 (Mid-scale candle)
๏ง Plot (Local Structure): 15m (The smallest nested high-timeframe candle)
โข Nested Candle Design: Each high-timeframe candle is rendered as transparent boxes with specific body colors, encapsulating the lower-tier price action (OHLC) within it.
โข Cyclical Refresh: Profile drawings reset automatically at the opening of every new Major timeframe candle. This ensures the analysis remains focused on the freshest institutional cycle.
๐ง Bias Algorithm & Decision Mechanism
To eliminate subjective interpretation, the algorithm operates on a purely mathematical logic based solely on Candle Closures (Close). It generates three distinct outcomes:
1. Reversal:
o Condition 1: A liquidity Sweep must occur at the HTF level.
o Condition 2 (SMT Confirmation): If no sweep is detected on the primary pair, the algorithm automatically scans correlated assets (e.g., checking GBPUSD or DXY for an EURUSD trade). An SMT Divergence in a correlated asset is accepted as institutional manipulation confirmation.
o Final Trigger: Once a CISD (Change in State of Delivery) occurs on the Lower Timeframe (LTF), the "Reversal" bias is confirmed.
2. Continuation: When a high-timeframe candle closes convincingly above/below the previous candle's High or Low, the algorithm reports that the current trend maintains its strength.
3. Indeterminate: In "non-delivery" zones where the market neither sweeps liquidity nor creates a structural break, the algorithm remains neutral to prevent overtrading.
๐จ Alert Center
The alert system is designed for high-confluence setups, ensuring you never miss a structural shift:
โข Flexible TF Selection: You can manually toggle which of the 5 tracked timeframes (1M, 1W, 1D, etc.) should trigger notifications based on your strategy.
โข "Any of Them" Function: When enabled, an instant notification is sent the moment a "Reversal" or "Continuation" signal forms on any of your selected timeframes.
โข Directional Filtering: You can filter alerts to receive only "Bullish" or only "Bearish" setups, allowing you to align with your primary macro bias.
โ๏ธ Pro Tips for Usage
โข Invalidation Lines: The dashed lines on the chart indicate the exact price level where the institutional bias is "invalidated." These serve as professional-grade stop-loss levels.
โข B-ADJ Support: For Futures traders, back-adjustment settings are optimized within the code for seamless data transition.
โข Manual Mode: If you wish to use custom timeframes not found in the standard sequence (e.g., 2-hour or 3-day charts), you can define them via the "Manuel" settings toggle.
โข High-probability trade setups can be expected when there is multi-timeframe alignment in the same direction.
โข Strategic Use Cases: The indicator is optimized for trading Distribution Phases within advanced frameworks. Whether you are looking for the C3 candle in the Universal Model or the Distribution (D) phase in an AMD (Power of 3) setup, this tool provides the necessary structural confirmation.
โข User Discretion: Please note that this is a directional bias tool. While it identifies which direction is supported by multi-timeframe alignment, the final execution and entry management on lower timeframes are the user's responsibility.
โข Always remember to seek additional confluence before executing a trade.
Chart Visual
Profile Visual
Example (SMT Usage) : On the chart, while the 10:00 H1 candle on GBPUSD sweeps its previous candle's liquidity, its correlated pair EURUSD does not show a sweep. If the "Use SMT for Bias" option is enabled, this SMT divergence with the correlated pair is accepted as a valid HTF Sweep. Upon the new candle open, once a 5m CISD confirmation occurs on EURUSD, the Bias Table will display "Bearish" for the H1/5m row.
Entry examples:
Please feel free to share your feedback and suggestions in the comments below.
Happy trading!
Structural Liquidity Signals [BullByte]Structural Liquidity Signals (SFP, FVG, BOS, AVWAP)
Short description
Detects liquidity sweeps (SFPs) at pivots and PD/W levels, highlights the latest FVG, tracks AVWAP stretch, arms percentile extremes, and triggers after confirmed micro BOS.
Full description
What this tool does
Structural Liquidity Signals shows where price likely tapped liquidity (stop clusters), then waits for structure to actually change before it prints a trigger. It spots:
Liquidity sweeps (SFPs) at recent pivots and at prior day/week highs/lows.
The latest Fair Value Gap (FVG) that often โpullsโ price or serves as a reaction zone.
How far price is stretched from two VWAP anchors (one from the latest impulse, one from todayโs session), scaled by ATR so it adapts to volatility.
A โpercentileโ extreme of an internal score. At extremes the script โarmsโ a setup; it only triggers after a small break of structure (BOS) on a closed bar.
Originality and design rationale, why itโs not โjust a mashupโ
This is not a mashup for its own sake. Itโs a purpose-built flow that links where liquidity is likely to rest with how structure actually changes:
- Liquidity location: We focus on areas where stops commonly clusterโrecent pivots and prior day/week highs/lowsโthen detect sweeps (SFPs) when price wicks beyond and closes back inside.
- Displacement context: We track the last Fair Value Gap (FVG) to account for recent inefficiency that often acts as a magnet or reaction zone.
- Stretch measurement: We anchor VWAP to the latest N-bar impulse and to the Daily session, then normalize stretch by ATR to assess dislocation consistently across assets/timeframes.
- Composite exhaustion: We combine stretch, wick skew, and volume surprise, then bend the result with a tanh transform so extremes are bounded and comparable.
- Dynamic extremes and discipline: Rather than triggering on every sweep, we โarmโ at statistical extremes via percent-rank and only fire after a confirmed micro Break of Structure (BOS). This separates โinterestingโ from โactionable.โ
Key concepts
SFP (liquidity sweep): A candle briefly trades beyond a level (where stops sit) and closes back inside. We detect these at:
Pivots (recent swing highs/lows confirmed by โleft/rightโ bars).
Prior Day/Week High/Low (PDH/PDL/PWH/PWL).
FVG (Fair Value Gap): A small 3โbar gap (bar2 high vs bar1 low, or vice versa). The latest gap often acts like a magnet or reaction zone. We track the most recent Up/Down gap and whether price is inside it.
AVWAP stretch: Distance from an Anchored VWAP divided by ATR (volatility). We use:
Impulse AVWAP: resets on each new Nโbar high/low.
Daily AVWAP: resets each new session.
PR (Percentile Rank): Where the current internal score sits versus its own recent history (0..100). We arm shorts at high PR, longs at low PR.
Micro BOS: A small break of the recent high (for longs) or low (for shorts). This is the โgo/noโgoโ confirmation.
How the parts work together
Find likely liquidity grabs (SFPs) at pivots and PD/W levels.
Add context from the latest FVG and AVWAP stretch (how far price is from โfairโ).
Build a bounded score (so different markets/timeframes are comparable) and compute its percentile (PR).
Arm at extremes (high PR โ short candidate; low PR โ long candidate).
Only print a trigger after a micro BOS, on a closed bar, with spacing/cooldown rules.
What you see on the chart (legend)
Lines:
Teal line = Impulse AVWAP (resets on new Nโbar extreme).
Aqua line = Daily AVWAP (resets each session).
PDH/PDL/PWH/PWL = prior day/week levels (toggle on/off).
Zones:
Greenish box = latest Up FVG; Reddish box = latest Down FVG.
The shading/border changes after price trades back through it.
SFP labels:
SFPโP = SFP at Pivot (dotted line marks that pivotโs price).
SFPโL = SFP at Level (at PDH/PDL/PWH/PWL).
Throttle: To reduce clutter, SFPs are rateโlimited per direction.
Triggers:
Triangle up = long trigger after BOS; triangle down = short trigger after BOS.
Optional badge shows direction and PR at the moment of trigger.
Optional Trigger Zone is an ATRโsized box around the trigger barโs close (for visualization only).
Background:
Light green/red shading = a long/short setup is โarmedโ (not a trigger).
Dashboard (Mini/Pro) โ what each item means
PR: Percentile of the internal score (0..100). Near 0 = bullish extreme, near 100 = bearish extreme.
Gauge: Text bar that mirrors PR.
State: Idle, Armed Long (with a countdown), or Armed Short.
Cooldown: Bars remaining before a new setup can arm after a trigger.
Bars Since / Last Px: How long since last trigger and its price.
FVG: Whether price is in the latest Up/Down FVG.
Imp/Day VWAP Dist, PD Dist(ATR): Distance from those references in ATR units.
ATR% (Gate), Trend(HTF): Status of optional regime filters (volatility/trend).
How to use it (stepโbyโstep)
Keep the Safety toggles ON (default): triggers/visuals on barโclose, optional confirmed HTF for trend slope.
Choose timeframe:
Intraday (5mโ1h) or Swing (1hโ4h). On very fast/thin charts, enable Performance mode and raise spacing/cooldown.
Watch the dashboard:
When PR reaches an extreme and an SFP context is present, the background shades (armed).
Wait for the trigger triangle:
It prints only after a micro BOS on a closed bar and after spacing/cooldown checks.
Use the Trigger Zone box as a visual reference only:
This script never tells you to buy/sell. Apply your own plan for entry, stop, and sizing.
Example:
Bullish: Sweep under PDL (SFPโL) and reclaim; PR in lower tail arms long; BOS up confirms โ long trigger on bar close (ATR-sized trigger zone shown).
Bearish: Sweep above PDH/pivot (SFPโL/P) and reject; PR in upper tail arms short; BOS down confirms โ short trigger on bar close (ATR-sized trigger zone shown).
Settings guide (with โwhen to adjustโ)
Safety & Stability (defaults ON)
Confirm triggers at bar close, Draw visuals at bar close: Keep ON for clean, stable prints.
Use confirmed HTF values: Applies to HTF trend slope only; keeps it from changing until the HTF bar closes.
Performance mode: Turn ON if your chart is busy or laggy.
Core & Context
ATR Length: Bigger = smoother distances; smaller = more reactive.
Impulse AVWAP Anchor: Larger = fewer resets; smaller = resets more often.
Show Daily AVWAP: ON if you want session context.
Use last FVG in logic: ON to include FVG context in arming/score.
Show PDH/PDL/PWH/PWL: ON to see prior day/week levels that often attract sweeps.
Liquidity & Microstructure
Pivot Left/Right: Higher values = stronger/rarer pivots.
Min Wick Ratio (0..1): Higher = only more pronounced SFP wicks qualify.
BOS length: Larger = stricter BOS; smaller = quicker confirmations.
Signal persistence: Keeps SFP context alive for a few bars to avoid flicker.
Signal Gating
PercentโRank Lookback: Larger = more stable extremes; smaller = more reactive extremes.
Arm thresholds (qHi/qLo): Move closer to 0.5 to see more arms; move toward 0/1 to see fewer arms.
TTL, Cooldown, Min bars and Min ATR distance: Space out triggers so youโre not reacting to minor noise.
Regime Filters (optional)
ATR percentile gate: Only allow triggers when volatility is at/above a set percentile.
HTF trend gate: Only allow longs when the HTF slope is up (and shorts when itโs down), above a minimum slope.
Visuals & UX
Only show โimportantโ SFPs: Filters pivot SFPs by Volume Z and |Impulse stretch|.
Trigger badges/history and Max badge count: Control label clutter.
Compact labels: Toggle SFPโP/L vs full names.
Dashboard mode and position; Dark theme.
Reading PR (the builtโin โoscillatorโ)
PR ~ 0โ10: Potential bullish extreme (long side can arm).
PR ~ 90โ100: Potential bearish extreme (short side can arm).
Important: โArmedโ โ โEnter.โ A trigger still needs a micro BOS on a closed bar and spacing/cooldown to pass.
Repainting, confirmations, and HTF notes
By default, prints wait for the bar to close; this reduces repaintโlike effects.
Pivot SFPs only appear after the pivot confirms (after the chosen โrightโ bars).
PD/W levels come from the prior completed candles and do not change intraday.
If you enable confirmed HTF values, the HTF slope will not change until its higherโtimeframe bar completes (safer but slightly delayed).
Performance tips
If labels/zones clutter or the chart lags:
Turn ON Performance mode.
Hide FVG or the Trigger Zone.
Reduce badge history or turn badge history off.
If price scaling looks compressed:
Keep optional โscoreโ/โPRโ plots OFF (they overlay price and can affect scaling).
Alerts (neutral)
Structural Liquidity: LONG TRIGGER
Structural Liquidity: SHORT TRIGGER
These fire when a trigger condition is met on a confirmed bar (with defaults).
Limitations and risk
Not every sweep/extreme reverses; false triggers occur, especially on thin markets and low timeframes.
This indicator does not provide entries, exits, or position sizingโuse your own plan and risk control.
Educational/informational only; no financial advice.
License and credits
ยฉ BullByte - MPL 2.0. Openโsource for learning and research.
Built from repeated observations of how liquidity runs, imbalance (FVG), and distance from โfairโ (AVWAPs) combine, and how a small BOS often marks the moment structure actually shifts.
Trading IQ - ICT LibraryLibrary "ICTlibrary"
Used to calculate various ICT related price levels and strategies. An ongoing project.
Hello Coders!
This library is meant for sourcing ICT related concepts. While some functions might generate more output than you require, you can specify "Lite Mode" as "true" in applicable functions to slim down necessary inputs.
isLastBar(userTF)
โโIdentifies the last bar on the chart before a timeframe change
โโParameters:
โโโโ userTF (simple int) : the timeframe you wish to calculate the last bar for, must be converted to integer using 'timeframe.in_seconds()'
โโReturns: bool true if bar on chart is last bar of higher TF, dalse if bar on chart is not last bar of higher TF
necessaryData(atrTF)
โโreturns necessaryData UDT for historical data access
โโParameters:
โโโโ atrTF (float) : user-selected timeframe ATR value.
โโReturns: logZ. log return Z score, used for calculating order blocks.
method gradBoxes(gradientBoxes, idColor, timeStart, bottom, top, rightCoordinate)
โโcreates neon like effect for box drawings
โโNamespace types: array
โโParameters:
โโโโ gradientBoxes (array) : an array.new() to store the gradient boxes
โโโโ idColor (color)
โโโโ timeStart (int) : left point of box
โโโโ bottom (float) : bottom of box price point
โโโโ top (float) : top of box price point
โโโโ rightCoordinate (int) : right point of box
โโReturns: void
checkIfTraded(tradeName)
โโchecks if recent trade is of specific name
โโParameters:
โโโโ tradeName (string)
โโReturns: bool true if recent trade id matches target name, false otherwise
checkIfClosed(tradeName)
โโchecks if recent closed trade is of specific name
โโParameters:
โโโโ tradeName (string)
โโReturns: bool true if recent closed trade id matches target name, false otherwise
IQZZ(atrMult, finalTF)
โโcustom ZZ to quickly determine market direction.
โโParameters:
โโโโ atrMult (float) : an atr multiplier used to determine the required price move for a ZZ direction change
โโโโ finalTF (string) : the timeframe used for the atr calcuation
โโReturns: dir market direction. Up => 1, down => -1
method drawBos(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showBOS, isUp)
โโcalculates and draws Break Of Structure
โโNamespace types: array
โโParameters:
โโโโ id (array)
โโโโ startPoint (chart.point)
โโโโ getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
โโโโ getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
โโโโ col (color) : color of the BoS line / label
โโโโ showBOS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
โโโโ isUp (bool) : whether BoS happened during price increase or price decrease.
โโReturns: void
method drawMSS(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showMSS, isUp, upRejections, dnRejections, highArr, lowArr, timeArr, closeArr, openArr, atrTFarr, upRejectionsPrices, dnRejectionsPrices)
โโcalculates and draws Market Structure Shift. This data is also used to calculate Rejection Blocks.
โโNamespace types: array
โโParameters:
โโโโ id (array)
โโโโ startPoint (chart.point)
โโโโ getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
โโโโ getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
โโโโ col (color) : color of the MSS line / label
โโโโ showMSS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
โโโโ isUp (bool) : whether MSS happened during price increase or price decrease.
โโโโ upRejections (array)
โโโโ dnRejections (array)
โโโโ highArr (array) : array containing historical highs, should be taken from the UDT "necessaryData" defined above
โโโโ lowArr (array) : array containing historical lows, should be taken from the UDT "necessaryData" defined above
โโโโ timeArr (array) : array containing historical times, should be taken from the UDT "necessaryData" defined above
โโโโ closeArr (array) : array containing historical closes, should be taken from the UDT "necessaryData" defined above
โโโโ openArr (array) : array containing historical opens, should be taken from the UDT "necessaryData" defined above
โโโโ atrTFarr (array) : array containing historical atr values (of user-selected TF), should be taken from the UDT "necessaryData" defined above
โโโโ upRejectionsPrices (array) : array containing up rejections prices. Is sorted and used to determine selective looping for invalidations.
โโโโ dnRejectionsPrices (array) : array containing down rejections prices. Is sorted and used to determine selective looping for invalidations.
โโReturns: void
method getTime(id, compare, timeArr)
โโgets time of inputted price (compare) in an array of data
this is useful when the user-selected timeframe for ICT concepts is greater than the chart's timeframe
โโNamespace types: array
โโParameters:
โโโโ id (array) : the array of data to search through, to find which index has the same value as "compare"
โโโโ compare (float) : the target data point to find in the array
โโโโ timeArr (array) : array of historical times
โโReturns: the time that the data point in the array was recorded
method OB(id, highArr, signArr, lowArr, timeArr, sign)
โโstore bullish orderblock data
โโNamespace types: array
โโParameters:
โโโโ id (array)
โโโโ highArr (array) : array of historical highs
โโโโ signArr (array) : array of historical price direction "math.sign(close - open)"
โโโโ lowArr (array) : array of historical lows
โโโโ timeArr (array) : array of historical times
โโโโ sign (int) : orderblock direction, -1 => bullish, 1 => bearish
โโReturns: void
OTEstrat(OTEstart, future, closeArr, highArr, lowArr, timeArr, longOTEPT, longOTESL, longOTElevel, shortOTEPT, shortOTESL, shortOTElevel, structureDirection, oteLongs, atrTF, oteShorts)
โโexecutes the OTE strategy
โโParameters:
โโโโ OTEstart (chart.point)
โโโโ future (int) : future time point for drawings
โโโโ closeArr (array) : array of historical closes
โโโโ highArr (array) : array of historical highs
โโโโ lowArr (array) : array of historical lows
โโโโ timeArr (array) : array of historical times
โโโโ longOTEPT (string) : user-selected long OTE profit target, please create an input.string() for this using the example below
โโโโ longOTESL (int) : user-selected long OTE stop loss, please create an input.string() for this using the example below
โโโโ longOTElevel (float) : long entry price of selected retracement ratio for OTE
โโโโ shortOTEPT (string) : user-selected short OTE profit target, please create an input.string() for this using the example below
โโโโ shortOTESL (int) : user-selected short OTE stop loss, please create an input.string() for this using the example below
โโโโ shortOTElevel (float) : short entry price of selected retracement ratio for OTE
โโโโ structureDirection (string) : current market structure direction, this should be "Up" or "Down". This is used to cancel pending orders if market structure changes
โโโโ oteLongs (bool) : input.bool() for whether OTE longs can be executed
โโโโ atrTF (float) : atr of the user-seleceted TF
โโโโ oteShorts (bool) : input.bool() for whether OTE shorts can be executed
@exampleInputs
oteLongs = input.bool(defval = false, title = "OTE Longs", group = "Optimal Trade Entry")
longOTElevel = input.float(defval = 0.79, title = "Long Entry Retracement Level", options = , group = "Optimal Trade Entry")
longOTEPT = input.string(defval = "-0.5", title = "Long TP", options = , group = "Optimal Trade Entry")
longOTESL = input.int(defval = 0, title = "How Many Ticks Below Swing Low For Stop Loss", group = "Optimal Trade Entry")
oteShorts = input.bool(defval = false, title = "OTE Shorts", group = "Optimal Trade Entry")
shortOTElevel = input.float(defval = 0.79, title = "Short Entry Retracement Level", options = , group = "Optimal Trade Entry")
shortOTEPT = input.string(defval = "-0.5", title = "Short TP", options = , group = "Optimal Trade Entry")
shortOTESL = input.int(defval = 0, title = "How Many Ticks Above Swing Low For Stop Loss", group = "Optimal Trade Entry")
โโReturns: void (0)
displacement(logZ, atrTFreg, highArr, timeArr, lowArr, upDispShow, dnDispShow, masterCoords, labelLevels, dispUpcol, rightCoordinate, dispDncol, noBorders)
โโcalculates and draws dispacements
โโParameters:
โโโโ logZ (float) : log return of current price, used to determine a "significant price move" for a displacement
โโโโ atrTFreg (float) : atr of user-seleceted timeframe
โโโโ highArr (array) : array of historical highs
โโโโ timeArr (array) : array of historical times
โโโโ lowArr (array) : array of historical lows
โโโโ upDispShow (int) : amount of historical upside displacements to show
โโโโ dnDispShow (int) : amount of historical downside displacements to show
โโโโ masterCoords (map) : a map to push the most recent displacement prices into, useful for having key levels in one data structure
โโโโ labelLevels (string) : used to determine label placement for the displacement, can be inside box, outside box, or none, example below
โโโโ dispUpcol (color) : upside displacement color
โโโโ rightCoordinate (int) : future time for displacement drawing, best is "last_bar_time"
โโโโ dispDncol (color) : downside displacement color
โโโโ noBorders (bool) : input.bool() to remove box borders, example below
@exampleInputs
labelLevels = input.string(defval = "Inside" , title = "Box Label Placement", options = )
noBorders = input.bool(defval = false, title = "No Borders On Levels")
โโReturns: void
method getStrongLow(id, startIndex, timeArr, lowArr, strongLowPoints)
โโunshift strong low data to array id
โโNamespace types: array
โโParameters:
โโโโ id (array)
โโโโ startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the low before an upside BoS
โโโโ timeArr (array) : array of historical times
โโโโ lowArr (array) : array of historical lows
โโโโ strongLowPoints (array) : array of strong low prices. Used to retrieve highest strong low price and see if need for
removal of invalidated strong lows
โโReturns: void
method getStrongHigh(id, startIndex, timeArr, highArr, strongHighPoints)
โโunshift strong high data to array id
โโNamespace types: array
โโParameters:
โโโโ id (array)
โโโโ startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the high before a downside BoS
โโโโ timeArr (array) : array of historical times
โโโโ highArr (array) : array of historical highs
โโโโ strongHighPoints (array)
โโReturns: void
equalLevels(highArr, lowArr, timeArr, rightCoordinate, equalHighsCol, equalLowsCol, liteMode)
โโused to calculate recent equal highs or equal lows
โโParameters:
โโโโ highArr (array) : array of historical highs
โโโโ lowArr (array) : array of historical lows
โโโโ timeArr (array) : array of historical times
โโโโ rightCoordinate (int) : a future time (right for boxes, x2 for lines)
โโโโ equalHighsCol (color) : user-selected color for equal highs drawings
โโโโ equalLowsCol (color) : user-selected color for equal lows drawings
โโโโ liteMode (bool) : optional for a lite mode version of an ICT strategy. For more control over drawings leave as "True", "False" will apply neon effects
โโReturns: void
quickTime(timeString)
โโused to quickly determine if a user-inputted time range is currently active in NYT time
โโParameters:
โโโโ timeString (string) : a time range
โโReturns: true if session is active, false if session is inactive
macros(showMacros, noBorders)
โโused to calculate and draw session macros
โโParameters:
โโโโ showMacros (bool) : an input.bool() or simple bool to determine whether to activate the function
โโโโ noBorders (bool) : an input.bool() to determine whether the box anchored to the session should have borders
โโReturns: void
po3(tf, left, right, show)
โโuse to calculate HTF po3 candle
@tip only call this function on "barstate.islast"
โโParameters:
โโโโ tf (simple string)
โโโโ left (int) : the left point of the candle, calculated as bar_index + left,
โโโโ right (int) : :the right point of the candle, calculated as bar_index + right,
โโโโ show (bool) : input.bool() whether to show the po3 candle or not
โโReturns: void
silverBullet(silverBulletStratLong, silverBulletStratShort, future, userTF, H, L, H2, L2, noBorders, silverBulletLongTP, historicalPoints, historicalData, silverBulletLongSL, silverBulletShortTP, silverBulletShortSL)
โโused to execute the Silver Bullet Strategy
โโParameters:
โโโโ silverBulletStratLong (simple bool)
โโโโ silverBulletStratShort (simple bool)
โโโโ future (int) : a future time, used for drawings, example "last_bar_time"
โโโโ userTF (simple int)
โโโโ H (float) : the high price of the user-selected TF
โโโโ L (float) : the low price of the user-selected TF
โโโโ H2 (float) : the high price of the user-selected TF
โโโโ L2 (float) : the low price of the user-selected TF
โโโโ noBorders (bool) : an input.bool() used to remove the borders from box drawings
โโโโ silverBulletLongTP (series silverBulletLevels)
โโโโ historicalPoints (array)
โโโโ historicalData (necessaryData)
โโโโ silverBulletLongSL (series silverBulletLevels)
โโโโ silverBulletShortTP (series silverBulletLevels)
โโโโ silverBulletShortSL (series silverBulletLevels)
โโReturns: void
method invalidFVGcheck(FVGarr, upFVGpricesSorted, dnFVGpricesSorted)
โโcheck if existing FVGs are still valid
โโNamespace types: array
โโParameters:
โโโโ FVGarr (array)
โโโโ upFVGpricesSorted (array) : an array of bullish FVG prices, used to selective search through FVG array to remove invalidated levels
โโโโ dnFVGpricesSorted (array) : an array of bearish FVG prices, used to selective search through FVG array to remove invalidated levels
โโReturns: void (0)
method drawFVG(counter, FVGshow, FVGname, FVGcol, data, masterCoords, labelLevels, borderTransp, liteMode, rightCoordinate)
โโdraws FVGs on last bar
โโNamespace types: map
โโParameters:
โโโโ counter (map) : a counter, as map, keeping count of the number of FVGs drawn, makes sure that there aren't more FVGs drawn
than int FVGshow
โโโโ FVGshow (int) : the number of FVGs to show. There should be a bullish FVG show and bearish FVG show. This function "drawFVG" is used separately
for bearish FVG and bullish FVG.
โโโโ FVGname (string) : the name of the FVG, "FVG Up" or "FVG Down"
โโโโ FVGcol (color) : desired FVG color
โโโโ data (FVG)
โโโโ masterCoords (map) : a map containing the names and price points of key levels. Used to define price ranges.
โโโโ labelLevels (string) : an input.string with options "Inside", "Outside", "Remove". Determines whether FVG labels should be inside box, outside,
or na.
โโโโ borderTransp (int)
โโโโ liteMode (bool)
โโโโ rightCoordinate (int) : the right coordinate of any drawings. Must be a time point.
โโReturns: void
invalidBlockCheck(bullishOBbox, bearishOBbox, userTF)
โโcheck if existing order blocks are still valid
โโParameters:
โโโโ bullishOBbox (array) : an array declared using the UDT orderBlock that contains bullish order block related data
โโโโ bearishOBbox (array) : an array declared using the UDT orderBlock that contains bearish order block related data
โโโโ userTF (simple int)
โโReturns: void (0)
method lastBarRejections(id, rejectionColor, idShow, rejectionString, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords)
โโdraws rejectionBlocks on last bar
โโNamespace types: array
โโParameters:
โโโโ id (array) : the array, an array of rejection block data declared using the UDT rejection block
โโโโ rejectionColor (color) : the desired color of the rejection box
โโโโ idShow (int)
โโโโ rejectionString (string) : the desired name of the rejection blocks
โโโโ labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
โโโโ borderTransp (int)
โโโโ liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
โโโโ rightCoordinate (int) : atime for the right coordinate of the box
โโโโ masterCoords (map) : a map that stores the price of key levels and assigns them a name, used to determine price ranges
โโReturns: void
method OBdraw(id, OBshow, BBshow, OBcol, BBcol, bullishString, bearishString, isBullish, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords)
โโdraws orderblocks and breaker blocks for data stored in UDT array()
โโNamespace types: array
โโParameters:
โโโโ id (array) : the array, an array of order block data declared using the UDT orderblock
โโโโ OBshow (int) : the number of order blocks to show
โโโโ BBshow (int) : the number of breaker blocks to show
โโโโ OBcol (color) : color of order blocks
โโโโ BBcol (color) : color of breaker blocks
โโโโ bullishString (string) : the title of bullish blocks, which is a regular bullish orderblock or a bearish orderblock that's converted to breakerblock
โโโโ bearishString (string) : the title of bearish blocks, which is a regular bearish orderblock or a bullish orderblock that's converted to breakerblock
โโโโ isBullish (bool) : whether the array contains bullish orderblocks or bearish orderblocks. If bullish orderblocks,
the array will naturally contain bearish BB, and if bearish OB, the array will naturally contain bullish BB
โโโโ labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
โโโโ borderTransp (int)
โโโโ liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
โโโโ rightCoordinate (int) : atime for the right coordinate of the box
โโโโ masterCoords (map) : a map that stores the price of key levels and assigns them a name, used to determine price ranges
โโReturns: void
FVG
โโUDT for FVG calcualtions
โโFields:
โโโโ H (series float) : high price of user-selected timeframe
โโโโ L (series float) : low price of user-selected timeframe
โโโโ direction (series string) : FVG direction => "Up" or "Down"
โโโโ T (series int) : => time of bar on user-selected timeframe where FVG was created
โโโโ fvgLabel (series label) : optional label for FVG
โโโโ fvgLineTop (series line) : optional line for top of FVG
โโโโ fvgLineBot (series line) : optional line for bottom of FVG
โโโโ fvgBox (series box) : optional box for FVG
labelLine
โโquickly pair a line and label together as UDT
โโFields:
โโโโ lin (series line) : Line you wish to pair with label
โโโโ lab (series label) : Label you wish to pair with line
orderBlock
โโUDT for order block calculations
โโFields:
โโโโ orderBlockData (array) : array containing order block x and y points
โโโโ orderBlockBox (series box) : optional order block box
โโโโ vioCount (series int) : = 0 violation count of the order block. 0 = Order Block, 1 = Breaker Block
โโโโ traded (series bool)
โโโโ status (series string) : = "OB" status == "OB" => Level is order block. status == "BB" => Level is breaker block.
โโโโ orderBlockLab (series label) : options label for the order block / breaker block.
strongPoints
โโUDT for strong highs and strong lows
โโFields:
โโโโ price (series float) : price of the strong high or strong low
โโโโ timeAtprice (series int) : time of the strong high or strong low
โโโโ strongPointLabel (series label) : optional label for strong point
โโโโ strongPointLine (series line) : optional line for strong point
โโโโ overlayLine (series line) : optional lines for strong point to enhance visibility
โโโโ overlayLine2 (series line) : optional lines for strong point to enhance visibility
displacement
โโUDT for dispacements
โโFields:
โโโโ highPrice (series float) : high price of displacement
โโโโ lowPrice (series float) : low price of displacement
โโโโ timeAtPrice (series int) : time of bar where displacement occurred
โโโโ displacementBox (series box) : optional box to draw displacement
โโโโ displacementLab (series label) : optional label for displacement
po3data
โโUDT for po3 calculations
โโFields:
โโโโ dHigh (series float) : higher timeframe high price
โโโโ dLow (series float) : higher timeframe low price
โโโโ dOpen (series float) : higher timeframe open price
โโโโ dClose (series float) : higher timeframe close price
โโโโ po3box (series box) : box to draw po3 candle body
โโโโ po3line (array) : line array to draw po3 wicks
โโโโ po3Labels (array) : label array to label price points of po3 candle
macros
โโUDT for session macros
โโFields:
โโโโ sessions (array) : Array of sessions, you can populate this array using the "quickTime" function located above "export macros".
โโโโ prices (matrix) : Matrix of session data -> open, high, low, close, time
โโโโ sessionTimes (array) : Array of session names. Pairs with array sessions.
โโโโ sessionLines (matrix) : Optional array for sesion drawings.
OTEtimes
โโUDT for data storage and drawings associated with OTE strategy
โโFields:
โโโโ upTimes (array) : time of highest point before trade is taken
โโโโ dnTimes (array) : time of lowest point before trade is taken
โโโโ tpLineLong (series line) : line to mark tp level long
โโโโ tpLabelLong (series label) : label to mark tp level long
โโโโ slLineLong (series line) : line to mark sl level long
โโโโ slLabelLong (series label) : label to mark sl level long
โโโโ tpLineShort (series line) : line to mark tp level short
โโโโ tpLabelShort (series label) : label to mark tp level short
โโโโ slLineShort (series line) : line to mark sl level short
โโโโ slLabelShort (series label) : label to mark sl level short
sweeps
โโUDT for data storage and drawings associated with liquidity sweeps
โโFields:
โโโโ upSweeps (matrix) : matrix containing liquidity sweep price points and time points for up sweeps
โโโโ dnSweeps (matrix) : matrix containing liquidity sweep price points and time points for down sweeps
โโโโ upSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
โโโโ dnSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
raidExitDrawings
โโUDT for drawings associated with the Liquidity Raid Strategy
โโFields:
โโโโ tpLine (series line) : tp line for the liquidity raid entry
โโโโ tpLabel (series label) : tp label for the liquidity raid entry
โโโโ slLine (series line) : sl line for the liquidity raid entry
โโโโ slLabel (series label) : sl label for the liquidity raid entry
m2022
โโUDT for data storage and drawings associated with the Model 2022 Strategy
โโFields:
โโโโ mTime (series int) : time of the FVG where entry limit order is placed
โโโโ mIndex (series int) : array index of FVG where entry limit order is placed. This requires an array of FVG data, which is defined above.
โโโโ mEntryDistance (series float) : the distance of the FVG to the 50% range. M2022 looks for the fvg closest to 50% mark of range.
โโโโ mEntry (series float) : the entry price for the most eligible fvg
โโโโ fvgHigh (series float) : the high point of the eligible fvg
โโโโ fvgLow (series float) : the low point of the eligible fvg
โโโโ longFVGentryBox (series box) : long FVG box, used to draw the eligible FVG
โโโโ shortFVGentryBox (series box) : short FVG box, used to draw the eligible FVG
โโโโ line50P (series line) : line used to mark 50% of the range
โโโโ line100P (series line) : line used to mark 100% (top) of the range
โโโโ line0P (series line) : line used to mark 0% (bottom) of the range
โโโโ label50P (series label) : label used to mark 50% of the range
โโโโ label100P (series label) : label used to mark 100% (top) of the range
โโโโ label0P (series label) : label used to mark 0% (bottom) of the range
โโโโ sweepData (array)
silverBullet
โโUDT for data storage and drawings associated with the Silver Bullet Strategy
โโFields:
โโโโ session (series bool)
โโโโ sessionStr (series string) : name of the session for silver bullet
โโโโ sessionBias (series string)
โโโโ sessionHigh (series float) : = high high of session // use math.max(silverBullet.sessionHigh, high)
โโโโ sessionLow (series float) : = low low of session // use math.min(silverBullet.sessionLow, low)
โโโโ sessionFVG (series float) : if applicable, the FVG created during the session
โโโโ sessionFVGdraw (series box) : if applicable, draw the FVG created during the session
โโโโ traded (series bool)
โโโโ tp (series float) : tp of trade entered at the session FVG
โโโโ sl (series float) : sl of trade entered at the session FVG
โโโโ sessionDraw (series box) : optional draw session with box
โโโโ sessionDrawLabel (series label) : optional label session with label
silverBulletDrawings
โโUDT for trade exit drawings associated with the Silver Bullet Strategy
โโFields:
โโโโ tpLine (series line) : tp line drawing for strategy
โโโโ tpLabel (series label) : tp label drawing for strategy
โโโโ slLine (series line) : sl line drawing for strategy
โโโโ slLabel (series label) : sl label drawing for strategy
unicornModel
โโUDT for data storage and drawings associated with the Unicorn Model Strategy
โโFields:
โโโโ hPoint (chart.point)
โโโโ hPoint2 (chart.point)
โโโโ hPoint3 (chart.point)
โโโโ breakerBlock (series box) : used to draw the breaker block required for the Unicorn Model
โโโโ FVG (series box) : used to draw the FVG required for the Unicorn model
โโโโ topBlock (series float) : price of top of breaker block, can be used to detail trade entry
โโโโ botBlock (series float) : price of bottom of breaker block, can be used to detail trade entry
โโโโ startBlock (series int) : start time of the breaker block, used to set the "left = " param for the box
โโโโ includes (array) : used to store the time of the breaker block, or FVG, or the chart point sequence that setup the Unicorn Model.
โโโโ entry (series float) : // eligible entry price, for longs"math.max(topBlock, FVG.get_top())",
โโโโ tpLine (series line) : optional line to mark PT
โโโโ tpLabel (series label) : optional label to mark PT
โโโโ slLine (series line) : optional line to mark SL
โโโโ slLabel (series label) : optional label to mark SL
rejectionBlocks
โโUDT for data storage and drawings associated with rejection blocks
โโFields:
โโโโ rejectionPoint (chart.point)
โโโโ bodyPrice (series float) : candle body price closest to the rejection point, for "Up" rejections => math.max(open, close),
โโโโ rejectionBox (series box) : optional box drawing of the rejection block
โโโโ rejectionLabel (series label) : optional label for the rejection block
equalLevelsDraw
โโUDT for data storage and drawings associated with equal highs / equal lows
โโFields:
โโโโ connector (series line) : single line placed at the first high or low, y = avgerage of distinguished equal highs/lows
โโโโ connectorLab (series label) : optional label to be placed at the highs or lows
โโโโ levels (array) : array containing the equal highs or lows prices
โโโโ times (array) : array containing the equal highs or lows individual times
โโโโ startTime (series int) : the time of the first high or low that forms a sequence of equal highs or lows
โโโโ radiate (array) : options label to "radiate" the label in connector lab. Can be used for anything
necessaryData
โโUDT for data storage of historical price points.
โโFields:
โโโโ highArr (array) : array containing historical high points
โโโโ lowArr (array) : array containing historical low points
โโโโ timeArr (array) : array containing historical time points
โโโโ logArr (array) : array containing historical log returns
โโโโ signArr (array) : array containing historical price directions
โโโโ closeArr (array) : array containing historical close points
โโโโ binaryTimeArr (array) : array containing historical time points, uses "push" instead of "unshift" to allow for binary search
โโโโ binaryCloseArr (array) : array containing historical close points, uses "push" instead of "unshift" to allow the correct
โโโโ binaryOpenArr (array) : array containing historical optn points, uses "push" instead of "unshift" to allow the correct
โโโโ atrTFarr (array) : array containing historical user-selected TF atr points
โโโโ openArr (array) : array containing historical open points
ICT/SMC HUDOverview
This indicator is an ICT/SMC-inspired market structure tool that detects:
Swing Structure (pivot-based)
BOS (Break of Structure) and CHoCH (Change of Character)
Liquidity Sweeps (buy-side & sell-side)
Premium/Discount filter using a simple equilibrium (EQ) midpoint
A Hold Score (0โ5) system calculated from a higher timeframe (HTF)
Optional TP/SL visualization box (with TP2 expansion when Hold Score is strong)
โ ๏ธ This is an educational tool, not a guaranteed trading system.
Core Logic (Where signals come from)
This script builds a simplified ICT/SMC framework using 3 layers:
1) Market Structure via Swings (Pivot High/Low)
The script finds swing highs/lows using:
ta.pivothigh(high, swingLen, swingLen)
ta.pivotlow(low, swingLen, swingLen)
These swings become the reference points for structure breaks.
2) BOS / CHoCH Detection
BOS Up = price closes above the last swing high
BOS Down = price closes below the last swing low
trend updates to 1 (bullish) or -1 (bearish) based on BOS
CHoCH triggers when BOS occurs against the current trend
CHoCH Up = trend was bearish, then BOS Up happens
CHoCH Down = trend was bullish, then BOS Down happens
3) Liquidity Sweep + Premium/Discount Filter
Sell-side sweep: low breaks below last swing low, but closes back above it
Buy-side sweep: high breaks above last swing high, but closes back below it
Equilibrium (EQ) midpoint is:
(lastSwingHigh + lastSwingLow) / 2
Discount = price below EQ
Premium = price above EQ
Signal Rules (Buy / Sell)
Buy Signal
Sell-side sweep + (CHoCH Up or BOS Up)
OR
BOS Up while price is in Discount
Sell Signal
Buy-side sweep + (CHoCH Down or BOS Down)
OR
BOS Down while price is in Premium
Hold Score System (0โ5) โ HTF confirmation
The script calculates a Hold Score from HTF using 5 checks:
HTF EMA Bias
Bullish hold bias: EMA Fast > EMA Mid
Bearish hold bias: EMA Fast < EMA Mid
Volatility Expansion
Uses HTF Bollinger Band width; if width is increasing, expansion is โOKโ
Mid Acceptance
HTF close relative to HTF BB basis (SMA)
Follow-through after Entry
Requires N consecutive bars closing in favor of the entry direction
No Opposite Break
Avoid holding if opposite BOS/CHoCH appears
Hold Score = sum of the 5 checks (0โ5)
TP/SL Box (Optional)
When a new Buy/Sell signal occurs:
Entry is set at current close
SL uses:
Swing-based stop (lowest/ highest of last N bars)
optional ATR buffer
TP1 and TP2 are set using Risk:Reward ratios
TP2 Expansion (Optional)
If Hold Score โฅ threshold:
TP2 RR increases by extraRRonHold
Can be set to expand only (never shrink)
Auto-hide TP/SL Drawings (Optional)
If enabled, the TP/SL box/lines/labels will automatically disappear after N bars.
This is useful for clean charts while still keeping Hold Score logic running.
Best Use Cases
โ
Works best during liquidity sessions:
London Killzone
New York Killzone
โ
Recommended timeframes:
Structure: 15m / 1h
Entry refinement: 5m / 1m
Hold Score HTF: 1h or 4h
Inputs Guide (Quick)
Swing length (Structure): controls swing sensitivity (higher = fewer swings)
Hold Score HTF: HTF used for Hold Score confirmation
TP/SL Box: visualization tool, not order execution
Auto-hide: removes drawings after N bars for clean charts
TP2 Expand: increases TP2 target when Hold Score is strong
Disclaimer
This indicator does not place trades and does not guarantee profits. Always manage risk, backtest, and validate with your own strategy.
Multi-Timeframe SFP + SMTImportant: Please Read First
This indicator is not a "one size fits all" solution. It is a professional and complex tool that requires you to learn how to use it, in addition to backtesting different settings to discover what works best for your specific trading style and the assets you trade. The default settings provided are my personal preferences for trading higher-timeframe setups, but you are encouraged to experiment and find your own optimal configuration.
Please note that while this initial version is solid, it may still contain small errors or bugs. I will be actively working on improving the indicator over time. Also, be aware that the script is not written for maximum efficiency and may be resource-intensive, but this should not pose a problem for most users.
The source code for this indicator is open. If you truly want to understand precisely how all the logic works, you can copy and paste the code into an AI assistant like Gemini or ChatGPT and ask it to explain any part of the script to you.
Author's Preferred Settings (Guideline)
As a starting point, here are the settings I personally use for my trading:
SFP Timeframe: 4-Hour (Strength: 5-5)
Max Lookback: 35 Bars
Raid Expiration: 1 Bar
SFP Lines Limit: 1
SMT Timeframe 1: 30-Minute (Strength: 2-2) with 3-Minute LTF Detection.
SMT Timeframe 2: 15-Minute (Strength: 3-3) with 3-Minute LTF Detection.
SMT Timeframe 3: 1-Hour (Strength: 1-1) with 3-Minute LTF Detection.
SMT Timeframe 4: 15-Minute (Strength: 1-1) with 3-Minute LTF Detection.
Multi-Timeframe SMT: An Overview
This indicator is a powerful tool designed to identify high-probability trading setups by combining two key institutional concepts: Swing Failure Patterns (SFP) on a higher timeframe and Smart Money Technique (SMT) divergences on a lower timeframe. A key feature is the ability to configure and run up to four independent SMT analyses simultaneously, allowing you to monitor for divergences across multiple timeframes (e.g., 15m, 1H, 4H) from a single indicator.
Its primary purpose is to generate automated signals through TradingView's alert system. By setting up alerts, the script runs server-side, monitoring the market for you. When a setup presents itself, it will send a push notification to your device, allowing you to personally evaluate the trade without being tied to your screen.
The Strategy: HTF Liquidity Sweeps into LTF SMT
The core strategy is built on a classic institutional trading model:
Wait for a liquidity sweep on a significant high timeframe (e.g., 4-hour, Daily).
Once liquidity is taken, look for a confirmation of a shift in market structure on a lower timeframe.
This indicator uses an SMT divergence as that confirmation signal, indicating that smart money may be stepping in to reverse the price.
How It Works: The Two-Step Process
The indicator's logic follows a precise two-step process to generate a signal:
Step 1: The Swing Failure Pattern (SFP)
First, the indicator identifies a high-timeframe liquidity sweep. This is configured in the "Swing Failure Pattern (SFP) Timeframe" settings.
It looks for a candle that wicks above a previous high (or below a previous low) but then closes back within the range of that pivot. This action is known as a "raid" or a "swing failure," suggesting the move failed to find genuine momentum.
Step 2: The SMT Divergence
The moment a valid SFP is confirmed, the indicator's multiple SMT engines activate.
Each engine begins monitoring the specific SMT timeframe you have configured (e.g., "SMT Timeframe 1," "SMT Timeframe 2," etc.) for a Smart Money Technique (SMT) divergence.
An SMT divergence occurs when two closely correlated assets fail to move in sync. For example, after a raid on a high, Asset A makes a new high, but Asset B fails to do so. This disagreement suggests weakness and a potential reversal.
When the script finds this divergence, it plots the SMT line and triggers an alert.
The Power of Alerts
The true strength of this indicator lies in its alert capabilities. You can create alerts for both unconfirmed and confirmed SMTs.
Enable Alerts LTF Detection: These alerts trigger when an unconfirmed, potential SMT is spotted on the lower "LTF Detection" timeframe. While not yet confirmed, these early alerts can notify you of a potential move before it fully happens, allowing you to be ahead of the curve and find the best possible trade entries.
Enable Alerts Confirmed SMT: These alerts trigger only when a permanent, confirmed SMT line is plotted on your chosen SMT timeframe. These signals are more reliable but occur later than the early detection alerts.
Key Concepts Explained
What is Pivot Strength?
Pivot Strength determines how significant a high or low needs to be to qualify as a valid structural point. A setting of 5-5, for example, means that for a candle's high to be considered a valid pivot high, its high must be higher than the highs of the 5 candles to its left and the 5 candles to its right.
Higher Strength (e.g., 5-5, 8-8): Creates fewer, but more significant, pivots. This is ideal for identifying major structural highs and lows on higher timeframes.
Lower Strength (e.g., 2-2, 3-3): Creates more pivots, making it suitable for identifying the smaller shifts in momentum on lower timeframes.
Raid Expiration & Validity
An SFP signal is not valid forever. The "Raid Expiration" setting determines how many SFP timeframe bars can pass after a raid before that signal is considered "stale" and can no longer be used to validate an SMT. This ensures your SMT divergences are always in response to recent liquidity sweeps.
Why You Must Be on the Right Chart Timeframe to See SMT Lines
Pine Scriptโข has a fundamental rule: an indicator running on a chart can only "see" the bars of that chart's timeframe or higher.
When the SMT logic is set to the 15-minute timeframe, it calculates its pivots based on 15-minute data. To accurately plot lines connecting these pivots, you must be on a 15-minute chart or lower (e.g., 5-minute, 1-minute).
If you are on a higher timeframe chart, like the 1-hour, the 15-minute bars do not exist on that chart, so the indicator has no bars to draw the lines on.
This is precisely why the alert system is so powerful. You can set your alert to run on the 15-minute timeframe, and TradingView's servers will monitor that timeframe for you, sending a notification regardless of what chart you are currently viewing.






















