Indicator

Indicator

Indicator

Indicator

Indicator

ICT Power of 3 with Multi Bar and HTF EMA Display : PO3MyFXRoom HTF Bar Rejection — Higher Timeframe Overlay Indicator
This indicator plots higher timeframe candles directly onto your current chart, so you can analyse HTF price action and structure without switching between timeframes.
What it does:
Instead of flipping between charts, you get up to 15 candles from your chosen higher timeframe (H1, H4, Daily, Weekly or any other) displayed as a clean overlay on the right side of your chart.
Each candle shows the full body and wicks, colour-coded to match bullish and bearish price action.
Features:
HTF Candle Overlay — displays up to 15 higher timeframe bars directly on your chart
Fair Value Gaps — detects and highlights FVGs on both the current timeframe and the HTF overlay, so you can see where price may draw to
HTF Opening Price Line — marks the current HTF bar's opening price with a horizontal line for quick reference
Liquidity Grabs & Failed Breaks — automatically identifies when price grabs a high or low and fails to close beyond it, marking potential reversal points
Dual EMA (25 & 50) — plots both EMAs across the HTF overlay bars so you can gauge trend direction on the higher timeframe at a glance
EMA Trend Filter — long signals only when the 25 EMA is above the 50, short signals only when below
Fully customisable — colours, line styles, candle width, and positioning all adjustable
Who it's for:
Traders who use multi-timeframe analysis and want to keep their higher timeframe context visible at all times — particularly useful for ICT-based concepts including Power of 3, Fair Value Gaps, and liquidity. Indicator

ICT Power of 3 with Multi Bar and HTF EMA Display : PO3MyFXRoom HTF Bar Rejection — Higher Timeframe Overlay Indicator
This indicator plots higher timeframe candles directly onto your current chart, so you can analyse HTF price action and structure without switching between timeframes.
What it does:
Instead of flipping between charts, you get up to 15 candles from your chosen higher timeframe (H1, H4, Daily, Weekly or any other) displayed as a clean overlay on the right side of your chart. Each candle shows the full body and wicks, colour-coded to match bullish and bearish price action.
Features:
HTF Candle Overlay — displays up to 15 higher timeframe bars directly on your chart
Fair Value Gaps — detects and highlights FVGs on both the current timeframe and the HTF overlay, so you can see where price may draw to
HTF Opening Price Line — marks the current HTF bar's opening price with a horizontal line for quick reference
Liquidity Grabs & Failed Breaks — automatically identifies when price grabs a high or low and fails to close beyond it, marking potential reversal points
Dual EMA (25 & 50) — plots both EMAs across the HTF overlay bars so you can gauge trend direction on the higher timeframe at a glance
EMA Trend Filter — long signals only when the 25 EMA is above the 50, short signals only when below
Fully customisable — colours, line styles, candle width, and positioning all adjustable
Who it's for:
Traders who use multi-timeframe analysis and want to keep their higher timeframe context visible at all times — particularly useful for ICT-based concepts including Power of 3, Fair Value Gaps, and liquidity. Indicator

Fair Value Gap Rejection AlertsOverview
The Fair Value Gap (FVG) Finder is a versatile Pine Script™ v6 indicator designed to identify price inefficiencies in the market, commonly known as Fair Value Gaps. These gaps represent areas where price has moved rapidly, leaving behind unbalanced regions that often act as support or resistance levels. This script highlights bullish (upward) and bearish (downward) FVGs as colored boxes on your chart, making it easy to spot potential reversal or continuation zones.
Building on standard FVG concepts, this indicator includes advanced features like automatic rejection detection. A rejection occurs when price wicks into the FVG but closes outside it, signaling a potential bounce without filling the gap. Bullish rejections (support bounces) are marked with green upward triangles below the bar, while bearish rejections (resistance bounces) use red downward triangles above the bar. Only the first rejection per FVG is tagged to avoid clutter.
The script also supports alerts for these rejections, allowing you to set up notifications in PulseWire for timely trading decisions. Gaps are drawn for a user-defined length but can detect rejections and fills beyond the visible box if needed.
Key Features
FVG Detection: Automatically identifies bullish FVGs (green boxes) when there's an upward price gap exceeding the minimum size, and bearish FVGs (red boxes) for downward gaps.
Rejection Logic: Detects wick-based rejections without gap filling. Bullish: Low enters the FVG but close is above. Bearish: High enters but close is below.
Alerts: Separate alerts for bullish and bearish rejections, configurable via PulseWire's alert system (use "alert() function calls only").
Visual Tags: Triangles mark rejection candles for quick visual confirmation.
Customization: Inputs include gap length, minimum gap size (manual or ATR-based), option to show only the latest gap, and delete filled gaps. Style options for colors, label sizes, and more.
Filling Mechanism: Optionally deletes boxes once price fully closes into the gap, indicating it's been mitigated.
How to Use
Add the indicator to your chart via PulseWire's Pine Editor.
Adjust inputs in the settings panel:
Gap Length: Controls how far the box extends (default: 60 bars).
Minimum Gap Size: Set manually or auto-adjust with ATR(14) for adaptive filtering.
Only Show Latest Gap: Limits display to the most recent FVG.
Delete Filled Gaps: Removes boxes after price fills them.
Styles: Customize colors and label sizes for better visibility.
Monitor the chart for FVG boxes. Watch for triangle shapes indicating rejections—these often signal entry points (e.g., buy on bullish rejection).
Set up alerts: In PulseWire, create alerts based on the indicator's "Bullish FVG Rejection" or "Bearish FVG Rejection" conditions.
Best used on timeframes like 5M-1H for intraday trading, or higher for swing setups. Combine with other tools like volume or trend lines for confirmation.
This indicator is inspired by Inner Circle Trader (ICT) and Smart Money Concepts (SMC) but includes original enhancements like per-gap rejection tracking to prevent multiple signals on the same zone. It does not guarantee profits and should be used as part of a broader strategy with proper risk management.
No external dependencies or subscriptions required—fully self-contained in Pine Script™ v6. Indicator

Indicator

VWAP Rejection + CISD AlertVWAP Rejection + CISD Alert — Full Backtest Table + Entry Time Window
This powerful intraday ICT-style indicator automatically detects high-probability VWAP Rejection + CISD setups and gives you everything you need to trade them with precise risk management.
Strategy Rules (all must align):
VWAP Rejection: Candle body fully above VWAP (bullish) or below VWAP (bearish) with a wick touching VWAP.
CISD Confirmation: Strong reversal candle after minimum consecutive opposite candles (default 2), breaking the prior high/low, and occurring within max bars after rejection (default 2).
Extra Filters:
CISD candle must open above VWAP (longs) or below VWAP (shorts).
CISD candle must close above/below your chosen Moving Average (SMA/EMA/WMA/VWMA – fully adjustable).
Entry: At the open of the very next candle after CISD confirmation.
Stop Loss: Choose between:
Open of the CISD candle (original)
Extreme wick of the VWAP rejection candle (low for longs / high for shorts)
Take Profit: User-defined multiplier (default 2R) from entry.
Visuals & Tools:
Small REJ↑ / REJ↓ labels on rejection candles
Large lime/fuchsia CISD↑ / CISD↓ triangles on confirmation
Detailed ENTRY LONG/SHORT labels showing exact Open, SL, and TP prices
Horizontal lines (Entry dashed blue, SL red, TP green) starting at the CISD candle and automatically stopping when price hits SL or TP
Yellow TP and Blue SL hit triangles marking exact exit candles
Live Performance Table (top-right) showing:
Total Trades
Wins / Losses
Win Rate %
Current TP Multiplier
Key Inputs:
CISD Settings: Min consecutive candles, Max bars after rejection
Risk Management: TP Multiplier, SL Placement (2 options)
Moving Average Filter: Length + Type (SMA/EMA/WMA/VWMA)
Time Filter: Entry Time Window (default 8:00–11:00 AM EST)
Visual toggles for labels, lines, and CISD shapes
Alerts:
Set alerts on “CISD Confirmed → LONG Setup” or “SHORT Setup”.
Alerts fire the moment the CISD candle closes — perfect timing to enter at the next open.
Ideal for 1m–15m charts on indices, forex, and futures. Combines classic VWAP rejection with ICT CISD concepts plus strict filters for cleaner, higher-probability trades. Indicator

Institutional Structure Intelligence Engine [JOAT]Institutional Structure Intelligence Engine
Introduction
The Institutional Structure Intelligence Engine is an advanced open-source market structure indicator that combines swing detection, order block analysis, fair value gap (FVG) identification, institutional level tracking, and velocity analysis into a comprehensive structural intelligence system. This indicator helps traders identify where institutional orders are positioned, where price inefficiencies exist, and how market structure is evolving in real-time.
Unlike basic support/resistance indicators that draw static lines, this engine dynamically tracks institutional footprints through order blocks (zones where institutions accumulated or distributed), fair value gaps (price inefficiencies that often get filled), breaker blocks (failed order blocks signaling reversals), and multi-timeframe institutional levels. The indicator is designed for traders who understand that market structure reveals institutional intent and that price gravitates toward areas of institutional interest.
Why This Indicator Exists
This indicator addresses the challenge of identifying institutional positioning in real-time. Institutional traders leave structural footprints that can be detected through systematic analysis. By combining multiple structural methodologies, this indicator reveals:
Order Block Detection: Identifies zones where institutions accumulated or distributed positions before major moves
Fair Value Gaps: Detects price inefficiencies where rapid institutional movement left unfilled gaps
Breaker Blocks: Tracks failed order blocks that signal potential trend reversals
Institutional Levels: Monitors Weekly/Daily highs and lows, Premium/Discount zones, and Golden Zone (0.618-0.5 Fibonacci)
Structure Velocity: Measures how quickly market structure is forming to identify momentum shifts
Compression Zones: Detects periods of range compression that often precede explosive moves
Each component provides a different structural perspective. Order blocks show where institutions positioned, FVGs show where price moved inefficiently, breaker blocks show where structure failed, institutional levels show key reference points, velocity shows momentum, and compression zones show coiling energy. Together, they create a comprehensive structural intelligence system.
Below showing the Main Features and how it works:
Core Components Explained
1. Advanced Order Block Detection
Order blocks are identified using strict volume and price action criteria:
Bullish Order Block:
// Two consecutive down candles followed by strong up move
if close < open and close < open and close > open and
volume > avgVolume * obVolumeThreshold and
close > high and
(high - low ) <= atr * maxATRMult and
(close - open) > atr * 0.5
Bearish Order Block:
// Two consecutive up candles followed by strong down move
if close > open and close > open and close < open and
volume > avgVolume * obVolumeThreshold and
close < low and
(high - low ) <= atr * maxATRMult and
(open - close) > atr * 0.5
Order blocks represent the last opposite-direction move before a strong impulse. The logic: institutions accumulate/distribute in the opposite direction before pushing price in their intended direction. The indicator tracks:
Order block volume (total volume during formation)
Number of touches (how many times price returned to the zone)
Zone strength (calculated from volume, touches, and age)
Breaker status (whether the order block was invalidated)
Overlapping Order Block Combination:
When multiple order blocks overlap, the indicator combines them into a single stronger zone:
if doOBsOverlap(ob1, ob2)
ob1.top := math.max(ob1.top, ob2.top)
ob1.bottom := math.min(ob1.bottom, ob2.bottom)
ob1.obVolume += ob2.obVolume
ob1.touches += ob2.touches
ob1.strength := math.max(ob1.strength, ob2.strength)
This prevents chart clutter and highlights the most significant institutional zones.
2. Breaker Block Detection
Breaker blocks are order blocks that failed - price broke through them instead of bouncing. This signals potential trend reversal:
// Bullish OB becomes breaker if price breaks below
if low < ob.bottom
ob.breaker := true
ob.breakTime := time
// Bearish OB becomes breaker if price breaks above
if high > ob.top
ob.breaker := true
ob.breakTime := time
Breaker blocks are displayed with distinct colors (cyan for bullish breakers, orange for bearish breakers) to differentiate them from active order blocks. When an order block becomes a breaker, it often signals that institutional positioning has changed and the previous structure is no longer valid.
3. Fair Value Gap (FVG) Detection
FVGs are identified using strict gap and volume criteria:
Bullish FVG:
// Gap between 2 bars ago high and current low
bool bullishFVGDetected = low > high and
(low - high ) > atr * 0.3 and // Minimum gap size
volume > avgVolume * 0.8 // Volume confirmation
Bearish FVG:
// Gap between 2 bars ago low and current high
bool bearishFVGDetected = high < low and
(low - high) > atr * 0.3 and // Minimum gap size
volume > avgVolume * 0.8 // Volume confirmation
FVGs represent price inefficiencies where institutional orders moved price so quickly that normal auction process was bypassed. These gaps often get "filled" as price returns to establish fair value. The indicator tracks:
FVG top and bottom prices
Mitigation status (whether the gap has been filled)
Mitigation bar (when the gap was filled)
Only non-mitigated FVGs are displayed to keep charts clean. Maximum FVG count is customizable (default: 3) to prevent clutter.
Showing Order Block, Breaker Block, and All Combined OB's that occured:
4. Institutional Level Tracking
The indicator monitors key institutional reference levels:
Weekly High/Low:
float lastWeekHigh = request.security(syminfo.tickerid, "W", high )
float lastWeekLow = request.security(syminfo.tickerid, "W", low )
Daily High/Low:
float yesterdayHigh = request.security(syminfo.tickerid, "D", high )
float yesterdayLow = request.security(syminfo.tickerid, "D", low )
Premium/Discount Zones:
Based on weekly range:
Premium Zone: 70%-100% of weekly range (institutional selling zone)
Discount Zone: 0%-30% of weekly range (institutional buying zone)
Golden Zone: 50%-61.8% of weekly range (optimal entry zone)
float weekRange = lastWeekHigh - lastWeekLow
float premiumTop = lastWeekHigh
float premiumBot = lastWeekLow + (weekRange * 0.7)
float discountTop = lastWeekLow + (weekRange * 0.3)
float discountBot = lastWeekLow
float goldenTop = lastWeekLow + (weekRange * 0.618)
float goldenBot = lastWeekLow + (weekRange * 0.5)
These zones help traders identify where institutions are likely to buy (discount) or sell (premium), with the golden zone representing optimal risk:reward entries.
Breaker Block with VOL, Discount zone touched for signal, Market Phase + Quality of chart score:
5. Structure Velocity Analysis
The indicator measures how quickly market structure is forming:
// Price velocity
priceVelocity = ta.change(close, velocityLength) / velocityLength
velocityMA = ta.sma(math.abs(priceVelocity), velocityLength)
velocityScore = velocityMA > 0 ? math.abs(priceVelocity) / velocityMA : 0
// Volume momentum
volumeMomentum = volume / avgVolume
volumeAcceleration = ta.change(volumeMomentum, 5)
// Structure velocity (how fast structure is forming)
structureVelocity = (bar_index - lastSwingHighBar) + (bar_index - lastSwingLowBar)
High velocity indicates rapid structure formation (trending market), low velocity indicates slow structure formation (ranging market). Velocity analysis helps traders identify momentum shifts before they become obvious in price.
6. Compression to Expansion Detection
The indicator detects periods of range compression using strict criteria:
float rangeMA = ta.sma(high - low, 50)
float currentRange = high - low
bool compressed = currentRange < rangeMA * 0.3 and volume < avgVolume * 0.8
bool expanding = currentRange > rangeMA * 2.0 and volume > avgVolume * 1.3
Compression zones are only displayed if:
Compression lasted at least 10 bars
Range is less than 1.5x ATR (truly tight)
This prevents false compression signals and highlights only significant coiling periods that often precede explosive moves.
7. Swing Point Detection
The indicator uses pivot-based swing detection:
pivotHigh = ta.pivothigh(high, swingLength, swingLength)
pivotLow = ta.pivotlow(low, swingLength, swingLength)
Swing points are stored in arrays and used for:
Structure line drawing
Break of Structure (BOS) detection
Change of Character (CHOCH) detection
Trend determination
Swing length is customizable (default: 10) to adjust sensitivity.
Visual Elements
Order Block Boxes: Filled boxes showing bullish (green) and bearish (red) order blocks with volume and touch count
Breaker Block Boxes: Distinct colored boxes (cyan/orange) showing failed order blocks
FVG Boxes: Transparent boxes showing bullish (green) and bearish (red) fair value gaps
Institutional Lines: Weekly high/low (purple), Daily high/low (yellow)
Premium/Discount Fills: Shaded zones showing premium (red), discount (green), and golden (orange) zones
Compression Boxes: Purple boxes showing range compression periods
Swing Points: Triangle markers showing swing highs (red) and swing lows (green)
All visual elements use "locked" boxes that don't extend indefinitely, preventing chart clutter. Overlap prevention logic ensures boxes don't stack on top of each other.
Input Parameters
Structure Detection:
Swing Length: Period for pivot detection (default: 10, range: 3-50)
Show Swing Points: Toggle swing markers (default: enabled)
Show Structure Lines: Toggle structure lines (default: enabled)
Show Compression Zones: Toggle compression boxes (default: disabled to reduce clutter)
Order Blocks:
Show Order Blocks: Toggle order block boxes (default: enabled)
Combine Overlapping OBs: Merge overlapping order blocks (default: enabled)
Show Breaker Blocks: Toggle breaker block display (default: enabled)
Volume Threshold: Minimum volume multiplier for OB detection (default: 1.5)
Max Order Blocks: Maximum OBs to display (default: 3, range: 1-10)
Max ATR Multiplier: Maximum OB size relative to ATR (default: 2.5)
Market Structure:
Show Break of Structure: Toggle BOS markers (default: disabled to reduce clutter)
Show Change of Character: Toggle CHOCH markers (default: enabled)
Show Fair Value Gaps: Toggle FVG boxes (default: enabled)
Show FVG Mitigation: Track when FVGs are filled (default: enabled)
Max FVGs to Display: Maximum FVGs to show (default: 3, range: 1-10)
Institutional Levels:
Show Weekly High/Low: Toggle weekly levels (default: enabled)
Show Daily High/Low: Toggle daily levels (default: enabled)
Show Golden Zone: Toggle 0.618-0.5 Fib zone (default: enabled)
Show Premium/Discount Zones: Toggle institutional zones (default: enabled)
Velocity Analysis:
Show Structure Velocity: Toggle velocity calculations (default: enabled)
Velocity Period: Period for velocity analysis (default: 20, range: 5-50)
Display:
Table Position: Dashboard location (Top Right/Top Left/Bottom Right/Bottom Left)
Show Structure Quality Score: Toggle quality metrics (default: enabled)
Colors:
All colors are fully customizable including bullish/bearish structure, order blocks, breaker blocks, FVGs, weekly/daily levels, golden zone, premium/discount zones, and compression zones.
4HR TF BTCUSDT showing the zones being used in action and price movement:
How to Use This Indicator
Step 1: Identify Key Institutional Zones
Look for order blocks with high touch counts and strong volume. These represent areas where institutions are likely to defend their positions.
Step 2: Monitor Fair Value Gaps
FVGs often get filled as price returns to establish fair value. Look for entries when price approaches unfilled FVGs, especially if they align with order blocks.
Step 3: Watch for Breaker Blocks
When an order block becomes a breaker, it signals that institutional positioning has changed. This often marks trend reversals or significant structure shifts.
Step 4: Use Premium/Discount Zones
Look for long entries in discount zones (0-30% of range) and short entries in premium zones (70-100% of range). The golden zone (50-61.8%) offers optimal risk:reward.
Step 5: Check Institutional Levels
Weekly and daily highs/lows act as magnets for price. Breaks above/below these levels often lead to significant moves.
Step 6: Monitor Structure Velocity
High velocity indicates trending conditions (follow the trend), low velocity indicates ranging conditions (fade extremes).
Step 7: Wait for Compression Breakouts
Compression zones mark periods of coiling energy. Breakouts from compression often lead to explosive moves with strong follow-through.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal structure clarity
Combine order blocks with FVGs for high-probability entries
Wait for price to return to order blocks before entering - don't chase
Breaker blocks often become new support/resistance in opposite direction
Premium/discount zones work best in trending markets
Golden zone entries offer best risk:reward when combined with order blocks
Compression zones require patience - wait for confirmed breakout
Structure velocity helps determine whether to trade with trend or fade extremes
Multiple touches on an order block increase its significance
FVG fills often provide excellent entry opportunities with tight stops
Indicator Limitations
Order blocks don't always hold - institutions can change positioning
FVGs don't always get filled - some gaps persist indefinitely
Breaker blocks can fail - price can return above/below breaker zones
Premium/discount zones are relative to recent range - not absolute levels
Compression detection requires sufficient bars - may not work on new instruments
Structure velocity is a lagging indicator - confirms moves after they start
Maximum box/line limits (500 each) can be reached on lower timeframes with long history
Overlap prevention may hide some valid order blocks to prevent clutter
The indicator shows structure, not direction - requires trader interpretation
Works best on liquid instruments with clear institutional participation
Technical Implementation
Built with Pine Script v6 using:
Custom type definitions for OrderBlockInfo and FVGInfo
Array-based storage for order blocks, FVGs, and swing points
Strict volume and ATR-based filtering for accuracy
Overlap detection and combination logic for order blocks
Breaker block tracking with time-based invalidation
FVG mitigation detection
Multi-timeframe security requests for institutional levels
Fibonacci-based premium/discount zone calculations
Velocity and momentum analysis
Compression detection with strict criteria
Dynamic box and label management with anti-overlap logic
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This indicator is original in its comprehensive structural integration. While individual components (order blocks, FVGs, institutional levels) are established concepts, this indicator is justified because:
It combines seven distinct structural methodologies into a unified intelligence system
Order block detection uses strict multi-criteria filtering (volume, ATR, price action) for accuracy
Automatic order block combination prevents clutter while highlighting strongest zones
Breaker block tracking provides reversal signals not available in basic order block indicators
FVG detection includes mitigation tracking and strict size/volume filtering
Premium/discount zones integrate Fibonacci analysis with institutional levels
Structure velocity analysis provides momentum context for structural zones
Compression detection uses strict criteria to identify only significant coiling periods
Anti-overlap logic ensures clean charts without sacrificing information
Each component contributes unique structural intelligence: order blocks show institutional positioning, FVGs show inefficiencies, breaker blocks show failures, institutional levels show reference points, velocity shows momentum, and compression shows coiling energy. The indicator's value lies in presenting these complementary structural perspectives simultaneously with intelligent filtering and display management.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Market structure analysis is a tool for understanding institutional positioning, not a crystal ball for predicting future price movement. Order blocks, FVGs, and institutional levels do not guarantee profitable trades. Past structural patterns do not guarantee future structural patterns. Market conditions change, and strategies that worked historically may not work in the future.
The zones and levels displayed are mathematical calculations based on current market data, not predictions of future price movement. High-quality order blocks, unfilled FVGs, and premium/discount zones do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Quarterly Theory: Intraday Quarters - 6h Sessions, 90m & 22.5mThis indicator is a significantly modified and expanded version of the 90 Minute Cycle by HandlesHandled. It has been redesigned to align with Quarterly Theory principles while ensuring full compliance with PulseWire’s House Rules regarding modified scripts by providing original functionality and a unified user interface.
Core Enhancements & Original Features
While the foundational 90-minute session times are derived from the original source, this version introduces several exclusive features:
Expanded Multi-Timeframe Sessions: Beyond standard 90-minute cycles, this script adds hardcoded logic for 6-hour sessions (Q-T) and granular 22.5-minute Micro Quarters (U-BP).
"One Button" Global Styling: To solve the visual clutter of multi-timeframe indicators, I implemented a Global Styling system. This allows users to change the name and colour of all Q1, Q2, Q3, and Q4 instances across every timeframe (90m, 6h, and Micro) from a single set of inputs.
Master Visibility Toggles: Users can independently toggle the visibility of 90m Quarters, 6h Sessions, and Micro Sessions to keep their charts clean and focused.
Dynamic Visuals: The script utilizes a custom get_range function that manages box.new and label.new logic, allowing for real-time expansion of session boxes and automated label positioning at the session's high.
Advanced Timezone Handling: Added inputs for manual UTC offsets and a toggle to sync with Exchange Timezone, ensuring accuracy across different global markets.
Compliance & Attribution
In accordance with House Rules, this script is a significant modification of the original work by HandlesHandled. The session timing logic for the 90m cycles remains hardcoded as per the original source to maintain theoretical accuracy, while all styling, master toggles, and micro-session logic are original additions.
How to Use
Select Your View: Use the Master Visibility section to choose which quarterly cycles you want to see.
Customise Styling: Use the Global Styling section to set your preferred colours for Q1-Q4. These colours will automatically apply to all active sessions.
Adjust Time: Ensure your UTC offset matches your local or desired trading time for precise session alignment.
Indicator

SmartTrend Pro [WillyAlgoTrader]📡 SmartTrend Pro is an overlay indicator built around a custom trend detection algorithm — the Adaptive Volatility Trend Engine (AVTE) — that replaces the standard Supertrend approach with Ehlers Super Smoother filtering and Kaufman adaptive ATR bands. Every trend flip is scored by a multi-factor confluence system (0–100) before becoming a signal. The result is a trend-following tool that adapts to current volatility conditions, filters out low-confidence entries, and provides dynamic TP/SL levels — all with full anti-repaint protection.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A traditional Supertrend uses a simple moving average of True Range to calculate bands. This works in steady markets but produces false signals during volatility spikes and misses early reversals during compression. SmartTrend Pro replaces every component of this pipeline with an adaptive alternative, creating a system where each stage feeds the next:
Ehlers-filtered price → Kaufman-adaptive ATR → Volatility bands → Trend direction → Confluence scoring → Filtered signal → Risk levels
The Ehlers Super Smoother removes high-frequency noise from the price before the trend bands are calculated — this prevents the trend engine from reacting to random wicks. The Kaufman adaptive ATR widens bands when volatility is real (sustained directional movement) and tightens them during choppy, low-efficiency conditions — making the trend change threshold automatically adjust. The confluence scoring system then evaluates each trend flip against five independent market factors before allowing the signal to fire. And the TP/SL system freezes its risk distance at entry (using the ATR at signal time) so targets don't drift as volatility changes post-entry.
No single component here is sufficient on its own. An Ehlers filter without adaptive bands still produces false crossovers. Adaptive bands without scoring still trigger on weak trend flips. Scoring without frozen TP/SL creates drifting targets. The integrated pipeline solves all three problems simultaneously.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Adaptive Volatility Trend Engine (AVTE) — custom trend algorithm.
The AVTE replaces the standard Supertrend calculation at every stage:
Stage 1 — Price filtering: Instead of using raw price, the AVTE applies an Ehlers 2-pole Super Smoother to the source. The Ehlers filter uses the transfer function:
ss = c1 × (src + src ) × 0.5 + c2 × ss + c3 × ss
where c1 = 1 − c2 − c3, c2 = 2a × cos(√2 × π / period), c3 = −a², and a = exp(−√2 × π / period). This produces zero-lag frequency-domain filtering — it removes high-frequency noise without the phase distortion that a simple moving average introduces. The filter period is derived from the ATR period (ATR_period / 2, minimum 3).
Stage 2 — Adaptive volatility measurement: Instead of a fixed-length ATR, the AVTE uses a Kaufman Adaptive ATR. First, a standard ATR(period) is calculated. Then the Kaufman Efficiency Ratio (ER) is computed: ER = |close − close | / sum(|close − close |, period). The ER measures how much net directional movement exists relative to total path traveled — ranging from 0 (pure chop) to 1 (clean trend). The ER then modulates a smoothing constant: sc = (ER × (fast − slow) + slow)², where fast = 2/3 and slow = 2/31. The adaptive ATR blends: aATR = aATR + sc × (rawATR − aATR ). In trending conditions (high ER), the adaptive ATR reacts quickly to volatility changes. In choppy conditions (low ER), it smooths aggressively, preventing false band expansions.
Stage 3 — Band calculation and trend direction: Upper band = filtered_price + sensitivity × adaptive_ATR. Lower band = filtered_price − sensitivity × adaptive_ATR. Bands ratchet in the trend direction: the lower band can only rise (never fall) during uptrends, the upper band can only fall during downtrends. When close crosses above the upper band, trend flips bullish. When close crosses below the lower band, trend flips bearish. The trend line follows the lower band in uptrends, upper band in downtrends (step-line visualization).
The Sensitivity parameter (default 2.5) controls how far the bands sit from filtered price. Lower = tighter bands, more signals, faster reaction. Higher = wider bands, fewer signals, smoother.
2️⃣ Multi-confluence scoring system (0–100).
Every AVTE trend flip is evaluated against five independent market factors before becoming a signal:
Factor 1 — EMA alignment (±15 pts): Checks whether close > EMA(50) > EMA(200) for bullish alignment, or close < EMA(50) < EMA(200) for bearish. Full alignment = +15 (bull) or −15 (bear). No alignment = 0. This confirms the trend flip aligns with the broader trend structure.
Factor 2 — RSI position (±10 pts): RSI(14) between 50–70 = +10 (bullish momentum without overextension). RSI 30–50 = −10 (bearish). Extremes (>70 or <30) score 0 — avoiding signals at overbought/oversold levels where reversals are more likely.
Factor 3 — MACD histogram direction (±12 pts): MACD(12,26,9) histogram > 0 and rising = +12 (accelerating bullish momentum). Histogram < 0 and falling = −12 (accelerating bearish). This captures momentum acceleration, not just direction.
Factor 4 — Volume confirmation (0–8 pts): Volume > 20-period SMA × 1.2 = +8. This confirms institutional participation. Auto-disabled on instruments without volume data (forex).
Factor 5 — ADX strength (0–10 pts): ADX(14) > 25 = +10, ADX > 20 = +5. Confirms the market is trending, not ranging.
The base score starts at 50. Bullish factors add, bearish factors subtract. Final score is clamped to 0–100. A buy signal fires when the AVTE flips bullish AND score ≥ Min Signal Score (default 55). A sell signal fires when AVTE flips bearish AND score ≤ (100 − Min Signal Score), creating symmetric thresholds around 50. Signals with score ≥ 75 (buy) or ≤ 25 (sell) are classified as "Strong" and receive a distinct label.
3️⃣ Ehlers Super Smoother trend cloud.
A dual-band cloud system using two Ehlers Super Smoothers at different periods. The fast period depends on the Cloud Style setting:
— Adaptive: auto-adjusts between 13 and 55 based on current volatility — calculated as 34 × (1 + stdev(close, 20) / adaptive_ATR × 0.5)
— Fast: fixed at 21 (tight cloud for scalping)
— Smooth: fixed at 55 (wide cloud for swing)
— Minimal: fixed at 34 (single line, no fill)
The slow period = fast period × 2.618 (golden ratio). Cloud is bullish when fast > slow (green fill), bearish when fast < slow (red fill). The AVTE step-line is overlaid on the cloud for immediate trend-direction clarity. An optional trend tracer (EMA, default 233-period) provides institutional-level long-term bias.
4️⃣ Four-preset system with parameter scaling.
Presets modify three core parameters simultaneously using multipliers:
— Conservative : sensitivity × 1.4, ATR period × 1.3, min score floor 70 — fewer but higher-quality signals, for swing trading
— Balanced : no modification — default parameters, good for 15M–4H
— Aggressive : sensitivity × 0.7, ATR period × 0.8, min score ceiling 45 — more signals, faster entries
— Scalping : sensitivity × 0.5, ATR period × 0.6, min score ceiling 40 — optimized for 1–5M, tightest bands
Each preset adjusts the effective sensitivity, ATR length, and minimum score threshold proportionally, so one selection adapts the entire signal pipeline rather than requiring manual tuning of individual parameters.
5️⃣ Dynamic TP/SL with frozen risk distance.
Three stop-loss modes:
— ATR : SL distance = adaptive ATR × configurable multiplier (default 1.5×)
— Percentage : SL distance = fixed percentage of entry price
— Structure : SL distance = half the recent swing range (highest high − lowest low over swing lookback)
TP levels are calculated as multiples of SL distance: TP1 = SL × 1.5 (default), TP2 = SL × 2.5, TP3 = SL × 4.0. The SL distance is frozen at entry — once a signal fires, the risk distance is locked and does not change with subsequent volatility. This prevents TP/SL levels from drifting as ATR changes post-entry. TP hit markers (×) appear on the chart as each level is reached. An optional Chandelier Exit trailing stop follows price using the ATR multiplier, ratcheting in the profit direction.
6️⃣ Pullback signals within established trends.
In addition to trend-flip signals, the indicator detects pullback entries within an existing trend:
— Bullish pullback: AVTE trend is bullish (no flip), price retraces to EMA(pullback_sensitivity × 3), RSI(pullback_sensitivity) drops below 35 then starts rising — catching the bounce off trend support
— Bearish pullback: AVTE trend is bearish, price rallies to EMA, RSI exceeds 65 then starts falling
Pullback signals appear as small circles (distinct from the main Buy/Sell labels), providing additional entries within a confirmed trend direction. They are bar-close confirmed and warmup-protected.
7️⃣ Volatility gauge with statistical normalization.
The dashboard displays a real-time volatility reading (0–100%) calculated as: gauge = (ATR(10) − (SMA(ATR, 20) − StDev(ATR, 20))) / (2 × StDev(ATR, 20)) × 100, clamped to 0–100. This measures where current volatility sits relative to its recent statistical distribution: > 70% = High (above 1 standard deviation), 40–70% = Medium, < 40% = Low. This helps you assess whether the current environment suits your strategy: high volatility favors wider stops and fewer signals, low volatility favors tighter approaches.
8️⃣ Multi-timeframe trend panel (non-repainting).
The dashboard includes an MTF panel showing trend direction on 5M, 15M, 1H, 4H, and 1D — using close > EMA(200) with lookahead_on for guaranteed non-repainting. When most timeframes align in one direction, trend-flip signals in that direction have higher confluence.
9️⃣ Session detection.
The dashboard shows the current active trading session: Tokyo, London, New York, Sydney, or overlaps (London/New York, Tokyo/London). Sessions are calculated using UTC-based time windows. This helps you contextualize volatility: London/New York overlap is typically the highest-volume period, while off-hours have thinner liquidity.
🔟 Four optional filters.
Each filter can be independently toggled:
— Trend filter : only signals aligned with the Ehlers cloud direction
— Volume filter : only signals with volume EMA(10) > EMA(25) — auto-disabled for instruments without volume
— ADX filter : only signals when ADX > 20 (trending market)
— Momentum filter : only signals with MACD histogram aligned (positive + rising for buys, negative + falling for sells)
All filters default to Off — enabling them progressively reduces signal frequency while increasing average quality.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Ehlers filtering: Source price is passed through the 2-pole Super Smoother with period = max(round(ATR_period / 2), 3). This removes intrabar noise while preserving trend structure.
Step 2 — Adaptive ATR: Kaufman Efficiency Ratio is calculated over the ATR period. The ER modulates the smoothing speed of ATR: trending conditions → fast adaptation, choppy conditions → slow adaptation.
Step 3 — Band construction: Upper = filtered_price + sensitivity × adaptive_ATR. Lower = filtered_price − sensitivity × adaptive_ATR. Bands ratchet: lower band can only rise in uptrends, upper band can only fall in downtrends.
Step 4 — Trend detection: Close above upper band → bullish. Close below lower band → bearish. The trend line is the active band (lower in uptrends, upper in downtrends).
Step 5 — Confluence scoring: On every bar, five factors are evaluated and combined into a 0–100 score. On a trend flip bar, the score determines whether the signal qualifies.
Step 6 — Filter gate: If any enabled filter disagrees, the signal is suppressed.
Step 7 — Signal emission: Buy or Sell label appears on the confirmed bar. Score ≥ 75 / ≤ 25 → "Strong Buy/Sell".
Step 8 — TP/SL placement: Risk distance is calculated and frozen. TP1/TP2/TP3 are placed as R:R multiples. Labels persist on the right side of the chart. Hit markers appear as each level is reached.
📖 HOW TO USE
🎯 Quick start:
1. Select a preset matching your style: Scalping (1–5M), Balanced (15M–4H), Conservative (4H–1D)
2. Add the indicator to your chart — the AVTE trend line and cloud appear immediately
3. Wait for a Buy or Sell label — the score next to it tells you the confluence quality
4. Check the dashboard: trend direction, score, market state (trending/ranging), volatility, session
5. TP/SL levels appear automatically — manage the trade using the marked levels
👁️ Reading the chart:
— 🟩 Green cloud fill = bullish trend (Ehlers fast > slow)
— 🟥 Red cloud fill = bearish trend
— Step-line on the cloud = AVTE trend boundary (the level that must break for a trend flip)
— 🟢 "Buy" / "Strong Buy" label below bar = confirmed bullish signal
— 🔴 "Sell" / "Strong Sell" label above bar = confirmed bearish signal
— 🟢 Small circle below bar = pullback buy (trend continuation entry)
— 🔴 Small circle above bar = pullback sell
— Orange line = entry price | Red line = stop loss | Green lines = TP1/TP2/TP3
— × markers = TP hit confirmations
— HH/HL/LH/LL labels (optional) = market structure swing points
📊 Dashboard fields:
— Trend: current AVTE direction (Bullish/Bearish)
— Signal: last confirmed signal (Buy/Sell/Wait)
— Score: current confluence score (0–100)
— Market: ADX-based state (Trending > 25 / Ranging > 20 / No Trend)
— Volatility: statistical gauge (High/Medium/Low with percentage)
— Session: current active session (Tokyo/London/New York/Sydney/overlaps)
— MTF Panel: 5M/15M/1H/4H/1D trend direction (close vs 200 EMA)
🔧 Tuning guide:
— Too many signals: increase Min Score, enable filters, switch to Conservative preset
— Too few signals: decrease Min Score, switch to Aggressive/Scalping, lower Sensitivity
— Signals too late: lower Sensitivity (tighter bands), use Fast cloud style
— Too many false signals: enable ADX filter (filters ranging markets), increase Min Score to 65+
— Scalping 1–5M: use Scalping preset, ATR mode SL with multiplier 1.0–1.5, TP1 R:R 1.0–1.5
— Swing 4H–1D: use Conservative preset, ATR mode SL with multiplier 2.0–3.0, TP3 R:R 5.0+
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Trend Sensitivity (default 2.5): AVTE band distance — lower = more signals, higher = fewer
— ATR Period (default 21): volatility measurement lookback
— Preset (default Balanced): Conservative / Balanced / Aggressive / Scalping
📡 Signal Tuning:
— Min Signal Score (default 55): minimum confluence to trigger signals
— Strong Signals Only (default Off): only show score ≥ 75
— Show Pullback Signals (default On): trend continuation entries
— Pullback Sensitivity (default 8): retracement detection lookback
☁️ Trend Cloud:
— Cloud Style (default Adaptive): Adaptive / Fast / Smooth / Minimal
— Trend Tracer (default Off): long-term EMA bias line (default 233)
🔍 Filters (all default Off):
— Trend Filter (cloud alignment) / Volume Filter / ADX Filter / Momentum Filter
🛡️ Risk Management:
— SL Mode (default ATR): ATR / Percentage / Structure
— SL ATR Multiplier (default 1.5×) / SL Percentage (default 1.0%)
— TP1/TP2/TP3 Risk:Reward (default 1.5 / 2.5 / 4.0)
— Trailing Stop (default Off): Chandelier Exit method
— Market Structure (default Off): HH/HL/LH/LL swing labels
🎨 Visual:
— Auto / Dark / Light theme
— Bar coloring: Trend Gradient / Signal Based / Momentum / None
— Background trend shading (default Off)
📊 Dashboard:
— Position, font size, MTF panel toggle
🔔 Alerts
— 🟢 Buy / Strong Buy — ticker, price, timeframe, score
— 🔴 Sell / Strong Sell — same fields
— 🎯 TP1 / TP2 / TP3 Hit — ticker, price
— 🛑 SL Hit — ticker, price
— ☁️ Cloud Cross Bullish / Bearish — ticker, timeframe
All alerts support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. TP/SL distances are frozen at entry and do not change retroactively. MTF data uses + lookahead_on for non-repainting HTF values. A warmup period (minimum 200 bars or 3× ATR period) prevents signals during insufficient data.
— 📐 The AVTE is not a standard Supertrend . It replaces every component: Ehlers Super Smoother instead of raw price, Kaufman adaptive ATR instead of fixed ATR, ratcheting bands instead of simple ±ATR. The mathematics are described in detail above.
— ⚖️ The confluence score is not a win-rate predictor . A score of 75 means five independent market factors align strongly — it measures confluence quality, not outcome probability. Use it to prioritize, not to guarantee.
— 📊 The scoring system uses standard indicators (EMA, RSI, MACD, Volume, ADX) as confluence factors , not as independent signal generators. None of these indicators alone triggers a signal — they only contribute to the score that gates an AVTE trend flip.
— 🔧 Presets modify parameters proportionally. After selecting a preset, you can still adjust individual settings — the preset sets the starting point, your adjustments override it.
— 📏 TP/SL levels are frozen at entry . The SL distance calculated at the signal bar persists until the next signal — it does not drift with changing ATR. This is by design for consistent risk management.
— 🔄 Pullback signals are continuation entries , not reversal signals. They only appear within an established AVTE trend and require RSI reversion from oversold/overbought — catching bounces off trend support/resistance.
— 🛠️ This is a signal and analysis tool , not an automated trading bot. It generates signals, scores them, and visualizes TP/SL — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume filter auto-disables on instruments without volume data. Indicator

Strict 1-Trade/Day SMC + ORB This is a trend-continuation strategy designed to capture intraday volatility after the initial market direction is established. It combines Price Action (Opening Range) to define the bias and SMC mechanics (CHoCH + FVG) for precise entries.
The strategy strictly limits trading to one high-probability setup per day to combat overtrading.
Key Components
1.The Setup (Opening Range)The strategy ignores the first 15 minutes of the Regular Trading Session (9:30 AM - 9:45 AM EST). The high and low of this period establish the Opening Range (OR).Bullish Bias: Price breaks above the Opening Range High (ORH).Bearish Bias: Price breaks below the Opening Range Low (ORL).
2. Entry Trigger (CHoCH + FVG)Once the bias is established, the strategy waits for a retracement to create a Change of Character (CHoCH) on a lower timeframe, coupled with a Fair Value Gap (FVG).
Long Entry: Price breaks above the most recent swing high (CHoCH) and leaves a gap between the low of the current candle and the high of the candle two bars prior (Bullish FVG).
Short Entry: Price breaks below the most recent swing low (CHoCH) and leaves a gap between the high of the current candle and the low of the candle two bars prior (Bearish FVG).
3. Risk Management & Exit Strategy Risk is defined immediately based on the opening range. Stop Loss: Placed at the opposite side of the Opening Range ($1R$ Risk).Initial Take Profit ($2R$): The first target is set to two times the range of the opening 15 minutes ($2R$).Immediate Trailing Stop (ATR): Immediately upon entry, a trailing stop loss based on $4 \times$ Average True Range (ATR) is activated to protect capital against sudden reversals. Advanced Management (Partial Exit): If the trade reaches $1R$ profit, or if the $10$ SMA crosses the $20$ SMA in the opposite direction of the trade, $50\%$ of the position is closed. Break-Even Move: If the position is still open $3$ hours after entry, the stop loss is moved to the entry price to guarantee a risk-free trade.
best result on nq last 30days 59 trades, P/L +50%, max drawdown 10%, 67% win rate(40/59), profit factor 3.1.
To ensure this strategy holds up under different market conditions, it is crucial to backtest it over a long timeframe (e.g., at least 2–3 years of data) to see how it handles both trending and choppy markets in NQ and ES.
Once you have tested it, please share your results, specifically for: Total Net Profit, Max Drawdown, Profit Factor, Win Rate. Appreciate it and thanks. Strategy

Smart Money Gold Map [XAUUSD Kill Zones + Liquidity Sweeps]An all-in-one session mapping and market structure overlay designed specifically for XAUUSD. Combines kill zone timing, Asian range liquidity sweeps, and dynamic psychological levels into a single clean tool.
No repainting. The green and red diamonds mark Asian range liquidity sweeps, not direct buy/sell signals. They highlight where smart money grabbed liquidity so you can build your own trade thesis around them.
🔶 SESSION KILL ZONES
Highlights the two most important windows for gold trading:
• London Kill Zone (07:00-10:00 GMT) where the majority of gold's daily range gets established
• NY AM Kill Zone (12:00-15:00 GMT) for US macro data and continuation/reversal of London
Blue and purple backgrounds with "LDN" and "NY" labels at each session open so you always know where you are in the trading day.
🔶 ASIAN RANGE + LIQUIDITY SWEEPS
The Asian session (22:00-06:00 GMT) defines the overnight consolidation range that London and NY will target. The indicator:
• Draws the Asian range as a box on your chart
• Detects when price sweeps the Asian high/low and reverses back inside
• Marks each sweep with a diamond (green = low swept, red = high swept)
• Fires once per sweep per day to keep the chart clean
Gold consistently respects this pattern because institutional stops cluster at Asian session extremes. If you trade ICT or SMC concepts, this is the setup you're already looking for.
🔶 PSYCHOLOGICAL LEVELS
At all-time highs, there is no historical resistance above current price. Round numbers become the primary S/R framework. The indicator draws:
• $100 major levels as solid gold lines ($5000, $5100, $5200...)
• $50 minor levels as dashed lines ($5050, $5150, $5250...)
• Optional $25 midpoints as dotted lines for precision scalping
Levels update dynamically around current price with dollar value labels.
🔶 REAL-TIME DASHBOARD
Compact dashboard showing:
• Active session with color coding
• VWAP premium/discount
• RSI with extreme highlighting
• ATR for volatility context
• Asian range width and sweep status
• London and NY session ranges
• Nearest psych resistance + support with distance
• Zone position (near support, mid-range, near resistance)
• Volatility context: TIGHT = compressed Asian range, often followed by explosive moves during kill zones
🔶 6 BUILT-IN ALERTS
• Asian low swept (watch for long setup)
• Asian high swept (watch for short setup)
• London Kill Zone open
• NY Kill Zone open
• Price hit major psychological resistance
• Price hit major psychological support
🔶 HOW TO USE
Apply to XAUUSD on 15m, 30m, or 1H for the best session visibility.
When London KZ opens, check the dashboard. If the Asian low got swept and price is sitting at VWAP discount near a $100 psych level, you have confluence for a long setup. The indicator surfaces all of this without needing to draw a single line manually.
During NY, watch for continuation of London's direction or reversal at the next psych level. Session range lines show exactly where London established its high and low.
When the volatility read shows "TIGHT", pay extra attention. Compressed Asian ranges tend to precede big directional moves.
🔶 SETTINGS
Fully adjustable:
• Session times (set to your broker's timezone)
• Psych level steps ($100, $50, $25)
• Number of levels displayed
• All colors and visual toggles Indicator

ICT Session Zones & Sweep Signals [WillyAlgoTrader]🎯 ICT Session Zones & Sweep Signals is an overlay indicator that maps the full ICT session framework onto your chart: five configurable killzone boxes with adaptive high/low pivots, confirmed liquidity sweep signals scored by ATR-normalized wick depth, session VWAP lines, Asian session bias engine, D/W/M open and previous high/low levels, custom opening price lines, vertical timestamps, and a day-of-week label system. Everything is timezone-aware, timeframe-gated, and designed for 1m–15m intraday charts.
🏗️ Most session indicators on PulseWire draw static time boxes and stop there. This indicator builds a complete ICT session analysis environment: it tracks killzone ranges in real time, extends session pivots beyond the killzone until price sweeps them, detects and confirms the sweep with multiple filters (ATR depth, body confirmation, cooldown), scores each sweep's strength, calculates session VWAP inside each killzone for fair value reference, tracks Asian session bias, and overlays D/W/M structural levels — all in one tool with a unified dashboard.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Confirmed liquidity sweep detection with strength scoring. The core signal engine detects when price wicks beyond a session high or low and closes back inside — the classic ICT liquidity grab pattern. Every sweep must pass four filters before becoming a signal:
— 📏 ATR depth filter : the wick beyond the pivot must exceed a configurable ATR multiple (default 0.1×) — filtering out insignificant touches
— 🕯️ Body confirmation : close must be beyond the candle body midpoint in the rejection direction (bullish sweep: close in upper half; bearish: close in lower half) — confirming genuine rejection, not just a wick
— ⏱️ Cooldown filter : minimum bars between sweeps from the same session (default 3) — preventing rapid-fire signals from the same pivot
— ✅ Bar-close confirmation : all sweeps require barstate.isconfirmed — no intrabar repainting
Each confirmed sweep receives a strength score based on wick depth as an ATR multiple: Strong (≥ 0.5× ATR), Medium (≥ 0.2×), or Weak (< 0.2×). The score and strength appear in the label tooltip and on the dashboard.
2️⃣ Intelligent pivot lifecycle management. Session high/low lines are not static — they follow a lifecycle:
— 🟢 Created at session start with the first bar's high/low
— 📈 Updated during the session as new highs/lows form
— ➡️ Extended beyond the session until swept or invalidated
— 🎯 Swept: wick beyond + close back inside → sweep signal fires
— ❌ Invalidated: only when price closes decisively beyond the level (not just a wick touch) — preventing premature pivot death from intrabar noise
— 🔄 Mode option: "Until Swept" (pivot disappears after sweep) or "Always" (pivots extend indefinitely for historical reference)
3️⃣ Session VWAP (volume-weighted average price per killzone). Unlike the simple midpoint between session high and low, the session VWAP accumulates close × volume inside each killzone, providing the true volume-weighted fair value for that session. The VWAP line extends beyond the session end, serving as a more accurate equilibrium reference than the midpoint. This is especially useful on instruments with uneven volume distribution within a session.
4️⃣ Asian session bias engine. The dashboard continuously shows the Asian bias state: Bullish (price above Asia high), Bearish (price below Asia low), or Neutral (inside range). This directly implements the ICT concept that the Asian range sets the liquidity pool for London and NY sessions — if price is above Asia high, London/NY are expected to seek downside liquidity, and vice versa.
5️⃣ Five fully customizable killzones. Each killzone has independently configurable:
— Session name, time window, and color
— High/Low pivot label text (e.g., "AS.H" / "AS.L")
— Enable/disable toggle
Default zones cover the standard ICT framework: Asia (20:00–00:00), London (02:00–05:00), NY AM (09:30–11:00), NY Lunch (12:00–13:00), NY PM (13:30–16:00). All times follow the selected timezone. You can modify any zone to match your specific session definitions.
6️⃣ D/W/M structural levels with break alerts. The indicator tracks and draws:
— 📅 Daily / Weekly / Monthly opening price lines
— 📊 Previous Day High/Low (PDH/PDL), Previous Week High/Low (PWH/PWL), Previous Month High/Low (PMH/PML)
— 📍 Vertical day/week/month separators
Each level extends across the chart with configurable style and width. Break alerts fire when price closes above PDH, below PDL, above PWH, below PWL, above PMH, or below PML — six structure-level alerts in addition to sweep alerts.
7️⃣ Custom opening price lines and vertical timestamps. Four configurable opening price slots let you mark any specific time's opening price (e.g., True Day Open at 00:00, 06:00 open, 10:00 open, 14:00 open). Four vertical timestamp slots add time-of-day vertical lines (e.g., 08:00 London open, 10:00 macro time, etc.). All follow the selected timezone and are trimmed by session history.
8️⃣ Killzone range comparison table. An optional range table shows each killzone's current range (high − low) alongside its N-session average range. This helps you identify when a session is extended beyond its typical range (potential exhaustion) or still compressed (potential expansion ahead).
9️⃣ Comprehensive dashboard. The info panel shows:
— 🔵 Active session name (with overlap count when multiple sessions are active simultaneously)
— 📊 Asian session bias (Bullish / Bearish / Neutral)
— 🎯 Last sweep type, session, and strength with ATR score
— 📈 Total sweep counts (bullish / bearish)
— ⏱️ Current timeframe and symbol
— 🏷️ Indicator version
🔟 Full timezone support with 35+ timezone options. All session calculations use a single timezone setting. Options include named timezones (America/New_York, Europe/London, Asia/Tokyo, etc.) and GMT offsets (GMT-12 through GMT+12). This ensures killzone boxes, pivot times, opening prices, and timestamps all align correctly regardless of your broker's server time.
⚙️ HOW IT WORKS
🏗️ Killzone box creation:
On each bar, the indicator checks whether the current time falls inside each enabled killzone using the configured session string and timezone. When a session starts (current bar inside, previous bar outside), a new box is created with the bar's high/low. During the session, the box expands to encompass the full range. Pivot lines (high/low) are created at session start and updated as new extremes form. Session VWAP accumulates close × volume and updates on each bar.
🎯 Sweep detection:
After a session ends, the pivot lines continue extending on each bar. On every confirmed bar, the indicator checks: does the wick exceed the pivot level? If yes, it evaluates four conditions: ATR depth threshold met, close back inside the level, body confirmation (close in correct half of candle), and cooldown since last sweep from this session. Only if all four pass does the sweep signal fire. The pivot is invalidated (stops extending) only when price closes decisively through the level — not on a wick touch alone.
📊 Sweep strength:
Wick depth beyond the pivot is divided by ATR(14) to produce a dimensionless score. Strong ≥ 0.5×, Medium ≥ 0.2×, Weak < 0.2×. The score appears in the signal tooltip and on the dashboard, helping you prioritize higher-quality sweeps.
📏 Session VWAP:
Inside each killzone, the indicator accumulates sum(close × volume) and sum(volume). VWAP = numerator / denominator. The line updates on each bar during the session and extends beyond session end as a reference level. Volume is floored at 1.0 to handle instruments with zero reported volume.
🔄 Asian bias:
The dashboard reads the Asia session's most recent high and low pivot levels. If the current close is above Asia high → Bullish. Below Asia low → Bearish. Inside the range → Neutral. This updates in real time.
📅 DWM levels:
On each D/W/M timeframe change, the indicator stores the previous period's high and low, then draws horizontal lines at those levels. Lines extend forward on each bar. Break detection fires alerts when price closes above the high or below the low for the first time since the period change.
📖 HOW TO USE
🎯 Recommended setup:
— ⏱️ Timeframe: 1m–15m — the indicator auto-hides on timeframes ≥ the TF Limit setting (default 30m). Session zones and sweeps are most meaningful on intraday charts.
— 🌐 Timezone : set to your exchange or broker timezone for accurate killzone alignment. For ICT concepts, America/New_York (EST/EDT) is the standard reference.
— 📦 Session History (default 3): controls how many past sessions' boxes and pivot lines remain on chart. Increase for more context, decrease for cleaner charts.
👁️ Reading the chart:
— 📦 Colored boxes = killzone time windows (Asia blue, London red, NY AM green, NY Lunch yellow, NY PM purple)
— ─── Horizontal lines extending from boxes = session high/low pivots (active until swept or invalidated)
— ··· Dotted lines = session midpoints and/or VWAP
— 🟢 ▲ label below candle = confirmed bullish sweep (wick below session low + close back above)
— 🔴 ▼ label above candle = confirmed bearish sweep (wick above session high + close back below)
— Hover over sweep labels for tooltip: session name, strength, ATR score, price
🔁 ICT workflow with this indicator:
1. 🌏 Check Asian session range — note the high and low pivots
2. 📊 Read the dashboard — Asian Bias tells you the directional lean
3. 🇬🇧 During London killzone — watch for sweeps of Asian high/low pivots
4. 🇺🇸 During NY AM — watch for sweeps of London or Asian pivots
5. 🎯 When a sweep fires — check strength (Strong > Medium > Weak) and confluence with DWM levels
6. 📍 Use PDH/PDL, PWH/PWL as additional confluence — sweep + DWM level break = highest conviction
7. 🕐 NY Lunch — lower probability zone, expect consolidation
8. 🔄 NY PM — potential continuation or reversal of AM move, watch for PM pivot sweeps
🔧 Tuning sweep sensitivity:
— 🎚️ Min Sweep Depth 0.0 : any wick beyond the pivot counts (most signals, more noise)
— 🎚️ Min Sweep Depth 0.1 (default): requires 10% of ATR beyond pivot (balanced)
— 🎚️ Min Sweep Depth 0.2–0.3 : only significant wicks qualify (fewer but stronger signals)
— 🔄 Cooldown 0 : no restriction (same pivot can trigger multiple sweeps)
— 🔄 Cooldown 3 (default): minimum 3 bars between sweeps from the same session
— 🕯️ Body Confirmation On (default): filters weak wicks — recommended to keep enabled
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Timezone (default GMT+0): 35+ options including named and GMT offset
— Timeframe Limit (default 30m): hide all drawings on TFs ≥ this value
— Session History (default 3): number of past sessions to keep visible
📦 Killzones:
— 5 independently configurable zones: name, session time, color, enable/disable
— Box Transparency (default 80%): killzone box fill opacity
— Show Box Labels (default On): session name text inside boxes
📏 Session Pivots:
— Show Session Pivots (default On): high/low lines from each killzone
— Show Midpoints (default Off): 50% level between session high and low
— Show Session VWAP (default Off): volume-weighted average price per killzone
— Extend Pivots (default Until Swept): line stops after sweep, or "Always" for permanent extension
— Show Price on Labels (default Off): append price value to pivot label text
— Customizable pivot label text per killzone (e.g., AS.H, LO.H, AM.H)
🎯 Sweep Signals:
— Min Sweep Depth (default 0.1× ATR): minimum wick beyond pivot
— Cooldown (default 3 bars): minimum bars between sweeps from same session
— Body Confirmation (default On): require close in correct body half
📅 Day / Week / Month:
— Daily / Weekly / Monthly Open lines (each toggleable)
— Previous D/W/M High/Low lines with labels (PDH, PDL, PWH, PWL, PMH, PML)
— Day / Week / Month separator verticals
— Day-of-Week text labels (top or bottom, weekends hideable)
— Unlimited DWM Lines (default Off): override session history limit
🕐 Opening Prices:
— 4 configurable opening price slots (session time, name, color)
— Line style and width settings
📍 Timestamps:
— 4 configurable vertical timestamp slots (session time, color)
— Line style and width settings
🎨 Visual:
— Auto / Dark / Light theme detection
— Bull / Bear signal colors
— Watermark toggle
📊 Dashboards
— 📋 Main Dashboard : active session, Asian bias, last sweep (type + session + strength + ATR score), sweep counts (bull/bear), timeframe, symbol, version
— 📏 Range Table (optional): current range and N-session average range per killzone — identify extended vs. compressed sessions
🔔 Alerts
Sweep alerts (bar-close confirmed):
— 🟢 Sweep Buy — includes ticker, timeframe, price, strength, reason (which session's pivot was swept)
— 🔴 Sweep Sell — same fields
Both support plain text and JSON webhook format for bot integrations.
DWM break alerts:
— 📈 PDH / PWH / PMH Break — price closes above previous high
— 📉 PDL / PWL / PML Break — price closes below previous low
Six structural alerts, all bar-close confirmed.
⚠️ IMPORTANT NOTES
— ⏱️ Designed for intraday timeframes (1m–15m). The indicator auto-hides on timeframes at or above the TF Limit setting. Session zones and sweeps lose their meaning on higher timeframes.
— 🚫 No repainting. All sweep signals and DWM break alerts require barstate.isconfirmed. Pivot invalidation also occurs only on confirmed bar close, not intrabar.
— 🌐 Timezone accuracy is critical. If your killzone boxes don't align with the expected session times, verify that the Timezone setting matches your exchange or broker timezone. For standard ICT analysis, use America/New_York.
— 📊 Sweep signals indicate liquidity grabs — they show where stop-losses were likely triggered. They are not standalone entry signals. Combine with order flow, FVGs, order blocks, or other ICT concepts for complete trade setups.
— 🔄 Session VWAP requires volume data. On instruments with no reported volume (some forex pairs), the VWAP line defaults to close-based calculation.
— 📏 The range table's average is calculated from the last N completed sessions (configurable, default 5). It takes several sessions to build a meaningful average.
— 🎯 Sweep strength is relative — "Strong" on a low-volatility instrument may represent a smaller absolute move than "Weak" on a high-volatility one. The ATR normalization makes strength comparable across timeframes but not across instruments with very different ATR profiles.
— 🛠️ This is an analysis and signal tool , not an automated trading system. It visualizes ICT session concepts and detects liquidity sweeps — trade decisions remain yours. Indicator

Prism Orderflow Detector [JOAT]Prism Orderflow Detector
Introduction
The Prism Orderflow Detector is an open-source institutional liquidity and order flow system that combines Smart Money Concepts (SMC), liquidity pool detection, Fair Value Gap analysis, Order Block identification, and advanced orderflow strength measurement into a unified overlay indicator. This comprehensive system integrates multiple proven institutional trading methodologies to identify high-probability zones where smart money positioning and retail liquidity intersect.
The indicator is designed for traders who understand that institutional players move markets by targeting liquidity pools, creating imbalances, and establishing positions through Order Blocks. By synthesizing liquidity detection, Fair Value Gaps, Order Blocks, Breaker Blocks, market structure analysis, and real-time orderflow strength measurement, this tool helps identify structural market inflection points with institutional-grade precision.
Why This Integration Exists
This indicator combines eight distinct institutional analysis frameworks that complement each other:
Liquidity Pool Detection: Identifies equal highs/lows and swing points where retail stops cluster
Order Block Analysis: Tracks institutional accumulation and distribution zones
Fair Value Gap Identification: Detects price inefficiencies created by rapid institutional moves
Breaker Block Recognition: Identifies failed Order Blocks that become new support/resistance
Market Structure Mapping: Tracks Break of Structure (BOS) and Change of Character (CHoCH)
Liquidity Heatmap Analysis: Visualizes liquidity concentration across price levels
Volume Delta Tracking: Measures real-time buying versus selling pressure
Orderflow Strength Measurement: Quantifies institutional pressure across multiple factors
Each component addresses different aspects of institutional order flow. Liquidity detection reveals where stops are hunted, Order Blocks show where institutions positioned, Fair Value Gaps indicate rapid institutional moves, market structure provides trend context, and orderflow strength quantifies current institutional pressure. Together, they create a comprehensive view of smart money activity and retail liquidity targeting.
Core Components Explained
1. Advanced Liquidity Detection System
The system identifies multiple types of liquidity pools:
Equal Highs (Buy-Side Liquidity):
Equal High Threshold = high * (threshold_percentage / 100)
Equal High Condition = (high == high ) OR (abs(high - high ) <= threshold AND high > high )
Valid Equal High = Equal High Condition AND high == highest(high, lookback_period)
Equal Lows (Sell-Side Liquidity):
Equal Low Threshold = low * (threshold_percentage / 100)
Equal Low Condition = (low == low ) OR (abs(low - low ) <= threshold AND low < low )
Valid Equal Low = Equal Low Condition AND low == lowest(low, lookback_period)
Liquidity Sweeps:
- Bullish Sweep: Price breaks below recent lows but closes back above
- Bearish Sweep: Price breaks above recent highs but closes back below
These sweeps often precede significant moves as institutions trigger retail stops before establishing positions.
2. Order Block Detection Engine
Order Blocks represent the last opposite-direction move before a strong impulse:
Bullish Order Block:
Bullish OB = close < open AND close > open AND
close > high AND (high - low ) > (ATR * strength_multiplier)
Bearish Order Block:
Bearish OB = close > open AND close < open AND
close < low AND (high - low ) > (ATR * strength_multiplier)
Order Blocks are displayed as gradient boxes with diagonal lines and extend forward to show ongoing relevance.
3. Fair Value Gap Analysis
Fair Value Gaps represent price inefficiencies where institutions moved price rapidly:
Bullish FVG:
Bullish FVG = low > high AND close > open
FVG Size = ((low - high ) / close) * 100
Valid Bullish FVG = Bullish FVG AND FVG Size >= minimum_size_percentage
Bearish FVG:
Bearish FVG = high < low AND close < open
FVG Size = ((low - high ) / close) * 100
Valid Bearish FVG = Bearish FVG AND FVG Size >= minimum_size_percentage
FVGs are displayed as horizontal lines with gradient fills and often get filled (retested) later.
4. Breaker Block System
Breaker Blocks are failed Order Blocks that become new support/resistance:
Bullish Breaker: Failed bearish Order Block that price breaks above
Bearish Breaker: Failed bullish Order Block that price breaks below
These represent significant shifts in market structure and often provide strong reversal zones.
5. Market Structure Analysis
Tracks institutional trend changes through structure breaks:
Break of Structure (BOS):
- Bullish BOS: New higher high with strong momentum
- Bearish BOS: New lower low with strong momentum
Change of Character (CHoCH):
- Bullish CHoCH: Lower low followed by higher high (trend change)
- Bearish CHoCH: Higher high followed by lower low (trend change)
6. Advanced Orderflow Features
Liquidity Heatmap:
Tracks liquidity concentration by counting touches at key levels over specified periods. High-intensity areas (>80% touch count) are highlighted as significant liquidity zones.
Volume Delta Analysis:
Buy Volume = close > open ? volume : 0
Sell Volume = close < open ? volume : 0
Volume Delta = sma(Buy Volume - Sell Volume, 14)
Volume Delta Normalized = (Volume Delta / sma(volume, 14)) * 100
Strong delta (>50) indicates institutional accumulation or distribution.
Imbalance Zone Detection:
Enhanced Fair Value Gap detection for larger inefficiencies:
Bullish Imbalance = low > high AND (low - high ) > (ATR * 0.5)
Bearish Imbalance = high < low AND (low - high) > (ATR * 0.5)
Premium/Discount Zones:
Price Range = highest(high, 50) - lowest(low, 50)
Equilibrium = lowest(low, 50) + (Price Range / 2)
Premium Zone = close > equilibrium + (Price Range * 0.25)
Discount Zone = close < equilibrium - (Price Range * 0.25)
7. Orderflow Strength Meter
Real-time quantification of institutional pressure:
Orderflow Strength = Order Block Factor + FVG Factor + Sweep Factor +
Volume Delta Factor + Structure Factor
Components:
- Order Block: ±20 points for new OBs
- FVG: ±15 points for valid FVGs
- Sweeps: ±25 points for liquidity sweeps
- Volume Delta: ±30 points (normalized)
- Structure: ±20 points for BOS/CHoCH
Strength classifications:
- Extreme Bull/Bear Pressure: >±60
- Strong Bull/Bear Pressure: >±30
Visual Elements
Liquidity Arrows: Directional arrows for equal highs/lows with clean labels
Liquidity Sweeps: Arrow lines showing sweep direction with "SWEEP" labels
Order Block Boxes: Gradient boxes with diagonal lines and "OB" labels
Fair Value Gap Lines: Horizontal lines with gradient fills and "FVG" labels
Breaker Diamonds: Diamond markers for failed Order Blocks with "BRK" labels
Structure Arrows: CHoCH arrows with directional labels
Imbalance Zones: Boxes with crossing diagonal lines and "IMB" labels
Liquidity Heatmap: Significant liquidity levels with "LIQ" labels
Volume Delta Markers: "Δ+" and "Δ-" labels for extreme volume pressure
Orderflow Background: Subtle background coloring for extreme pressure states
Dashboard: Comprehensive real-time status of all orderflow components
How Components Work Together
The integration creates a layered institutional analysis approach:
Layer 1 - Liquidity Mapping: Equal highs/lows and swing points reveal where retail stops cluster
Layer 2 - Institutional Positioning: Order Blocks show where smart money accumulated/distributed
Layer 3 - Price Inefficiencies: Fair Value Gaps indicate rapid institutional moves
Layer 4 - Structure Context: BOS/CHoCH provide trend and reversal context
Layer 5 - Failed Levels: Breaker Blocks show where previous levels failed
Layer 6 - Flow Analysis: Volume delta and heatmaps reveal current institutional pressure
Layer 7 - Strength Synthesis: Orderflow strength meter quantifies overall institutional activity
Example scenario: Price approaches equal lows (Layer 1) where a bullish Order Block exists (Layer 2), creating a Fair Value Gap on the move up (Layer 3), with bullish CHoCH confirming trend change (Layer 4), strong positive volume delta (Layer 6), and extreme bullish orderflow strength (Layer 7). This confluence suggests high-probability long opportunity.
Input Parameters
Liquidity Settings:
Show Equal Highs/Lows: Toggle liquidity pool display
Equal Price Threshold: Percentage tolerance for equal levels (default: 0.1%)
Liquidity Lookback: Period for liquidity level detection (default: 50)
Order Block Settings:
Show Order Blocks: Toggle Order Block display
Order Block Strength: ATR multiplier for OB validation (default: 3)
Extend Order Blocks: Forward extension bars (default: 20)
Fair Value Gap Settings:
Show Fair Value Gaps: Toggle FVG display
Min FVG Size: Minimum gap size percentage (default: 0.1%)
Breaker Block Settings:
Show Breaker Blocks: Toggle Breaker display
Breaker Lookback: Period for Breaker detection (default: 20)
Advanced Features:
Show Liquidity Heatmap: Toggle heatmap visualization
Show Volume Delta: Toggle volume pressure display
Show Imbalance Zones: Toggle imbalance detection
Show Premium/Discount Zones: Toggle equilibrium analysis
Show Orderflow Strength: Toggle strength background
Heatmap Period: Lookback for liquidity concentration (default: 100)
How to Use This Indicator
Step 1: Identify Market Structure
Check for recent BOS or CHoCH to understand current trend context and potential reversal zones.
Step 2: Map Liquidity Pools
Locate equal highs/lows and swing points where retail stops are likely clustered.
Step 3: Find Order Blocks
Identify recent Order Blocks where institutions likely positioned for the next move.
Step 4: Check for Fair Value Gaps
Look for unfilled FVGs that price may return to test, especially near Order Blocks.
Step 5: Monitor Liquidity Sweeps
Watch for sweep arrows indicating stop hunting - these often precede strong moves in the opposite direction.
Step 6: Analyze Volume Delta
Confirm institutional flow direction through volume delta analysis - strong delta supports directional bias.
Step 7: Review Orderflow Strength
Check dashboard for current orderflow strength - extreme readings indicate high institutional activity.
Step 8: Wait for Confluence
Best setups occur when multiple factors align: liquidity pools + Order Blocks + structure + volume confirmation.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal institutional detection
Focus on confluence zones where multiple SMC concepts align
Liquidity sweeps provide excellent risk:reward when they fail to sustain
Order Block retests often provide precise entry levels with tight stops
Fair Value Gaps act as magnets - price often returns to fill them
CHoCH signals are more significant than BOS for trend changes
Volume delta confirmation adds conviction to SMC setups
Premium/discount zones help time entries - buy discount, sell premium
Indicator Limitations
Not all liquidity pools get targeted - institutional timing varies
Order Blocks can fail if market structure changes significantly
Fair Value Gaps may never get filled during strong trending moves
Breaker Blocks don't always provide reliable support/resistance
Volume delta can be misleading in low-liquidity conditions
Orderflow strength is reactive, not predictive of future moves
SMC concepts require understanding of institutional behavior
Visual elements can clutter chart - adjust display settings as needed
Technical Implementation
Built with Pine Script v6 using:
Advanced liquidity detection with percentage-based thresholds
Real-time Order Block calculation with ATR-based validation
Dynamic Fair Value Gap identification with size filtering
Breaker Block tracking with lookback period management
Market structure analysis with BOS/CHoCH detection
Volume delta calculation with institutional bias measurement
Orderflow strength meter with multi-factor scoring
Anti-overlap filtering to prevent visual clutter
Comprehensive dashboard with real-time status updates
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This indicator is original in its comprehensive SMC integration approach. While individual components (Order Blocks, Fair Value Gaps, liquidity detection, volume analysis) are established Smart Money Concepts, this integration is justified because:
It synthesizes eight distinct SMC methodologies into a unified system
The orderflow strength meter quantifies institutional pressure across multiple factors
Advanced liquidity heatmap visualization shows concentration levels not available elsewhere
Integrated volume delta analysis provides real-time institutional flow confirmation
Premium/discount zone analysis adds equilibrium context to SMC setups
Anti-overlap filtering and clean visual design reduce chart clutter while maintaining functionality
Each component contributes unique institutional information: liquidity detection reveals stop hunting targets, Order Blocks show positioning zones, Fair Value Gaps indicate rapid moves, market structure provides context, and volume analysis confirms flow. The integration's value lies in presenting these complementary SMC perspectives simultaneously with quantified orderflow strength measurement.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Smart Money Concepts and institutional analysis are educational frameworks that do not guarantee future price movement. Past performance and backtested results do not guarantee future results. Market conditions change, and SMC patterns that worked historically may not work in the future.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Adaptive Pivot Structure [WillyAlgoTrader]Adaptive Pivot Structure (APS) is an overlay indicator that maps market structure in real time by detecting swing pivots, classifying structural breaks (BOS / CHoCH), tracking missed reversal levels, and projecting a dynamic Fibonacci grid between the last confirmed pivot and the live forming extreme.
Most pivot-based tools plot swing points with a fixed delay and leave the trader to interpret structure manually. APS automates the full workflow: it detects pivots, grades their strength against ATR, identifies whether the structure is continuing (BOS) or reversing (CHoCH), keeps track of levels that price skipped over, and stretches a Fibonacci retracement grid that updates bar-by-bar as the current swing extends — giving you an always-current picture of where price sits within the swing.
🔍 WHAT MAKES IT ORIGINAL
APS combines five analytical layers into a single coherent overlay that would otherwise require multiple separate indicators:
1. ATR-graded pivot detection. Every swing high and low is measured against the current ATR to classify it as Strong (swing > 1.5× ATR) or Weak. You can filter the display to show only strong pivots, only weak ones, or all — allowing you to strip noise on lower timeframes while keeping full detail on higher ones.
2. Automated BOS / CHoCH classification. The indicator continuously compares each new pivot high to the previous pivot high, and each new pivot low to the previous pivot low. When a higher high forms in an existing uptrend, the script labels it as a Break of Structure (BOS ↑) — trend continuation. When a higher high forms after a downtrend, it labels a Change of Character (CHoCH ↑) — potential reversal. The same logic applies in reverse for bearish breaks. This removes the subjectivity of manually drawing and labeling structure shifts.
3. Missed reversal tracking. When two consecutive pivots form on the same side (e.g. two pivot highs without an intervening pivot low), the "missed" pivot low between them is flagged with a ◇ marker and extended as a dotted horizontal level until price breaks it. These missed levels often act as hidden support/resistance that conventional pivot tools ignore entirely.
4. Live (potential) pivot tracking. Instead of waiting for full confirmation (which inherently lags by N bars), APS tracks the running extreme since the last confirmed pivot and plots it in real time as a "potential next pivot" with a dashed zigzag extension. This gives you immediate visual feedback on how far the current swing has traveled and where the Fibonacci grid is anchored — without pretending the pivot is confirmed.
5. Dynamic Fibonacci grid. A full Fibonacci retracement (0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0 — with optional 1.272 and 1.618 extensions) is drawn between the last confirmed pivot and the live pivot. The grid redraws every bar as the live extreme moves, so the retracement levels always reflect the current swing range. The OTE (Optimal Trade Entry) zones at 0.236–0.382 and 0.618–0.786 are highlighted with a fill to make them easy to spot at a glance.
⚙️ HOW IT WORKS
Pivot detection:
Pivots are identified using ta.pivothigh() and ta.pivotlow() with a user-defined lookback (Pivot Length). A pivot high is confirmed when the bar has N lower highs on both sides; a pivot low when the bar has N higher lows on both sides. This means confirmed pivots appear with a delay of N bars — this is inherent to the standard pivot detection algorithm.
Strength grading:
Once a pivot is detected, the script measures the absolute price distance from the previous pivot to the current one. If this distance exceeds 1.5× the current ATR value, the pivot is classified as "Strong"; otherwise "Weak." A minimum swing size filter (Min Swing Size, expressed as an ATR multiple) lets you suppress insignificant swings entirely.
Structure logic:
The indicator maintains a running structure direction variable. When a new pivot high exceeds the previous pivot high and the current structure is already bullish, it triggers a BOS ↑. If the structure was bearish, it triggers a CHoCH ↑ (reversal). Mirror logic applies for lows. This follows standard Smart Money Concepts methodology.
Missed pivot logic:
Between any two consecutive same-side pivots, the indicator records the highest high or lowest low that occurred in the gap. This "missed" extreme is marked and extended as a horizontal level. The level is automatically removed from the chart when price closes through it — keeping only active levels visible.
Live pivot:
After each confirmed pivot, the script starts tracking the running high (if expecting a pivot high next) or running low (if expecting a pivot low). This value updates every bar and serves as one anchor of the Fibonacci grid. A "▲?" or "▼?" label and a dashed line show where this potential pivot currently sits.
Fibonacci grid:
The retracement is calculated between the lower and upper anchor of the current swing (using the confirmed pivot on one side and the live extreme on the other). All seven standard ratios are drawn as horizontal lines from the earlier pivot's bar index to 5 bars into the future. The 0.5 and 0.618 levels are drawn thicker and in a highlight color for emphasis.
⚠️ REPAINTING BEHAVIOR — IMPORTANT
This indicator is designed as a live analysis tool , not a backtesting signal generator. The following elements will change on the current bar:
— The Live Pivot marker moves as the running extreme updates
— The Fibonacci grid redraws as the live anchor moves
— BOS/CHoCH labels based on pivots inherit the standard pivot detection delay
Confirmed pivots themselves do not repaint — once a bar is no longer within the pivot lookback window, its pivot status is final. The alert system includes a "Confirmed Only" toggle (on by default) that restricts alerts to bar-close events, ensuring no repainting alerts reach your trading bot.
📖 HOW TO USE
Reading the chart:
— ▲ / ▽ labels at swing lows = confirmed pivot lows (filled = Strong, outline = Weak)
— ▼ / △ labels at swing highs = confirmed pivot highs (filled = Strong, outline = Weak)
— ◇ markers = missed reversals (cyan for missed lows, orange for missed highs)
— Dotted horizontal lines from ◇ markers = active missed levels (auto-removed when broken)
— "BOS ↑/↓" yellow labels = Break of Structure (trend continuation)
— "CHoCH ↑/↓" green/red labels = Change of Character (potential reversal)
— Purple dashed line with "▲?" or "▼?" = live potential pivot (updates every bar)
— Fibonacci lines with OTE zone fills = dynamic retracement grid
Suggested workflow:
— Use CHoCH labels as early warning of trend reversals — then look for entries in the Fibonacci discount/premium zones
— Use BOS labels to confirm trend continuation — look for pullback entries at 0.618–0.786 retracement
— Watch the dashboard's "Fib Zone" readout: Discount (below 38.2%) favors buys, Premium (above 61.8%) favors sells, Equilibrium suggests waiting
— Missed reversal levels act as hidden S/R — watch for reactions when price revisits them
Timeframe guidance:
— Scalping (1–5min): Pivot Length 3–5, Min Swing 0.5 ATR, Strong Only filter
— Intraday (15min–1H): Pivot Length 5–10, default settings
— Swing (4H–Daily): Pivot Length 10–20, show all strengths for full context
⚙️ KEY SETTINGS REFERENCE
— Pivot Length (default 5): bars left/right for pivot detection — lower = faster but noisier
— ATR Length (default 14): period for strength grading and minimum swing filter
— Min Swing Size (default 0.0): minimum swing as ATR multiple — increase to filter small moves
— Pivot Strength Filter (default All): show All / Strong Only / Weak Only
— Max Active Levels (default 10): maximum missed-reversal horizontal lines displayed
— Show Live Pivot (default On): toggle the real-time potential pivot tracker
— Show Fibonacci Grid (default On): toggle the dynamic retracement overlay
— Show Extensions (default Off): add 1.272 and 1.618 extension levels
— Show Fib Zone Fill (default On): highlight OTE zones (0.236–0.382 and 0.618–0.786)
— Alerts: Confirmed Only (default On): restrict alerts to bar-close confirmation — recommended for bots
📊 Dashboard
The info panel (adjustable to any chart corner) displays:
— Current market structure (Bullish / Bearish / Ranging)
— Last confirmed pivot type and price
— Live pivot direction and price
— Number of active missed-reversal levels
— Last PH and PL values
— Fib Zone classification (Premium / Discount / Equilibrium) with percentage
— Current timeframe and indicator version
⚠️ DISCLAIMER
— This tool is intended for live chart analysis and structure mapping — it is not a standalone entry/exit signal system.
— The live pivot and Fibonacci grid are designed to repaint by nature — they track the forming swing in real time. Do not use them for backtesting.
— Past pivot patterns and structure shifts do not guarantee future price behavior.
— Always combine structural analysis with proper risk management and additional confluence. Indicator

Fair Value Gap Signals [UAlgo]Fair Value Gap Signals is a price action indicator that detects bullish and bearish Fair Value Gaps and then tracks how price behaves inside those gaps over time. Instead of only drawing static imbalance boxes, the script treats each FVG as a stateful object with live metrics, lifecycle states, mitigation logic, and optional rejection signals. This makes it useful for traders who want both structural FVG mapping and real time interaction analysis after the gap is created.
The indicator runs on price ( overlay=true ) and automatically identifies classic 3 candle FVG formations. Each detected gap is stored in an internal object with its own box, CE midline, metric bars, status, and signal label handling. As price revisits a gap, the script measures how deeply price penetrates the zone, how much volume is accumulated during tests, and how strong the test candles are in terms of directional body expansion (velocity style scoring).
A key design goal of this script is practical decision support. It can show:
Fresh gaps
Testing behavior
Filled or invalidated gaps
Rejection events (potential reversal signals)
Live VVD style metrics (Velocity, Volume, Depth / Safety) inside the FVG
It also includes an ATR filter to ignore small gaps, visibility limits to keep charts clean, optional CE midline plotting, and alert conditions for major gap events.
🔹 Features
🔸 1) Automatic Bullish and Bearish FVG Detection
The script detects standard 3 candle Fair Value Gaps using simple price displacement logic:
Bullish FVG when current low is above high from two bars ago
Bearish FVG when current high is below low from two bars ago
When a gap is confirmed, it is stored as a custom Gap object and immediately drawn on the chart with its own box, CE midline, and metric containers.
🔸 2) Stateful FVG Lifecycle Tracking
Each gap is tracked through multiple statuses instead of being treated as a static box:
Fresh
Testing
Tested
Rejected
Filled
This allows the indicator to model how price interacts with a gap over time and not just where the gap originally formed.
🔸 3) Configurable Mitigation Method (Close or Wick)
Users can choose how FVG mitigation is confirmed:
Close means invalidation requires a close through the far boundary
Wick means a wick touch through the far boundary is enough
This is a very useful option because traders often use different mitigation definitions depending on instrument and timeframe.
🔸 4) ATR Based Gap Size Filter
An optional ATR filter removes smaller gaps that may be insignificant in volatile conditions. When enabled, the script ignores bullish or bearish FVGs whose size is smaller than the current ATR value (using the chosen ATR length).
This helps reduce noise and keeps the display focused on stronger imbalances.
🔸 5) CE Midline (Consequent Encroachment) Support
Each FVG can display a dotted midline representing the center of the gap (Consequent Encroachment). This gives traders an additional reference inside the imbalance and is commonly used as a reaction level in ICT style workflows.
The CE line can be turned on or off with a dedicated input.
🔸 6) VVD Metrics Inside Each Gap (Velocity, Volume, Depth)
One of the strongest features of this script is the live metric visualization inside every active gap. The indicator tracks and displays three bar style metric boxes:
Velocity
Volume
Depth (rendered as a safety style score from penetration depth)
These metrics update as price tests the gap and provide a quick visual estimate of test quality, participation, and penetration risk.
🔸 7) Rejection Signal Detection with Context
When price enters a gap and then rejects from it with sufficient test volume, the script can print a directional signal label. Bullish gaps can generate Buy or Strong Buy labels and bearish gaps can generate Sell or Strong Sell labels.
Signal strength is influenced by the velocity metric, and the tooltip includes extra details such as velocity score, volume score, safety score, and test count.
🔸 8) Test Counting and Multi Test Awareness
The indicator keeps track of how many times a gap has been tested. This can help traders distinguish first touch behavior from repeated interactions that may weaken the setup.
The test count can also be displayed as text inside the main FVG box when metrics are enabled.
🔸 9) Visibility Control for Cleaner Charts
To avoid clutter, the script limits how many active bullish and bearish gaps are visually displayed at once using Max Visible FVGs . It scans from newest to oldest and only shows the most recent valid gaps per side.
Older or non visible gaps still exist in logic and continue updating internally, but their visuals are hidden.
🔸 10) Smart Object Cleanup and Retained Signal Labels
The script enforces an internal gap limit and removes older gap objects when needed. Gap boxes, CE lines, and metric boxes are deleted during cleanup, while rejection labels are intentionally allowed to remain on the chart for historical context.
This gives users a cleaner display while preserving past signal markers.
🔸 11) Alert Conditions for Key FVG Events
Built in alert conditions are provided for:
New FVG formed
FVG testing (price enters a gap)
FVG filled (mitigated / invalidated)
FVG rejection signal (potential reversal)
This makes the script suitable for active monitoring across multiple charts or watchlists.
🔹 Calculations
1) Bullish and Bearish FVG Detection Logic
The script uses classic 3 candle gap conditions:
bool fvgBull = low > high
bool fvgBear = high < low
Interpretation:
A bullish FVG exists when the current candle low leaves a gap above the high from two bars ago.
A bearish FVG exists when the current candle high leaves a gap below the low from two bars ago.
When detected, the script creates a Gap object and stores:
Top boundary
Bottom boundary
Direction
Origin index
Status and metrics
Visual objects (main box, metric boxes, midline, label handle)
2) ATR Filter for Minimum Gap Size
If the ATR filter is enabled, the script compares gap size with ATR and rejects undersized gaps:
float atrVal = ta.atr(atrLength)
float gapSizeBull = low - high
float gapSizeBear = low - high
if fvgBull and gapSizeBull < atrVal
fvgBull := false
if fvgBear and gapSizeBear < atrVal
fvgBear := false
This creates a volatility adjusted threshold for FVG relevance.
3) Gap Object Initialization and Visual Construction
When a new gap is created, the setup method initializes both state and visuals:
Main FVG box
CE midline
Three metric boxes (Vel, Vol, Dpt)
The main box is drawn from the origin index to a small forward projection:
g.paramBox := box.new(left = idx, top = top, right = bar_index + 5, bottom = bottom, ...)
The CE line is placed at the midpoint:
float midY = (top + bottom) / 2
The metric area is split into three horizontal segments inside the gap height so each metric can expand in width over time.
4) Gap Status Model and State Transitions
Each gap starts as Fresh . As price interacts with the gap, the script can move it through:
Testing when price enters the zone
Tested when price leaves after a test
Rejected when rejection conditions are met
Filled when mitigation occurs
This logic is implemented inside the update() method, which runs every bar for each stored gap.
5) Test Detection and First Touch Handling
The script avoids counting the forming bar as a test:
bool canTest = bar_index > g.index + 1
A gap is considered under test when the current candle range overlaps the gap:
bool isInside = canTest and (h >= g.bottom and l <= g.top)
When price first enters a fresh gap:
if g.status == "Fresh"
g.status := "Testing"
g.testCount := 1
g.testStartVolume := volume
eventCode := 1
This event code is later used for the FVG Testing alert condition.
6) Velocity Metric Calculation
Velocity is a bar quality style score calculated during gap tests. It combines body dominance and a directional bonus:
float bodyRatio = math.abs(close - open) / barRange
Directional bonus:
Bullish gap gets bonus if the test candle closes bullish
Bearish gap gets bonus if the test candle closes bearish
float currentVelocity = math.min(bodyRatio + directionBonus, 1.0)
The gap stores the maximum velocity observed across all tests:
if currentVelocity > g.maxVelocity
g.maxVelocity := currentVelocity
Interpretation:
Higher velocity suggests stronger directional response while testing the gap.
7) Volume Metric Calculation
During tests, the script accumulates test volume:
if isInside
g.testVolume += volume
Later, it compares the accumulated test volume to an expected volume estimate:
float expectedVol = volAvg * math.max(1, (bar_index - g.index) / 2)
float volScore = math.min(g.testVolume / expectedVol, 1.0)
This creates a normalized volume score used in both the metric bar length and the rejection label tooltip.
8) Depth Metric and Safety Score Calculation
Depth tracks how far price penetrates into the gap during tests.
For bullish gaps:
Depth is measured from gap top downward when price dips below the top boundary.
For bearish gaps:
Depth is measured from gap bottom upward when price rises above the bottom boundary.
Examples:
if g.isBullish
if l < g.top
currentDepth := g.top - l
else
if h > g.bottom
currentDepth := h - g.bottom
The maximum penetration depth is stored:
if currentDepth > g.maxDepth
g.maxDepth := currentDepth
The displayed metric is a safety style score:
float depthRatio = g.maxDepth / gapSize
float safetyScore = math.max(0.0, 1.0 - depthRatio)
Interpretation:
Deeper penetration reduces safety score and may imply weaker rejection quality.
9) Fill / Mitigation Logic (Close or Wick)
A gap is marked Filled when price crosses the far boundary in the inverse direction, according to the selected mitigation method:
if mitType == "Close"
filledInverse := g.isBullish ? (close < g.bottom) : (close > g.top)
else
filledInverse := g.isBullish ? (l < g.bottom) : (h > g.top)
When filled:
Status becomes Filled
Gap is deactivated
Event code becomes 2
Gap visuals are deleted
This event code feeds the FVG Filled alert condition.
10) Rejection Signal Logic
Rejection is checked only while the gap is active and price is inside the gap. The script also requires enough accumulated test volume:
if isInside and g.testVolume > volAvg * 0.5
Rejection condition:
Bullish gap rejection if price probes below the gap top and closes back above the gap top
Bearish gap rejection if price probes above the gap bottom and closes back below the gap bottom
bool rejected = g.isBullish ? (l < g.top and close > g.top) : (h > g.bottom and close < g.bottom)
When rejection is confirmed:
Gap status becomes Rejected
Optional signal label is drawn (Buy, Strong Buy, Sell, Strong Sell)
Event code becomes 3
This event code feeds the FVG Rejection Signal alert condition.
11) Signal Strength and Tooltip Metrics
When a rejection signal is printed, the script builds a tooltip with normalized scores:
Velocity score from maxVelocity
Volume score from testVolume versus expectedVol
Safety score from gap penetration depth
Test count
It also upgrades the signal text to Strong Buy or Strong Sell when max velocity exceeds 0.6:
if g.maxVelocity > 0.6
icon := g.isBullish ? "Strong Buy" : "Strong Sell"
This provides a compact label with deeper context available on hover.
12) Visibility Limiting and Render Hiding
The script iterates through gaps from newest to oldest and shows only the most recent active bullish and bearish gaps up to maxVisible per side. Non visible gaps are not deleted, but their visuals are hidden by setting colors and text to na .
This is useful for traders who want a focused view of current opportunities without losing older gap state tracking in the background.
13) Metric Bar Rendering Logic
Each metric box grows horizontally from the gap origin according to a normalized score:
Velocity length from maxVelocity
Volume length from volScore
Depth / Safety length from safetyScore
Example:
int len1 = int(math.max(1, maxWidth * velScore))
g.rankBox1.set_right(g.index + len1)
If metric display is disabled, the script hides the metric boxes and text while keeping the gap logic active.
14) Array Cleanup and Object Management
The script enforces a strict gap storage limit with GAP_LIMIT . When exceeded, the oldest gap is removed and its visuals are deleted:
if gaps.size() > GAP_LIMIT
gaps.cleanup()
The cleanup method deletes:
Main gap box
CE midline
Velocity metric box
Volume metric box
Depth metric box
Rejection info labels are intentionally preserved for historical review.
15) Alert Conditions
The script exposes four alert conditions:
alertcondition(fvgBull or fvgBear, "New FVG Formed", ...)
alertcondition(anyTesting, "FVG Testing", ...)
alertcondition(anyFilled, "FVG Filled", ...)
alertcondition(anySignal, "FVG Rejection Signal", ...)
These alerts are driven by the live event codes returned from each gap's update() call and make the indicator suitable for workflow automation. Indicator

ICT Unicorn Model [UAlgo]ICT Unicorn Model is a chart overlay indicator that automates a practical interpretation of the ICT “Unicorn” concept by combining two core components: a Market Structure Shift style Breaker Block (BB) and a Fair Value Gap (FVG). The script first builds a rolling pivot map using configurable left and right pivot bars, then monitors those pivots for structure breaks that qualify as bullish or bearish breaker blocks. Separately, it detects 3 candle FVG imbalances with a minimum size filter. A Unicorn is confirmed when a newly printed FVG overlaps an active breaker block of the same direction.
The output is built for real trading workflows and chart readability. Breaker blocks and FVGs can exist independently, but when they align, the script highlights the overlap region as a Unicorn zone and labels it. All zones extend forward in time and are automatically removed when mitigation or invalidation conditions are met. Optional session filtering is included to restrict detection to a specific trading window for killzone style usage.
Educational tool only. Not financial advice.
🔹 Features
🔸 1) Pivot Based Structure Mapping
The indicator uses built-in pivot detection to create a reliable swing framework. Both pivot highs and pivot lows are stored as structured objects that keep track of pivot time, bar index, pivot price, pivot direction, and whether that pivot has already been “broken” to prevent repeated processing. This pivot map becomes the backbone of the breaker block engine, allowing the script to reference meaningful swing points instead of reacting to minor noise.
🔸 2) Breaker Block Detection via Market Structure Shift Logic
Breaker blocks are created when price breaks through an unbroken pivot in a way that signals a directional shift in structure.
Bullish Breaker Block: price closes above an unbroken pivot high, then the script validates the context by locating two pivot lows around that pivot high and requiring a lower low relationship between them (LL style confirmation in this implementation). Once confirmed, a bullish breaker block zone is stored using the pivot candle’s full range.
Bearish Breaker Block: price closes below an unbroken pivot low, then the script validates the context by locating two pivot highs around that pivot low and requiring a higher high relationship between them (HH style confirmation in this implementation). Once confirmed, a bearish breaker block zone is stored using the pivot candle’s full range.
🔸 3) Fair Value Gap Detection with Minimum Size Filter
The FVG engine detects classic 3 candle price imbalances:
Bullish FVG: current low is above high from two bars ago.
Bearish FVG: current high is below low from two bars ago.
A minimum FVG size filter is applied using raw price points so you can ignore tiny gaps that are usually filled immediately. This makes the script easier to adapt across different markets and timeframes.
🔸 4) Unicorn Confirmation via Directional Overlap
A Unicorn is confirmed only when a newly printed FVG overlaps an active breaker block and both are in the same direction. The overlap test is a standard price interval intersection check, and the direction match ensures bullish FVGs only confirm bullish unicorns and bearish FVGs only confirm bearish unicorns.
When a Unicorn is confirmed, the script draws a dedicated Unicorn zone covering the combined overlap footprint and prints a simple Bull or Bear label directly on the chart.
🔸 5) Optional Session Filter for Killzone Style Workflows
A session filter can restrict detection to a specific time window. If enabled, the script only runs breaker block detection, FVG detection, and Unicorn confirmation while the current bar is inside the selected session. This is useful when you only want signals during higher participation windows.
🔸 6) Automatic Forward Extension, Mitigation, and Cleanup
All zones behave as live objects:
Breaker block boxes extend forward until invalidation.
FVG boxes extend forward until mitigation.
Unicorn boxes extend forward until the associated FVG mitigation condition is met.
When a zone is mitigated or invalidated, its box and label objects are deleted and removed from internal arrays. This keeps the chart clean and prevents stale zones from accumulating.
🔸 7) Object and Memory Management for Chart Stability
The script uses arrays of custom types (Pivot, BreakerBlock, FVG, Unicorn) and enforces internal history limits to reduce clutter and object growth. Older items are shifted out when limits are exceeded, and graphical objects are deleted when no longer valid to maintain stable chart performance.
🔹 Calculations
1) Time Filter (Session Gate)
If the time filter is disabled, detection runs on every bar. If enabled, detection only runs when the chart time is inside the selected session.
in_session = not use_time_filter or time(timeframe.period, time_session) != 0
Interpretation:
If use_time_filter is false, in_session is always true.
If use_time_filter is true, time() returns non-zero only while the bar is inside the session.
2) Pivot Detection and Pivot Object Storage
Pivot highs and lows are detected using PulseWire pivot functions with user-defined left and right bars. Pivots are confirmed after right_bars bars, so the stored pivot time and bar index are offset by right_bars to align the pivot to the originating candle.
ph = ta.pivothigh(high, left_bars, right_bars)
pl = ta.pivotlow(low, left_bars, right_bars)
When a pivot is found:
array.unshift(pivots, Pivot.new(time , bar_index , ph, true, false, high , low ))
The pivot list is capped to keep the script lightweight:
if array.size(pivots) > 20
array.pop(pivots)
3) Bullish Breaker Block Detection
A bullish breaker is triggered when price closes above an unbroken pivot high. The script then searches for pivot lows around that pivot high and requires a lower low relationship between them. If this context check passes, the pivot is marked as broken and a bullish breaker block is stored.
if p.isHigh and not p.isBroken and close > p.price
...
if foundLL
p.isBroken := true
array.push(active_bbs, BreakerBlock.new(p.time, p.index, p.highPrice, p.lowPrice, true, true, na))
Breaker block zone definition is derived from the pivot candle:
Top = pivot candle high
Bottom = pivot candle low
4) Bearish Breaker Block Detection
A bearish breaker is triggered when price closes below an unbroken pivot low. The script then searches for pivot highs around that pivot low and requires a higher high relationship between them. If this context check passes, the pivot is marked as broken and a bearish breaker block is stored.
if not p.isHigh and not p.isBroken and close < p.price
...
if foundHH
p.isBroken := true
array.push(active_bbs, BreakerBlock.new(p.time, p.index, p.highPrice, p.lowPrice, false, true, na))
5) Fair Value Gap Detection and Sizing
Bullish FVG requires current low to be above high .
Bearish FVG requires current high to be below low .
A minimum size filter is applied in points:
bool isBullishFVG = low > high and (low - high ) >= fvg_min_volume
bool isBearishFVG = high < low and (low - high) >= fvg_min_volume
FVGs are stored with their start anchored to bar_index and time , matching the gap’s originating structure:
if isBullishFVG
array.push(active_fvgs, FVG.new(time , bar_index , low, high , true, false, na))
if isBearishFVG
array.push(active_fvgs, FVG.new(time , bar_index , low , high, false, false, na))
6) Overlap Rule for Unicorn Confirmation
A Unicorn requires overlap plus direction agreement. The overlap is calculated as an interval intersection:
method overlaps(BreakerBlock this, FVG fvg) =>
bool isOverlapping = (fvg.bottom <= this.top) and (fvg.top >= this.bottom)
isOverlapping and (this.isBullish == fvg.isBullish)
Interpretation:
The FVG range must intersect the breaker block range, and both must be bullish or both bearish.
7) Unicorn Zone Construction
When a new FVG prints, the script compares it against all active breaker blocks. If an overlap is found, it creates a Unicorn zone and a Bull or Bear label. The Unicorn box boundaries are computed using min and max edges between the BB and FVG:
float topEdge = math.min(bb.top, latestFVG.top)
float bottomEdge = math.max(bb.bottom, latestFVG.bottom)
The Unicorn zone is then drawn and extended forward.
8) Mitigation and Invalidation Logic
Breaker Block invalidation
Bullish BB invalidates if close goes below BB bottom.
Bearish BB invalidates if close goes above BB top.
if (bb.isBullish and close < bb.bottom) or (not bb.isBullish and close > bb.top)
bb.isActive := false
if not na(bb.bbBox)
box.delete(bb.bbBox)
array.remove(active_bbs, i)
FVG mitigation
Bullish FVG mitigates if close goes below FVG bottom.
Bearish FVG mitigates if close goes above FVG top.
if (fvg.isBullish and close < fvg.bottom) or (not fvg.isBullish and close > fvg.top)
fvg.isMitigated := true
if not na(fvg.fvgBox)
box.delete(fvg.fvgBox)
array.remove(active_fvgs, i)
Unicorn mitigation
Unicorn zones are removed when the associated FVG mitigation condition is met:
bool isMitigated = (uni.isBullish and close < uni.fvg.bottom) or (not uni.isBullish and close > uni.fvg.top)
if isMitigated
box.delete(uni.uniBox)
label.delete(uni.uniLabel)
array.remove(unicorns, i)
9) Forward Extension and Internal Limits
Boxes are extended on each bar by updating right = bar_index + 5 to keep them projected slightly forward. Arrays are capped to control history size and object usage:
if array.size(active_bbs) > 50
array.shift(active_bbs)
if array.size(active_fvgs) > 50
array.shift(active_fvgs)
if array.size(unicorns) > 50
array.shift(unicorns) Indicator

Indicator

Rejection Blocks [UAlgo]Rejection Blocks is a market structure and supply demand overlay built to detect and manage rejection based zones that form after liquidity sweeps and structure shifts. The script tracks recent swing highs and swing lows, monitors for sweep style rejection candles around those swing levels, and then requires a confirmation break before registering a Rejection Block as an active zone.
Each Rejection Block is visualized as an outer zone plus internal buy and sell strength segments that act like a compact sentiment map. The blocks extend forward over time, respond to mitigation and invalidation rules, and can optionally stop extending or be deleted after mitigation. The script also optionally draws structure annotations such as sweep markers and BOS or CHOCH lines to provide context for why a block formed.
This indicator is designed as a complete zone lifecycle engine. It focuses on repeatable rule based detection, strict candle shape filtering for rejection quality, and robust object management so you can keep a clean chart while tracking the most relevant zones.
🔹 Features
1) Pivot Based Market Structure Tracking
The engine uses pivot highs and pivot lows to identify the most recent swing high and swing low levels. These levels act as the structure references for:
Sweep detection
Break of structure detection
Change of character detection
Swing left bars and swing right bars control how strict the swing confirmation is.
2) Rejection Candle Validation with Sweep Logic
A candidate Rejection Block begins with a sweep style candle at a swing level:
Bullish rejection candle sweeps below the last swing low and closes back above it
Bearish rejection candle sweeps above the last swing high and closes back below it
Two sweep modes are available:
Wick sweep (open and close inside)
Any sweep (close inside)
Min sweep distance in ticks can be required to avoid tiny micro sweeps.
3) Optional Candle Shape Filter for Quality Control
When enabled, the script enforces a strict rejection candle profile using:
Minimum wick to body ratio
Minimum dominant wick percent of candle range
Maximum opposite wick percent of candle range
Maximum body percent of candle range
This helps filter out candles that technically sweep but do not display rejection characteristics.
4) Close Location Filters
Additional close filters can be applied:
None
Close in favorable half of the candle range
Close beyond open
This improves selectivity and allows you to tailor the definition of rejection strength.
5) Flexible Rejection Block Zone Models
The zone that is stored and drawn for a Rejection Block can be defined in multiple ways:
Wick to Body
Open to Extreme
Full Candle
Body
This allows alignment with different trading methodologies, from wick based reaction zones to body based execution zones.
6) Confirmation Window and Pending Candidates
Rejection candles do not become active zones immediately. They enter a pending list and require confirmation within a defined window. Confirmation is achieved when price breaks the opposite structure level:
Bullish candidate confirms when price breaks above the last swing high
Bearish candidate confirms when price breaks below the last swing low
If confirmation does not occur within the confirm window, the candidate expires. This prevents old sweeps from creating late zones.
7) Strength Segmentation Inside the Block
Each active block contains:
An outer zone box representing the full block range
An inner buy strength box
An inner sell strength box
A cap line that marks the maximum inner width boundary
Strength is estimated at formation time using one of two models:
Close location
Close plus wick
Inner widths scale based on the computed buy and sell strengths, giving a quick visual of where pressure likely dominated inside the rejection candle.
8) Lifecycle Management: Extension, Mitigation, Invalidation, Aging
Blocks are actively managed through their lifecycle:
Extension
Blocks extend to the right as time progresses.
Mitigation
Blocks can be marked mitigated by touch or by close inside. After mitigation, the block can optionally stop extending or be deleted.
Invalidation
Blocks can be invalidated by wick or by close beyond the block boundary, with optional deletion on invalidation.
Aging
Blocks can be removed after a maximum age in bars to keep the chart focused.
9) Structure Annotations: Sweep, BOS, CHOCH
When enabled, the script draws contextual structure lines and labels:
SW lines indicating swing sweep context
BOS lines for continuation breaks
CH lines for change of character
A maximum line budget is enforced to respect object limits.
10) Robust Object Budgeting and Cleanup
The engine enforces limits for:
Maximum blocks
Maximum pending candidates
Maximum structure lines
Old objects are deleted in a controlled way to avoid exceeding PulseWire limits and to keep the most relevant zones visible.
🔹 Calculations
1) Candle Parts and Rejection Shape Metrics
The script breaks each candle into components:
Range
Body size
Upper wick
Lower wick
It then normalizes values by range and uses them for shape validation:
Dominant wick is lower wick for bullish direction and upper wick for bearish direction
Opposite wick is the other side
Body percent is body divided by range
A rejection candle passes shape checks when dominant wick is large enough relative to body, dominant wick percent exceeds a threshold, opposite wick percent stays below a threshold, and body percent stays below a threshold.
2) Sweep Validation Against Structure Level
For bullish direction, sweep requires low to trade below the swing level by a tick margin and close to finish back above the level. For bearish direction, sweep requires high to trade above the swing level by a tick margin and close to finish back below the level.
Min sweep ticks sets the margin:
sweepMargin equals minSweepTicks multiplied by mintick
The wick sweep mode further requires open to remain inside the level on the correct side.
3) Zone Derivation Models
Zone bounds are determined from candle anatomy based on the selected RB zone model.
Wick to Body:
Bullish zone from body bottom to low
Bearish zone from high to body top
Open to Extreme:
Bullish zone from open to low
Bearish zone from high to open
Full candle:
High to low
Body:
Body top to body bottom
These bounds become the candidate block top and bottom.
4) Strength Estimation
Base strength uses close location within the candle range:
closeLoc equals clamp of (close minus low) divided by range
Buy strength equals closeLoc
Sell strength equals 1 minus buy strength
If Close plus wick is selected, dominant wick contribution is blended into the buy strength calculation using fixed weights. Strength is an approximation and is fixed at formation time.
5) Market Structure Break Detection and Trend State
The engine tracks last swing high and last swing low timestamps and prices. It then detects breaks using cross style conditions:
Bull break when close crosses above last swing high
Bear break when close crosses below last swing low
Trend direction is updated on confirmed bars after a break is detected. The engine also tracks the last broken swing timestamp to avoid duplicate structure events on the same swing.
BOS and CHOCH are derived by comparing the new break direction to the previous trend direction.
6) Candidate Creation and Pending Queue
On confirmed bars, if a rejection candle occurs at the relevant swing level, a Candidate is created with:
Formation time
Zone top and bottom
Direction
Buy and sell strength
Confirmation level which is the opposite swing level
Candidates are pushed into a pending array which is capped by max pending.
7) Candidate Confirmation Within a Window
Each pending candidate is evaluated until it either expires or confirms:
Expired when time since candidate leftT reaches confirmWindow in bars
Confirmed when price breaks the candidate confirmLevel in the direction required for structure confirmation
Confirmed candidates are converted into Blocks and added to the active blocks array.
8) Block Construction and Visual Geometry
When a block is created, the script draws:
Outer box covering the full block range
Inner buy and sell boxes split at the zone midpoint
Cap line placed at a maximum percentage of the outer width
Inner widths are scaled using the block strengths and innerMaxPctOfOuter. A minimum inner width in bars is enforced.
9) Mitigation Detection
Mitigation is detected using one of two modes:
Touch mode: high low intersects the block range
Close Inside mode: close is inside the block range
After mitigation, the block can change visual styling, optionally stop extending, and optionally be deleted.
10) Invalidation Detection
Invalidation is evaluated when enabled:
For bullish blocks, invalidation occurs if price goes below the bottom
For bearish blocks, invalidation occurs if price goes above the top
This can be evaluated by wick or close depending on invalidation mode. Invalidated blocks can be visually marked and optionally deleted.
11) Aging and Cleanup
If max age bars is set, blocks older than that age are removed. Limits on blocks and structure lines are enforced with controlled deletion to respect platform constraints.
12) Visibility Filters
Blocks are shown or hidden based on direction toggles:
Show bullish blocks
Show bearish blocks
Structure lines are also gated by a separate toggle and a maximum line budget. Indicator

ICT MMM/AMD (Power of 3) [UAlgo]ICT MMM / AMD (Power of 3) is an intraday market structure framework that models the classic Accumulation, Manipulation, Distribution cycle using configurable killzones. The script tracks the Asia range as the accumulation anchor, looks for a liquidity sweep during the London window, waits for a Market Structure Shift confirmation, and then maps a clean entry model using Fair Value Gap logic and optional displacement requirements.
Beyond the core cycle, the indicator provides two additional layers of context:
Previous Day High and Previous Day Low levels for higher timeframe objectives
A dynamic Dealing Range built from recent pivots to visualize premium, discount, and equilibrium
The result is a structured workflow tool that organizes ICT style intraday logic into clear, step by step states with optional filters for cleaner execution.
🔹 Features
1) Session Based Cycle Engine (Killzones)
The script is built around three sessions selected by the user and evaluated in a chosen IANA timezone:
Accumulation window, typically Asia
Manipulation window, typically London
Distribution window, typically New York AM
Each day begins a new cycle at the start of the accumulation session. The script tracks the running high and low during accumulation, then finalizes those boundaries at the end of the session to create the reference range used by later steps.
2) Accumulation Range Mapping
During accumulation, the indicator maintains:
Accumulation High
Accumulation Low
Optional border only box around the session range
Optional ACC label
When the accumulation window ends, the high and low are frozen and drawn as clean horizontal guides using your selected line style and width.
3) Liquidity Sweep Detection With ATR and Tick Filters
During the manipulation window, the indicator checks for a sweep beyond the accumulation boundaries. The sweep threshold is adaptive and uses the larger of:
A minimum tick distance
A minimum ATR based distance
You can also choose whether sweep validation uses wicks or closes:
Wicks uses High and Low
Closes uses Close only
When a sweep is confirmed, the script labels it as BSL sweep if it sweeps above highs, or SSL sweep if it sweeps below lows. Optional sweep level and wick markers can also be drawn for precise reference.
4) Market Structure Shift Confirmation
After a sweep, the script waits for a Market Structure Shift using confirmed pivots. Pivot Length controls strictness. Higher values require cleaner structure and reduce false shifts, at the cost of added confirmation delay.
Bullish MSS is confirmed when price closes above the most recent confirmed pivot high after an SSL sweep
Bearish MSS is confirmed when price closes below the most recent confirmed pivot low after a BSL sweep
Optional MSS break lines can be displayed so you can see the exact level that defined the shift.
5) Displacement Qualification (Optional Gate Before FVG)
Displacement can be required before Fair Value Gap detection. This filter attempts to enforce a strong impulse candle after MSS by checking:
Body to range proportion
Body size relative to ATR
Directional strength by requiring a break beyond the prior candle extreme
This helps separate soft rotations from decisive expansions, which tends to improve FVG quality in many market conditions.
6) Fair Value Gap Detection and Management
After MSS, the script scans a configurable number of bars for a valid FVG.
Bullish FVG condition uses a three candle gap where the current low is above the high two bars ago
Bearish FVG condition uses a three candle gap where the current high is below the low two bars ago
Once an FVG is active, the script draws top and bottom boundary lines and optionally labels it. When price returns into the gap, the script treats it as mitigated. If the remove option is enabled, the FVG drawings are deleted after mitigation to keep the chart clean.
7) Entry Marking With Optional Distribution Filter
When price touches the active FVG, the script can print an ENTRY label and place a stop line.
Entry can be restricted to the distribution window if desired
This can reduce off session prints and align entries with the intended time of day logic
The stop level is anchored to the sweep extreme with an optional tick padding so you can adapt to spread and micro structure noise.
8) Target Framework Per Cycle
Targets are evaluated after MSS using your selected Target Mode:
PDH PDL only
Range only
PDH PDL plus Range
For bullish MSS, targets can include PDH and the accumulation high
For bearish MSS, targets can include PDL and the accumulation low
Target lines update forward and can stop extending once price hits them, keeping the cycle output visually informative without turning into permanent clutter.
9) Dealing Range Premium Discount Map
A Dealing Range is built from the most recent confirmed pivot high and pivot low using a separate pivot length setting. The script then computes:
Premium as the upper boundary
Discount as the lower boundary
Equilibrium as the midpoint
Optional labels mark DR PREMIUM, DR DISCOUNT, and DR EQ (50%) so you can quickly align entries with premium and discount logic.
10) Previous Day High and Low Overlay
PDH and PDL are pulled from the daily timeframe and drawn as global reference levels. These update at each new day and can be displayed with labels. This keeps higher timeframe objectives visible even when trading lower timeframes.
11) Visual Control and Cycle Retention
The indicator offers full control over:
Line styles
Line widths
Whether lines extend into the future
Whether to show boxes, labels, sweep lines, MSS lines, targets, and dealing range
Completed cycles are stored and older cycles are pruned based on Keep Last Cycles. This preserves recent context while keeping object counts under control.
🔹 Calculations
1) Session State Logic
Each session is evaluated using the chart timeframe, the session input, and the selected timezone. A cycle starts when the accumulation session turns on and ends when it turns off.
Conceptually:
inAcc is true when the current bar time falls inside the accumulation session
accStart is the transition from not inAcc to inAcc
accEnd is the transition from inAcc to not inAcc
These transitions control the lifecycle of each MMM cycle object.
2) Accumulation Range Construction
During accumulation, the script continuously updates the running high and low:
accHigh becomes the maximum observed high within the session
accLow becomes the minimum observed low within the session
At accEnd, these values are finalized and turned into horizontal range guides that define the boundaries used for sweep validation and optional range targets.
3) Sweep Threshold Model
Sweep threshold is a conservative maximum of two measurements:
Minimum sweep distance in ticks
Minimum sweep distance as a fraction of ATR
This creates a single threshold thr that adapts to volatility while still respecting a hard minimum in ticks.
Sweep evaluation then compares either:
High and Low if wicks are used
Close if closes are used
A sweep is confirmed when price probes beyond accHigh plus thr or beyond accLow minus thr.
4) MSS Pivot Framework
Confirmed pivots are used for structure shift validation. The script stores the most recent confirmed pivot high and pivot low and their bar indexes.
After a BSL sweep, bearish MSS triggers when close breaks below the last pivot low
After an SSL sweep, bullish MSS triggers when close breaks above the last pivot high
This ensures MSS is a structural confirmation rather than a subjective interpretation.
5) Displacement Filter Metrics
Displacement quality is checked using:
Body size relative to total candle range
Body size relative to ATR
Directional break beyond the previous candle extreme
Only when these requirements pass does the cycle allow the displacement flag, which can be used as a gate for FVG detection when enabled.
6) FVG Definition
The script uses a strict three candle gap model:
Bullish FVG when current low is above the high two bars ago
Bearish FVG when current high is below the low two bars ago
FVG is only searched within a fixed number of bars after MSS, which keeps the model aligned with the intended timing of the intraday cycle.
7) Mitigation and Entry Touch Logic
When an active FVG is present, a touch is defined as price overlapping the gap region. On the first touch:
If entry marking is enabled and the time filter allows it, the script prints ENTRY and places SL
FVG is marked as mitigated and can optionally be removed from the chart
Stop is computed from the sweep wick extreme plus optional tick padding, aligned with the idea that the sweep should remain the invalidation anchor.
8) Target Selection Logic
Targets are chosen based on direction and the Target Mode:
For bullish MSS, PDH can be Target A, accumulation high can be Target B
For bearish MSS, PDL can be Target A, accumulation low can be Target B
Targets are updated forward each bar and can stop extending once hit, which keeps the current cycle readable.
9) Dealing Range Computation
The dealing range uses the latest confirmed pivot high and pivot low:
DR high equals the higher of the two pivot prices
DR low equals the lower of the two pivot prices
DR equilibrium equals the midpoint of DR high and DR low
This provides a clean premium and discount map that updates as new pivots confirm.
10) Previous Day High and Low Retrieval
PDH and PDL are sourced from the daily timeframe using a security call that references the prior day values. They are reset at each new day, ensuring the lines represent the most recent completed daily range. Indicator
