Indicator

Smart FVG by EonMetricsSMART FVG
What it does
A "Fair Value Gap" (FVG) is a small gap left behind in price when a move happens so fast that a whole price area gets skipped over — nobody actually traded there. It shows up as a gap between three candles in a row. These gaps often get "filled" later, meaning price comes back to trade through that skipped area before continuing on its way (or reversing). This indicator finds these gaps automatically and draws a box around each one.
It also tells you which gaps look more important: a gap is marked "STRONG" only when BOTH of these are true at the same time — the gap is unusually large (measured against recent average volatility) AND the candle that created it traded on unusually high volume. Both conditions have to be true together; a big gap on quiet volume, or high volume with only a small gap, does not count as Strong. This two-part check is stricter than simply flagging "any big gap," which is what most similar tools do.
How to actually use it (step by step)
Let gaps form naturally as price moves. Each one is drawn as a colored box — green/cyan-ish tones for bullish (demand) gaps, red/orange tones for bearish (supply) gaps.
Pay extra attention to boxes marked "STRONG" — these represent a real, forceful, high-conviction move, not just random noise.
When price comes back down (or up) into a gap box, that's a potential trade opportunity — buy near a bullish gap, sell near a bearish gap — especially reacting at the dotted 50% line drawn through the middle of the box.
Look at the small number in the corner of each box — it counts how many candles ago the gap formed. A small number (fresh gap) is generally considered more reliable than a large number (old, already-tested-many-times gap).
If you turn on the higher-timeframe overlay, you'll also see gaps from a bigger timeframe (marked "HTF") plotted directly on your current chart — these represent bigger, more significant levels than same-timeframe gaps.
Every setting explained
Visualization group
Bullish FVG / Bearish FVG — the fill color for ordinary gaps.
Strong Bullish FVG / Strong Bearish FVG — the fill color for gaps that pass the "Strong" test above.
Show 50% Line (EQ) — draws a line through the exact middle of every gap box; this is a common spot for price to react to.
EQ Line Color.
Width Mode — controls how far the box stretches to the right: "Dynamic" keeps growing the box to reach today's candle in real time, "Fixed" stops the box at a set number of candles wide, "Extended" stretches the box all the way to the right edge of your screen forever.
Fixed Width (bars) — how many candles wide the box is, only used when Width Mode is set to Fixed.
Min FVG Size (x ATR) — the smallest gap size the script will bother drawing, measured against recent average volatility. Raise this to ignore tiny, insignificant gaps; set to 0 to see every gap no matter how small.
Mitigation group (mitigation = "price has now traded back through the gap")
Delete Mitigated Zones — when turned on, a gap box disappears completely once price fills it. When off, it stops growing and stays on the chart as a faded historical marker.
Mitigation Level — decide what counts as "filled": either price reaching the halfway (50%) point of the gap, or price completely closing the entire gap.
Mitigation Confirmation — decide what counts as reaching that level: any wick poking into it ("Wicks"), or a full candle close past it ("Close" — stricter, fewer false triggers).
Imbalance Age group
Show Age Label — displays a small number (like "34b") showing how many candles ago the gap was created.
Fade Old Zones — when turned on, gap boxes slowly become more transparent as they age, so your eye is naturally drawn to the freshest ones.
Max Age for Full Fade (bars) — how many candles it takes for a gap to reach maximum fade/transparency.
Strong Imbalance group
Mark Strong Imbalances — master on/off switch for the whole Strong-gap detection described above.
Min Gap Size (x ATR) — how big the gap must be (relative to recent volatility) to count toward "Strong" — this is one of the two required conditions.
Min Volume (x SMA 20) — how much higher than the recent 20-candle average volume the gap-forming candle's volume must be — this is the second required condition. Both this and the size condition must be true at the same time.
Show 'STRONG' Tag — shows the word "STRONG" written inside qualifying gap boxes.
Labels group
Show Labels — master switch for all text written inside gap boxes (age number, STRONG tag, HTF tag). Turn this off to hide all text and keep only the colored boxes.
Label Text Color.
MTF FVG group (MTF = "multiple timeframes")
Show Higher Timeframe FVGs — turns on the overlay of gaps from a bigger timeframe, drawn directly on your current chart.
Higher Timeframe — which bigger timeframe to pull gaps from (should be higher than whatever timeframe you're currently viewing).
HTF Bullish FVG / HTF Bearish FVG — colors for these imported higher-timeframe gaps.
Show HTF Label — shows an "HTF" tag inside these imported gaps so you can tell them apart from same-timeframe ones. Indicator

SMC Flip Zone Engine ViprasolOverview
The original detects a break of structure, walks back to find the reaction leg that preceded it, and draws a colored zone box, with optional Liquidity Sweep, Fair Value Gap, HTF EMA alignment, and OTE (discount/premium) filters that can be toggled on to reduce noise. This version keeps that zone-detection engine intact and adds a Viprasol confluence and lifecycle layer: a 0-4 confluence score with A/B/C grading, a minimum-score gate, zone mitigation (retest) and invalidation tracking, a per-side cooldown, and an ATR-free risk overlay that projects Entry/SL/TP from a zone when price returns to it.
It is built for traders who work with break-of-structure flip zones and want each zone graded by how much SMC confluence actually backs it, plus automatic tracking of when zones are retested or broken.
How It Works
Structure Break & Reaction Leg (from original):
A bullish flip is triggered when close crosses over the prior highest-high of the lookback window (supply broken); a bearish flip when close crosses under the prior lowest-low (demand broken). On a break, the script walks back over the reaction-leg length to find the extreme of the trap leg — for a bull flip, the lowest low in that window and its bar's high define the zone's bottom and top. A box is drawn from that reaction bar forward.
SMC Filters (from original, toggle-gated):
Four optional filters can each be required before a zone is drawn:
- Liquidity Sweep — the reaction leg must have exceeded the prior structural extreme (taken liquidity).
- FVG / Displacement — a fair value gap must be present around the break (e.g. low > high ).
- HTF Alignment — bull zones only above, bear zones only below, the 50 EMA of a higher timeframe.
- OTE (Discount/Premium) — the zone midpoint must sit in the discount half (bull) or premium half (bear) of the leg, where equilibrium = leg low + (leg high − leg low) × 0.5.
Confluence Score & Grade (new):
Independently of which filters are toggled on, the script evaluates all four confluence conditions as raw booleans on every new zone and sums them into a 0-4 score:
score = sweep? + fvg? + ote? + htfAligned?
The score is mapped to a grade — A (>= 3), B (= 2), C (<= 1) — and printed on the zone box. This means even with all filters off (so every break draws a zone), you can still see which zones are backed by genuine confluence. A "Minimum Confluence Score" input then lets you suppress any zone below a chosen score without having to hard-require specific filters.
Zone Mitigation & Invalidation (new):
Every existing zone is tracked across bars. A zone is mitigated the first time price trades back into its range (low <= top and high >= bot) — this fires a mitigation alert (a potential entry as the flip zone is retested). A zone is invalidated when price closes through it (close < bot for a bull zone, close > top for a bear zone); invalidated zones are recolored gray (or can be left as-is) and fire an invalidation alert. Each transition fires once per zone.
Risk Overlay on Mitigation (new):
When "Show SL/TP on Mitigation" is enabled, the first retest of a zone projects three lines: Entry at the near edge of the zone, Stop-Loss at the far edge (so the zone height is the risk), and Take-Profit at Entry ± zone-height × the Risk:Reward ratio. Colored ENTRY/SL/TP price labels mark the line ends. Only the most recent mitigation's projection is kept, to avoid clutter.
Per-Side Cooldown (new):
An optional cooldown enforces a minimum number of bars between new zones on the same side (tracked as bar_index − lastSideBar >= cooldown), preventing a burst of overlapping zones during a single fast move.
What Is Original (Viprasol Additions)
1. Confluence score (0-4) and A/B/C grade printed on each zone, computed from raw sweep/FVG/OTE/HTF conditions regardless of which filters are toggled.
2. Minimum-confluence-score gate — suppress low-quality zones without hard-requiring individual filters.
3. Zone mitigation (retest) detection with a dedicated alert.
4. Zone invalidation detection (price closes through) with recoloring and a dedicated alert.
5. Risk overlay — Entry/SL/TP projection with colored price labels drawn on the first mitigation of a zone, sized by zone height and the Risk:Reward ratio.
6. Per-side zone cooldown to prevent clustering.
Key Features
From the Original:
- Break-of-structure detection via crossover/crossunder of the lookback high/low
- Reaction-leg walk-back to locate the trap zone behind the break
- Bullish and bearish flip-zone boxes with labels
- Optional Liquidity Sweep, FVG, HTF 50-EMA alignment, and OTE filters
- Oldest-zone pruning to limit chart clutter
Added in This Version (Viprasol):
- 0-4 confluence score with A/B/C grade on every zone
- Minimum-score quality gate
- Mitigation (retest) and invalidation lifecycle tracking with recoloring
- Entry/SL/TP risk overlay with colored price labels on mitigation
- Per-side cooldown
- Info dashboard (active zone counts, HTF state, filters-on count, min score)
- Six alert conditions with dynamic {{ticker}}/{{close}}/{{interval}} messages
How to Use
Getting Started:
1. Add to a standard candlestick chart (not Heikin Ashi).
2. With all filters off (default), every structure break draws a graded zone — read the A/B/C grade to judge quality.
3. To trade only stronger setups, either raise "Minimum Confluence Score" or turn on the specific filters you require.
Reading the Chart:
- Green zone = bullish flip (drawn after a supply break); red zone = bearish flip (after a demand break).
- The bracket on each zone, e.g. , is the confluence grade and score.
- A zone turning gray means price closed through it — it is invalidated.
- When price returns into a zone and SL/TP is enabled, Entry/SL/TP lines and price labels project to the right.
Recommended Starting Points:
- Intraday (5m-15m): Lookback 20, Reaction 7, Min Score 0-1, Cooldown 0-3
- Swing (1H-4H): Lookback 30, Reaction 7-10, Min Score 2, enable HTF alignment
- Higher conviction: Min Score 3 (grade A only), or require Sweep + FVG
These are starting points only — every market and timeframe behaves differently. Backtest and adjust before trading live.
Settings
Market Structure: structure lookback period, reaction-leg length, and max zones kept per side.
SMC Strict Filters: toggles for Liquidity Sweep, FVG (displacement), HTF 50-EMA alignment (with HTF resolution), and OTE (discount/premium). All default off so zones appear immediately.
Confluence & Quality (Viprasol): minimum confluence score, show grade on zone, and per-side zone cooldown.
Risk Overlay (Viprasol): show SL/TP on mitigation, show price labels, and the Risk:Reward ratio.
Visuals: bullish/bearish fill and border colors, and a toggle to dim invalidated zones gray.
Dashboard / Display: dashboard toggle and position.
Alerts
1. New Bull Zone — a bullish flip zone was created
2. New Bear Zone — a bearish flip zone was created
3. Any New Zone — either direction created
4. Bull Mitigation — price returned to a bullish zone (potential long)
5. Bear Mitigation — price returned to a bearish zone (potential short)
6. Zone Invalidated — a zone was closed through and invalidated
All alerts include {{ticker}}, {{close}}, and {{interval}} for dynamic notification messages.
Limitations & Disclaimer
- Zones are created on the bar the structure break confirms; because detection uses crossover/crossunder of close versus the prior swing, signals are evaluated on the closing relationship and the reaction leg is identified after the fact.
- The HTF alignment filter uses request.security with lookahead disabled; HTF values update only as the higher-timeframe bar progresses.
- The FVG and OTE checks are simplified single-bar/leg-midpoint approximations, not full multi-leg ICT constructs.
- Mitigation is detected on the first wick back into a zone; this is an awareness signal, not a guaranteed reversal.
- SL/TP lines and price labels are visual references only and do not place or manage trades.
- Filters and the minimum-score gate reduce the number of zones; in choppy ranges valid zones may be suppressed, while in fast trends overlapping zones may appear if cooldown is off.
- Past performance does not guarantee future results. This indicator is for educational and analytical purposes only and is not financial advice. Always use proper risk management and test on historical data before trading live.
Credits & Attribution
Based on an open-source "Advanced SMC Flip Zones" community indicator, which provided the break-of-structure detection (crossover/crossunder of the lookback high/low), the reaction-leg walk-back that locates the trap zone, the bullish and bearish flip-zone boxes, the optional Liquidity Sweep / FVG / HTF 50-EMA / OTE filters, and the oldest-zone pruning. Added by Viprasol: the 0-4 confluence score and A/B/C grading, the minimum-score quality gate, zone mitigation and invalidation lifecycle tracking with recoloring, the Entry/SL/TP risk overlay with colored price labels, the per-side cooldown, the info dashboard, and the six-condition dynamic alert set.
Published open-source per PulseWire House Rules.
Indicator

Aegis Liquidity Ledger [JOAT]Aegis Liquidity Ledger
Introduction
Aegis Liquidity Ledger is an open-source liquidity pressure indicator built to answer a specific execution question:
Where is directional pressure being sourced, and where has that pressure already left behind a meaningful area of interest?
The script approaches that problem through two linked components:
a volatility-normalized pressure oscillator
shelf detection and origin-zone mapping
The oscillator explains whether participation is pushing in a bullish or bearish direction.
The shelf and origin logic explains where that pressure emerged from.
This separation is intentional.
It gives traders both the why and the where without forcing everything into a single overlay object.
Core Concepts
1. Composite Pressure Engine
The script blends multiple rate-of-change windows into one composite pressure signal.
Short-term impulse and slower campaign participation are both included so the output does not depend on a single lookback length.
2. Volatility-Normalized Thresholds
The pressure signal is measured against its own recent standard deviation rather than a fixed threshold.
This allows the expansion bands to adapt to the instrument and timeframe being viewed.
3. Shelf Detection
The script scans for repeated upper and lower interactions using body extremes and wick touches.
That makes the shelf logic more sensitive to areas where liquidity may have repeatedly rested.
4. Expansion Origin Zones
When pressure transitions through an adaptive bound on a confirmed bar, the script creates a source zone around the origin candle that preceded the release.
This zone remains relevant until price fully accepts through it.
5. Mitigation Logic
Shelves are not removed immediately.
They remain live until price fully accepts through the opposite side of the zone, after which they are visually de-emphasized as mitigated.
Features
Four-window pressure model: fast, medium, slow, and macro ROC blended together
Pressure smoothing: EMA smoothing controls oscillator responsiveness
Adaptive expansion thresholds: thresholds scale with recent pressure volatility
Normalized oscillator: pane output compresses pressure into an interpretable range
Demand and supply shelves: persistent shelf zones are drawn directly on the chart
Origin-zone logic: shelf creation is tied to confirmed expansion events
Touch and intensity tracking: shelf labels summarize interaction count and density
Mitigation state: zones are visually softened after full acceptance through them
Pressure-based candle coloring: optional chart bars reflect dominant liquidity pressure
Institutional dashboard: dashboard summarizes pressure, compression, shelf dominance, and state
Input Parameters
Pressure Engine
Fast ROC
Medium ROC
Slow ROC
Macro ROC
Pressure Smoothing
Expansion Threshold Multiplier
Liquidity Shelves
Shelf Window
Shelf Width ATR
Max Live Shelves Per Side
Show Expansion Origin Zones
Show Shelf Labels
Display
Show Pressure Fill
Show Expansion Glow
Show Zero Line
Color Candles By Pressure
Dashboard Position
Dashboard Size
How to Use This Indicator
Step 1: Read Pressure Before Reading Shelves
Start in the pane.
If the pressure engine is neutral or compressed, shelf interactions are more likely to behave as reaction zones than true continuation sources.
Step 2: Watch for Confirmed Expansion
New shelves matter most when they are created by a confirmed expansion through the adaptive threshold.
That is the moment the script treats the move as meaningful enough to register an origin.
Step 3: Distinguish Live From Mitigated Zones
Fresh shelves are stronger contextual references than mitigated shelves.
Once a zone has been fully accepted through, it should be treated as reduced context rather than untouched inventory.
Step 4: Compare Upper and Lower Density
The interaction counts and intensity values help frame whether the instrument has built more meaningful supply or demand shelves in the current environment.
Step 5: Combine With Structure
Aegis Liquidity Ledger is not a standalone regime classifier.
It works best beside structure or session tools that explain the broader context around the pressure source.
Indicator Limitations
Liquidity shelves are inferred from price behavior, not from direct order book or market-by-order data
Aggressive settings can create more shelves than slower traders may want to track
Pressure normalization adapts to the instrument, but abrupt volatility shocks can still distort thresholds temporarily
A shelf is an area of contextual interest, not a guarantee of reversal or continuation
Originality Statement
Aegis Liquidity Ledger is structured around the relationship between a normalized pressure oscillator and persistent source-zone shelves.
Its design emphasizes where pressure comes from, how dense liquidity has been on each side of price, and whether a prior source has been mitigated, rather than simply plotting another momentum line.
Disclaimer
This indicator is provided for educational and informational purposes only.
It is not a recommendation to trade and should not be interpreted as financial advice.
All shelf and pressure readings are model-based interpretations of chart data and can fail under changing market conditions.
Always use independent analysis and risk management.
Indicator

Imbalance Zone Classifier [JOAT]Imbalance Zone Classifier
Introduction
The Imbalance Zone Classifier detects Fair Value Gaps (price imbalances where no two-sided auction occurred) and assigns each zone a 0–100 Strength Score based on four measurable factors: gap size relative to historical distribution, intrabar buy/sell volume composition, zone age, and mitigation status. Rather than drawing every FVG indiscriminately, this indicator filters by minimum score and renders only the zones most likely to attract institutional order flow on return visits.
The core problem this solves: nearly every FVG tool draws every gap, producing charts saturated with dozens of overlapping boxes that cannot be prioritized. A 0.03% gap on declining volume is not equivalent to a 0.8% gap formed on explosive institutional buying. The Strength Score quantifies that difference, letting the trader focus on the handful of zones that genuinely matter.
Core Concepts
1. Fair Value Gap Detection
An FVG (also known as an inefficiency or price imbalance) occurs when three consecutive candles leave a price gap:
// Bullish FVG: candle high is below candle low
bool bull_fvg = high < low and close > open
// Bearish FVG: candle low is above candle high
bool bear_fvg = low > high and close < open
Detection is confirmed on bar close — the gap is only registered after candle closes — ensuring no repainting. The zone boundaries are the candle high and candle low for a bullish FVG (and their inverses for bearish).
2. The 0–100 Strength Score
Each FVG receives a composite score derived from four sub-scores:
int vol_score = int(math.min(bull_pct / 0.7 * 50, 50)) // 0-50 pts
int size_score = int(math.min(gap_rank * 0.35, 35)) // 0-35 pts
int composite_score = vol_score + size_score // base
// Age decay applied post-formation: score -= 1 per N bars
Size Score (0–35 pts): The gap size as a percentage of price is ranked against the last 1000 bars using a percentile rank. A gap in the top 10% of historical size scores near maximum. A tiny gap scores near zero.
Volume Score (0–50 pts): Lower-timeframe bars within the formation candle's time window are decomposed into buy and sell volume. A bullish FVG with 90% buy-side composition scores 50; one with 50% scores 25.
Age Decay: Zones accumulate bar age. The score decays over time, reflecting that older unmitigated zones become less relevant. Zones below the minimum score threshold fade and are removed.
3. Lower-Timeframe Volume Decomposition
Volume intelligence comes from requesting sub-bar data at the user-specified lower timeframe:
array ltf_bull_vol = request.security_lower_tf("", i_ltf, (close > open ? volume : 0.0))
array ltf_bear_vol = request.security_lower_tf("", i_ltf, (close < open ? volume : 0.0))
float sum_bull_ltf = ltf_bull_vol.sum()
float sum_bear_ltf = ltf_bear_vol.sum()
float bull_pct = sum_bull_ltf / (sum_bull_ltf + sum_bear_ltf)
This decomposes the FVG formation candle's volume into directional sub-bar composition — giving a precise measure of whether the gap was formed by institutional buying pressure or merely a thin-volume vacuum.
4. Mitigation Logic
Zones are considered mitigated when price returns to the zone midpoint (or high/low depending on user setting). Mitigated zones do not disappear immediately — they change color and fade, providing a historical record. They are removed from the active list after a configurable bar count, and a counter increments in the dashboard.
5. Volume Bar Visualization Inside Zones
Each zone renders a proportional buy/sell volume bar inside the zone body — a thin inner box whose right edge shows the bull/bear volume ratio. A zone with 80% buy volume renders its inner bar nearly full green. This gives an immediate visual indication of the composition without requiring the dashboard.
Features
Fair Value Gap Detection: Bullish and bearish FVGs confirmed on bar close, non-repainting
0–100 Strength Score: Composite score from gap size percentile rank and lower-timeframe volume composition
Minimum Score Filter: Only zones above the threshold are rendered — keeps the chart clean
LTF Volume Decomposition: True intrabar buy/sell ratio from lower-timeframe data
Volume Bar Inside Zone: Proportional buy/sell bar rendered within each zone body
Mitigation Tracking: Zones transition to faded color on mitigation; active vs mitigated count in dashboard
Zone Extension: Unmitigated zones extend rightward automatically until price returns
Age Decay: Score degrades over time, naturally purging stale zones below the threshold
9-Row Dashboard: Active bullish zones, active bearish zones, total mitigated, highest current score, session FVG count
Alerts: Bullish FVG formed, bearish FVG formed, bullish FVG mitigated, bearish FVG mitigated
Input Parameters
FVG Detection:
Detect Bullish FVGs: Toggle bullish imbalance detection (default: on)
Detect Bearish FVGs: Toggle bearish imbalance detection (default: on)
Minimum Strength Score (0–100): Filter threshold — only zones above this are shown (default: 25). Higher = fewer, stronger zones.
Mitigation Source: close = mitigated when close crosses zone midpoint. high/low = wick breach removes the zone (default: close)
Max Active Zones: Maximum simultaneous rendered zones (default: 12, range: 3–30)
Volume Intelligence:
LTF Resolution: Lower timeframe for intrabar volume decomposition (default: 1m)
Visualization:
Bullish / Bearish / Mitigated colors: Fully customizable
Show Volume Bars Inside Zones: Display proportional buy/sell bar within each zone (default: on)
Extend Unmitigated Zones: Extend zone boxes rightward until mitigation (default: on)
Dashboard:
Position: Top Right, Top Left, Bottom Right, Bottom Left (default: Top Right)
How to Use This Indicator
Step 1: Set the Minimum Score
Start with the default score of 25. This filters out the weakest gaps while keeping meaningful zones. If the chart still shows too many zones, raise to 40–50. For maximum selectivity on higher timeframes, 60+ selects only the most institutionally significant gaps.
Step 2: Read the Volume Bar Inside Each Zone
A bullish FVG with a mostly green inner bar (80%+ buy volume) was formed by genuine institutional buying. One with a near-50% bar was formed in a thin, directionless push — much less likely to hold on retest. This distinction cannot be made from price action alone.
Step 3: Trade the Retest
Price frequently returns to fill FVG zones, particularly the highest-score zones. The midpoint of the zone (zone top + zone bottom / 2) is the primary retest level. Entry on a return to a high-score bullish FVG, with a stop below the zone low, is a clean risk-defined setup.
Step 4: Monitor Mitigation
Once a zone changes to the mitigated color, it no longer has predictive value as a support/resistance level — it has been filled. Remove it from your analysis. The dashboard count of mitigated zones tells you how efficiently the market is clearing imbalances.
Originality Statement
This indicator is original in its composite strength scoring system applied to Fair Value Gaps using lower-timeframe volume decomposition. Its publication is justified because:
Gap size percentile rank against 1000-bar history normalizes the score across different instruments and timeframes — a 0.5% gap on EURUSD scores the same as a 0.5% gap on BTCUSD regardless of absolute price level
Lower-timeframe volume decomposition provides true intrabar buy/sell composition of each FVG formation candle — a dimension of analysis unavailable from chart-timeframe OHLCV data alone
The visual volume bar inside each zone encodes directional conviction directly within the zone's screen space, creating a two-dimensional information display (price level + volume direction) without additional panels
Age decay combined with minimum score filtering creates a self-organizing, self-cleaning zone map that requires no manual zone management from the trader
Limitations
LTF volume requests add computation overhead. On 1-minute chart timeframes, requesting 1-minute LTF data is a no-op; the function falls back to chart-timeframe volume for those bars.
The strength score is a relative ranking, not an absolute predictive probability. A score of 80 does not mean an 80% chance of holding — it means this zone is stronger than most, not that it is guaranteed to act as support or resistance.
Mitigation is detected on bar close (or high/low depending on setting). Intrabar wicks that return to the zone but close outside it will not trigger mitigation in the default setting.
The maximum zone count is a performance and visual constraint. On timeframes where FVGs form frequently, older lower-score zones are removed to stay within the limit.
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any instrument. All trading involves risk of loss. Fair Value Gap zones do not guarantee price reversal or support. Always use proper risk management.
-Made with passion by jackofalltrades
Indicator

Mitigation Block Quality [AGPro Series]OVERVIEW
Mitigation Block Quality grades every order-block retest as A, B, or C based on
the strength, speed, and follow-through of the bounce after price returns to
the block. Instead of just drawing order blocks and leaving you to guess
which ones matter, the script measures each mitigation objectively and keeps
a live scoreboard of how those reactions have been performing.
The result is an order block tool that tells you two things at once: where
the zones are, and how well price has historically respected them on the
symbol and timeframe you are looking at.
UNIQUE EDGE
Most order-block indicators end at detection. This one begins there. Each
time a block is mitigated, the script measures the reaction over a fixed
window and grades the bounce by its ATR-normalized magnitude. That grade
is then reflected everywhere: on the block border, in the on-chart label,
in the dashboard, and in the historical success-rate statistics.
You also get multi-timeframe context, confluence detection, streak tracking,
and a dynamic setup banner that describes the current price-block
relationship in plain English.
METHODOLOGY
1. Detection. Swing pivots are identified using a configurable pivot length.
The last opposite-colored candle before the pivot forms the order block.
2. Mitigation. A block is mitigated when price re-enters the zone.
3. Grading. After a fixed reaction window, the script measures the peak of
the bounce and normalizes it to ATR. Grade A is a strong bounce, B is
solid, C is weak.
4. Invalidation. A body close beyond the block marks it as invalidated.
Invalidated blocks can be hidden or shown as a dotted reference.
5. Retirement. Blocks retire by age, by distance from price, or when the
per-side cap is exceeded.
FEATURES
- A, B, or C grade assigned to every mitigation (ATR-normalized reaction)
- Reaction trail line on Grade A mitigations showing the bounce extent
- Entry marker (diamond) at the exact mitigation bar of Grade A bounces
- Confluence glow when two or more blocks overlap within 0.5 ATR
- Time-based opacity decay so older blocks recede and fresh ones pop
- Optional pulse animation on A/B blocks while price is inside them
- Price-scale labels tagging each active block's grade and side
- Higher-timeframe alignment check against a configurable HTF structural bias
- Dashboard panel with: active count, tested count, success (current),
nearest-block state (Inside / Touching / distance in ATR), all-time
success rate with stacked distribution bar, last-20 success, health
progress bar, current Win/Loss streak, HTF alignment, and a dynamic
setup banner
SIGNALS & ALERTS
Three alert conditions are provided:
- Grade A Mitigation — a premium-quality bounce has been detected
- Grade B Mitigation — a solid bounce has been detected
- Block Invalidation — an active block has been broken
These are alertconditions and can be configured from the PulseWire
Create Alert dialog in the usual way.
KEY INPUTS
- Pivot Length and Lookback: control how blocks are detected and how long
they stay on the chart
- Reaction Window and Grade Thresholds (A, B in ATR units): define what
counts as a premium, solid, or weak bounce
- Invalidation Mode: choose between body close or wick pierce
- Retire Block Beyond (xATR): automatic cleanup when price moves far away
- Max Active Blocks per Side and Max Visible Labels: keep the chart premium
- Premium Visuals toggles: Reaction Trail, Entry Marker, Confluence Glow,
Quality Heatmap row, Setup Banner, Pulse, Time Decay, Price Scale Labels,
HTF Alignment, Streak row
- HTF for Alignment: the higher timeframe used for multi-timeframe confluence
- Panel location and theme
HOW TO USE
1. Add the script to any chart and timeframe.
2. Read the panel top-down:
- Last 20 breakdown tells you the recent quality regime
- Nearest Block tells you how close the closest active zone is
- All-time and Last 20 success tell you how reliable those zones have been
- Streak gives you momentum context
- HTF Alignment tells you if the bigger picture agrees
- Setup banner describes what is happening right now
3. Look at the chart:
- A/B/C labels on mitigated blocks tell you how those tests resolved
- Reaction trails and diamonds highlight the premium Grade A mitigations
- Confluence glows mark zones where multiple blocks agree
4. Use alerts to get notified when a fresh Grade A or Grade B mitigation
occurs, or when an active block is invalidated.
The tool is designed to help with discretionary analysis. It is not a
trading system and does not generate buy or sell signals on its own.
LIMITATIONS & TRANSPARENCY
- Pivots are confirmed after the swing length completes, so block detection
has a small structural lag. This is inherent to any pivot-based method.
- Grades are assigned after the reaction window closes. A very fresh
mitigation will briefly show "Active" before its grade appears.
- HTF Alignment uses a 50-period simple moving average on the chosen higher
timeframe as a structural bias proxy. It is a context filter, not a
predictive signal.
- All metrics are computed from the visible historical data on the current
chart. Loading more bars will change the all-time statistics.
- The script uses Pine Script v6 drawing objects. Extremely long histories
on very low timeframes may hit PulseWire object limits; the built-in
per-side cap and distance-based retire keep this under control in normal
use.
RISK DISCLOSURE
This script is an analysis aid, not financial advice. It does not predict
future price movement and does not generate trade recommendations. Any
decision to enter or exit a position is the responsibility of the user.
Historical grade distributions are descriptive, not predictive. Past
mitigation behavior on a symbol does not guarantee future behavior.
Trade with risk capital you can afford to lose and use appropriate
position sizing and stop placement.
LICENSE
Released under the Mozilla Public License 2.0. The full source is available
on PulseWire via the Open-Source badge. You are free to study and modify
the code subject to the terms of the license. Indicator

AG Pro Fair Value Gap Engine [AGPro Series]AG Pro Fair Value Gap Engine
OVERVIEW / WHAT IT DOES
AG Pro Fair Value Gap Engine is a rules-based overlay built to detect 3-bar fair value gap structures and organize them as a living imbalance map on the chart.
The script identifies bullish fair value gaps when the current low is above the high from two bars earlier, and bearish fair value gaps when the current high is below the low from two bars earlier. Once detected, each zone is stored, rendered, tracked through time, and updated as price interacts with it.
Instead of stopping at basic FVG detection, this script continues to follow the structure after creation. It monitors whether the gap remains active, whether price returns into it, whether mitigation occurs, how old the structure has become, and how strong or weak that mitigation event appears relative to the gap itself.
The result is not just a visual list of imbalances. It is an FVG lifecycle model designed to help traders distinguish between fresh gaps, aging gaps, mitigated gaps, and higher-quality mitigation events.
UNIQUE EDGE
Many fair value gap tools simply highlight every detected gap and leave the user to interpret the rest.
This script is built around a different idea:
not all FVGs deserve the same attention, and not every mitigation event carries the same informational value.
AG Pro Fair Value Gap Engine separates itself by combining detection, aging, prioritization, mitigation tracking, and scoring in a single structured workflow. Gaps are not treated as static rectangles. They are treated as evolving chart objects with a lifecycle.
Within the AG Pro Series, this script is also distinct from breakout-quality, reclaim, rotation, pressure, or acceptance-style overlays. Those models focus on trend behavior, reclaim behavior, structural confirmation, momentum pressure, or price acceptance around a reference. This one is centered on imbalance structure itself: where the 3-bar gap formed, how long it stayed relevant, whether price returned, and how credible that mitigation looked once interaction happened.
In practical terms, the script is designed to answer questions such as:
Which FVGs are still active?
Which ones are becoming stale?
Which mitigation events happened with better quality?
Which visible zones are worth keeping in focus, and which are just legacy context?
That is the core difference. This is not a generic FVG highlighter. It is an imbalance-ranking and mitigation-quality engine.
METHODOLOGY
1) Detection Logic
The script scans for standard 3-bar fair value gap structures.
Bullish FVG:
current low > high from two bars back
Bearish FVG:
current high < low from two bars back
A minimum size filter relative to ATR is applied so that very small gaps can be ignored when desired.
2) Structure Tracking
After detection, each FVG is stored and tracked over time. The script keeps the zone on the chart, extends active zones forward when enabled, and updates their visual state as the market evolves.
This allows the chart to preserve the structural memory of imbalance zones instead of treating every new gap as an isolated event.
3) Aging and Visual Decay
Older gaps gradually lose visual priority through fade logic. This helps newer or more relevant structures stay readable while old zones move into the background.
Optional controls can also suppress distant legacy zones when they become both old and far from current price.
4) Mitigation Logic
The script monitors how deeply price returns into each gap. When the user-defined mitigation threshold is reached, the FVG is marked as mitigated.
Mitigated zones can remain visible as context or be hidden for a cleaner chart, depending on preference.
5) Quality Scoring
Mitigation is not treated as a simple yes/no event. The script evaluates mitigation quality using a weighted model that includes:
- Gap size relative to ATR
- Speed of return into the zone
- Relative volume during the mitigation event
- Return strength after contact with the gap
This produces a normalized score intended to help separate weaker fills from stronger, better-formed mitigation behavior.
6) Focus and Prioritization
To reduce chart noise, the script includes focused labeling, active-zone prioritization, top-zone filtering, and legacy suppression logic.
This means the visual output can be tuned away from “show everything” and toward “show what matters most.”
SIGNALS & ALERTS
This script provides alert conditions for:
- Newly detected bullish fair value gaps
- Newly detected bearish fair value gaps
- Bullish fair value gaps reaching mitigation
- Bearish fair value gaps reaching mitigation
These alerts are event-based and rules-based. They are not forecasts, predictions, or trade instructions.
The labels and panel are designed to summarize state, not to replace the user’s broader market process.
KEY INPUTS
Core Settings
- Minimum FVG Size (ATR)
- Mitigation Threshold (%)
- Maximum Tracked FVG Count
- Age Fade Length
- Extend Active FVG Boxes
Scoring Engine
- Speed Score Reference
- Volume Score SMA Length
- Volume Score Max Ratio
- Size Score Max ATR
Visual Settings
- Show FVG Labels
- Focused Label Mode
- Focused Label Minimum Score
- Active / Mitigated Label Age Limits
- Highlight Score Threshold
- Theme Preset
- Show Mitigated Zones
- Show Mitigated Zone Labels
- Label Horizontal Offset
- Hide Distant Legacy FVGs
- Legacy Hide Age
- Legacy Hide Distance
- Show Only Top Active Zones
- Top Active Zones Count
- Label Stack Spacing
Panel Settings
- Show Panel
- Panel Position
- Panel Font Size
These controls allow the same logic to be used in a more information-dense mode or in a much cleaner presentation mode, depending on the charting style of the user.
LIMITATIONS & TRANSPARENCY
This script detects and organizes 3-bar imbalance structures. It does not claim to identify every meaningful liquidity event, order-flow shift, or broader smart money context factor on its own.
A fair value gap can remain open for a long time, fail quickly, or be revisited multiple times. A high score does not guarantee a directional outcome. A low score does not automatically invalidate the zone as context.
The mitigation score is a structured ranking model, not an objective truth about future price behavior. It is designed to help compare events inside the framework of this script.
Because chart structure, volatility, timeframe, and instrument behavior vary, users should expect different FVG densities and different score distributions across markets.
This tool is best used as a market-organization layer for imbalance analysis, not as a standalone execution system.
RISK DISCLOSURE
AG Pro Fair Value Gap Engine is an analytical charting tool for educational and informational use.
It does not provide financial advice, does not promise outcomes, and should not be interpreted as a standalone buy or sell system. Fair value gaps, mitigation events, and score readings should be evaluated together with market structure, volatility, timeframe context, liquidity conditions, and the user’s own risk framework.
Trading involves risk. Past chart behavior does not guarantee future results.
Indicator

Indicator

Smart Money: Auto Order Blocks [identityKa]Overview
The Smart Money: Auto Order Blocks is a professional-grade volume and structural mapping tool designed for SMC (Smart Money Concepts) traders. Order Blocks represent areas where large financial institutions have accumulated significant buy or sell positions. Unlike basic pivot indicators that leave cluttered lines on the chart indefinitely, this script introduces a Smart Mitigation Engine that automatically tracks the validity of these institutional zones in real-time.
Core Mechanics & Detection
The algorithm uses pivot sensitivity to locate origin points of major market imbalances:
Bearish Order Blocks (Supply): Detected at the absolute high of a structural swing before a major downward move. The box is drawn from the wick's high to the highest candle body in that cluster, encapsulating the entire institutional sell zone.
Bullish Order Blocks (Demand): Detected at the absolute low of a structural swing before a major upward move. The box encapsulates the wick's low up to the lowest candle body.
The Smart Mitigation Engine
A fundamental rule of SMC is that once an Order Block is fully pierced and the price closes beyond it, the institutional orders within that zone are considered filled or "Mitigated."
This script constantly monitors the closing price. If a candle strictly closes above a Bearish OB, or strictly below a Bullish OB, the algorithm mathematically invalidates the zone.
Upon mitigation, the box is instantly deleted from the chart, ensuring that only "Fresh" and highly reactive unmitigated zones are visible to the trader. This keeps the workspace incredibly clean.
HUD Dashboard & AI Logic
The on-chart intelligence panel evaluates the proximity of the live price to the active Order Blocks:
Dangerous: Displayed actively whenever the current live price is trading inside the coordinates of an unmitigated Order Block. This serves as a warning that the price is in an institutional high-friction area where sharp rejections and high volatility are imminent.
LONG / SHORT: The engine tracks the macro bias based on the last mitigation event. If a Bearish OB was broken upwards (invalidated resistance), the macro bias shifts to LONG. If a Bullish OB was broken downwards, the bias shifts to SHORT.
How to Use It
This tool provides exceptional context for trade entries. When the AI Suggestion reads "LONG," traders should patiently wait for the price to pull back into a green Bullish OB zone. Once the price enters the zone (triggering the "Dangerous" state), traders can drop to a lower timeframe (e.g., 5-minute) to spot a micro-reversal pattern before executing a trade aligned with the macro trend. Indicator

Dynamic Delta FVG [LuxAlgo]The Dynamic Delta FVG indicator provides a comprehensive analysis of Fair Value Gaps (FVGs) by integrating intra-bar volume delta to visualize the internal buying and selling pressure within price imbalances.
🔶 USAGE
The script identifies standard Fair Value Gaps and enhances them by splitting the visual representation into two distinct segments based on volume delta. This allows traders to see exactly where institutional aggressive orders were concentrated during the formation of the gap.
Users can utilize this tool to:
Identify high-probability FVGs where the volume delta aligns with the gap direction. Determine specific price levels within a gap that acted as the primary "point of control" for buyers or sellers. Monitor real-time sentiment through a dynamic dashboard that aggregates the delta of all active imbalances. Filter out insignificant market noise using ATR and volume-based threshold settings.
🔹 Detailed Buyer/Seller Tags
Each active FVG features a dynamic tag on the right edge displaying the specific percentage of buying (B) and selling (S) volume that occurred within that price range. The tag background color shifts based on the dominant force, providing an immediate visual cue of the gap's internal strength. These tags move dynamically as the boxes expand, ensuring they always remain at the current price action edge.
🔹 Filter Overlapping
When enabled, the script will automatically remove existing active FVGs that overlap with a new discovery. This ensures only the most recent "current" imbalance is displayed in a specific price zone, preventing visual clutter and focusing on the most relevant institutional levels.
🔹 Mitigation Modes
The script supports two mitigation modes to suit different trading styles:
**Touch:** A gap is considered mitigated as soon as price enters the range. **Full Fill:** A gap remains active until price has completely traversed the entire range of the imbalance.
🔶 DETAILS
The indicator utilizes
request.security_lower_tf()
to fetch granular volume data from lower timeframes (e.g., 1-second data). This allows for a precise calculation of "Buy Volume" versus "Sell Volume". The split in the FVG box represents the ratio of these volumes. For example, if an FVG has 70% buying volume, the green segment will occupy 70% of the vertical height of the box, while the red segment occupies the remaining 30%.
🔹 Aggregate Sentiment Dashboard
The dashboard calculates market strength across all active imbalances rather than just categorizing by gap direction. This means if multiple bullish FVGs contain significant "absorbed" selling volume, the "Seller Strength" metric will accurately reflect this bearish pressure. The Net Sentiment is derived from the net difference between aggregate buyer and seller percentages across all active gaps.
🔶 SETTINGS
🔹 Detection Filters
**Min Volume Threshold:** Multiplier for the 20-period average volume. Gaps forming on volume lower than this threshold are ignored. **Min ATR Magnitude:** Sets the minimum required size of the FVG relative to the current ATR. **Mitigation Mode:** Determines whether a touch or a full fill "closes" the gap. **Filter Overlapping:** When enabled, the script deletes older active gaps that overlap with new ones.
🔹 Volume Delta Analysis
**Delta Timeframe:** The lower timeframe used for volume calculations. Required for higher precision on 1m charts.
🔹 Visuals
**Max Active Gaps:** Limits the number of boxes displayed on the chart (Default: 10). **Buyer/Seller Color:** Customizable colors for the split segments within the FVG. **Show Mitigated Gaps:** When enabled, mitigated gaps remain on the chart with a faded appearance.
🔹 Dashboard
**Show Dashboard:** Toggles the real-time sentiment and imbalance summary table. **Position/Size:** Controls the UI placement and scale of the dashboard. Indicator

Indicator

cd_VWAP_mtg_CxCd_VWAP_mtg_Cx
Overview
The most important condition for being successful and profitable in the market is to consistently follow the same rules without compromise, while the price constantly moves in countless different ways.
Regardless of the concept or trading school, those who have rules win.
In this indicator, we will define and use three main sections to set and apply our rules.
The indicator uses the VWAP (Volume Weighted Average Price) — price weighted by volume.
Two VWAPs can be displayed either by manually entering date and time, or by selecting from the menu.
From the menu, you can select the following reference levels:
• HTF Open: Opening candle of the higher timeframe
• ATH / ATL: All-Time High / All-Time Low candles
• PMH / PML, PWH / PWL, PDH / PDL, PH4H / PH4L: Previous Month, Week, Day, or H4 Highs/Lows
• MH / ML, WH / WL, DH / DL, H4H / H4L: Current Month, Week, Day, or H4 Highs/Lows
Additionally, it includes:
• Mitigation / Order Block zones (local buyer-seller balance) across two timeframes.
• Buy/Sell Side Liquidity levels (BSL / SSL) from the aligned higher timeframe (target levels).
________________________________________
Components and Usage
1 – VWAP
Calculated using the classical method:
• High + Volume for the upper value
• Close + Volume for the middle value
• Low + Volume for the lower value
The VWAP is displayed as a colored band, where the coloring represents the bias.
Let’s call this band FVB (Fair Value Band) for ease of explanation.
The FVB represents the final line of defense, the buyer/seller boundary, and in technical terms, it can be viewed as premium/discount zones or support/resistance levels.
Within this critical area, the strong side continues its move, while the weaker side is forced to retreat.
But does the side that breaks beyond the band always keep going?
We all know that’s not always the case — in different pairs and timeframes, price often violates both the upper and lower edges multiple times.
To achieve more consistent analysis, we’ll define a new set of rules.
________________________________________
2 – Mitigation / Order Blocks
In trading literature, there are dozens of different definitions and uses of mitigation or order blocks.
Here, we will interpret the candlesticks to create our own definition, and we’ll use the zones defined by candles that fit this pattern.
For simplicity, let’s abbreviate mitigation as “mtg.”
For a candle to be selected as an mtg, it must clearly show strength from one side (buyers or sellers) — which can also be observed visually on the chart.
________________________________________
Bullish mtg criteria:
1. The first candle must be bullish (close > open) → buyers are strong.
2. The next candle makes a new high (buyers push higher) but fails to close above and pulls back to close inside the previous range → sellers react.
It also must not break the previous low → buyers defend.
3. In the following candle(s), as long as the first candle’s low is protected and the second candle’s high is broken, it indicates buyer strength → a bullish mtg is confirmed.
When price returns to this zone later (gets mitigated), the expectation is that the zone holds and price pushes upward again.
If the low is violated, the mtg becomes invalid.
In technical terms:
If the previous candle’s high is broken but no close occurs above it, the expectation is a reversal move that will retest its low.
Question:
What if the low is protected and in the next candle(s) a new high forms?
Answer: → Bullish mtg.
Bearish mtg (opposite)
3 – Buy/Sell Side Liquidity Levels
With the help of the aligned higher timeframe (swing points), we will define our market structure framework and set our liquidity targets accordingly.
Let’s put the pieces together.
If we continue explaining from a trade-focused perspective, our first priority should be our bias — our projection or expectation of the market’s potential movement.
We will determine this bias using the FVB.
Since we know the band often gets violated on both sides, we want the price action to convince us of its strength.
To do that, we’ll use the first candle that closes beyond the band.
The distance from that candle’s high to low will be our threshold range
Bullish level = high + (candle length × coefficient)
Bearish level = low - (candle length × coefficient)
When the price closes beyond this threshold, it demonstrates strength, and our bias will now align in that direction.
How long will this bias remain valid?
→ Until a closing candle appears on the opposite side of the band.
If a close occurs on the opposite side, then a new bias will only be confirmed once the new threshold level is broken.
During the period in between, we have no bias.
Let’s continue on the chart:
Now that our bias has been established, where and how do we look for trade opportunities?
There are two possible entry approaches:
• Aggressive entry: Enter immediately with the breakout.
• Conservative entry: Wait for a pullback and enter once a suitable structure forms.
(The choice depends on the user’s preference.)
At this stage, the user can apply their own entry model. Let’s give an example:
Let’s assume we’re looking for setups using HTF sweep + LTF CISD confirmation.
Once our bias turns bearish, we look for an HTF sweep forming on or near an FVB or mtg block, and then confirm the entry with a CISD signal.
In summary:
• FVB defines the bias, the entry zone, and the target zone.
• Mtg blocks represent entry zones.
• BSL / SSL levels suggest target zones.
Overlapping FVB and mtg blocks are expected to be more effective.
The indicator also provides an option for a second FVB.
A band attached to a lower timeframe can be used as confirmation.
• Main band: Bias + FVB
• Extra band: Entry trigger confirmed by a close beyond it.
Mtg blocks can provide trade entry opportunities, especially when the price is moving strongly in one direction (flow).
Consecutive or complementary mtg blocks indicate that the price is decisive in one direction, while sometimes also showing areas where we should wait before entering.
Mtg blocks that contain an FVG (Fair Value Gap) within their body are expected to be more effective.
Settings:
The default values are set to 1-3-5m, optimized for scalping trades.
VWAP settings:
Main VWAP (FVB):
• Can be set by selecting a start time, manually entering date and time, or choosing a predefined level.
Extra VWAP (FVB):
• Set from the menu. If not needed, select “none.”
• Visibility, color, and fill settings for VWAP are located here.
• Threshold levels visibility and color options are also in this section.
• The multiplier is used for calculating the threshold level.
Important:
• If the Extra VWAP is selected but not displayed, you need to increase the chart timeframe.
o Example: If the chart is on 3m and you select WH from the extra options, it will not display correctly.
• Upper limits for VWAP:
o 1m and 3m charts: daily High/Low
o 5m chart: weekly High/Low
________________________________________
Mtg Settings:
• Visibility and color settings for blocks are configured here.
• To display on a second timeframe, the box must be checked and the timeframe specified.
• Optional display modes: “only active blocks,” “only last violated mtg,” or “all.”
• For confirmation and removal criteria, choosing high/low or close determines the source used for mtg block formation and deletion conditions.
BSL/SSL Settings:
• Visibility, color, font size, and line style can be configured in this section.
When “Auto” is selected, the aligned timeframe is determined automatically by the indicator, while in manual mode, the user defines the timeframe.
Final Words:
Simply opening trades every time the price touches the VWAP or mtg blocks will not make you a profitable trader. Searching for setups with similar structures while maintaining proper risk management will yield better results in the long run.
I would be happy to hear your feedback and suggestions.
Happy trading!
Indicator

FvgCalculations█ OVERVIEW
This library provides the core calculation engine for identifying Fair Value Gaps (FVGs) across different timeframes and for processing their interaction with price. It includes functions to detect FVGs on both the current chart and higher timeframes, as well as to check for their full or partial mitigation.
█ CONCEPTS
The library's primary functions revolve around the concept of Fair Value Gaps and their lifecycle.
Fair Value Gap (FVG) Identification
An FVG, or imbalance, represents a price range where buying or selling pressure was significant enough to cause a rapid price movement, leaving an "inefficiency" in the market. This library identifies FVGs based on three-bar patterns:
Bullish FVG: Forms when the low of the current bar (bar 3) is higher than the high of the bar two periods prior (bar 1). The FVG is the space between the high of bar 1 and the low of bar 3.
Bearish FVG: Forms when the high of the current bar (bar 3) is lower than the low of the bar two periods prior (bar 1). The FVG is the space between the low of bar 1 and the high of bar 3.
The library provides distinct functions for detecting FVGs on the current (Low Timeframe - LTF) and specified higher timeframes (Medium Timeframe - MTF / High Timeframe - HTF).
FVG Mitigation
Mitigation refers to price revisiting an FVG.
Full Mitigation: An FVG is considered fully mitigated when price completely closes the gap. For a bullish FVG, this occurs if the current low price moves below or touches the FVG's bottom. For a bearish FVG, it occurs if the current high price moves above or touches the FVG's top.
Partial Mitigation (Entry/Fill): An FVG is partially mitigated when price enters the FVG's range but does not fully close it. The library tracks the extent of this fill. For a bullish FVG, if the current low price enters the FVG from above, that low becomes the new effective top of the remaining FVG. For a bearish FVG, if the current high price enters the FVG from below, that high becomes the new effective bottom of the remaining FVG.
FVG Interaction
This refers to any instance where the current bar's price range (high to low) touches or crosses into the currently unfilled portion of an active (visible and not fully mitigated) FVG.
Multi-Timeframe Data Acquisition
To detect FVGs on higher timeframes, specific historical bar data (high, low, and time of bars at indices and relative to the higher timeframe's last completed bar) is required. The requestMultiTFBarData function is designed to fetch this data efficiently.
█ CALCULATIONS AND USE
The functions in this library are typically used in a sequence to manage FVGs:
1. Data Retrieval (for MTF/HTF FVGs):
Call requestMultiTFBarData() with the desired higher timeframe string (e.g., "60", "D").
This returns a tuple of htfHigh1, htfLow1, htfTime1, htfHigh3, htfLow3, htfTime3.
2. FVG Detection:
For LTF FVGs: Call detectFvg() on each confirmed bar. It uses high , low, low , and high along with barstate.isconfirmed.
For MTF/HTF FVGs: Call detectMultiTFFvg() using the data obtained from requestMultiTFBarData().
Both detection functions return an fvgObject (defined in FvgTypes) if an FVG is found, otherwise na. They also can classify FVGs as "Large Volume" (LV) if classifyLV is true and the FVG size (top - bottom) relative to the tfAtr (Average True Range of the respective timeframe) meets the lvAtrMultiplier.
3. FVG State Updates (on each new bar for existing FVGs):
First, check for overall price interaction using fvgInteractionCheck(). This function determines if the current bar's high/low has touched or entered the FVG's currentTop or currentBottom.
If interaction occurs and the FVG is not already mitigated:
Call checkMitigation() to determine if the FVG has been fully mitigated by the current bar's currentHigh and currentLow. If true, the FVG's isMitigated status is updated.
If not fully mitigated, call checkPartialMitigation() to see if the price has further entered the FVG. This function returns the newLevel to which the FVG has been filled (e.g., currentLow for a bullish FVG, currentHigh for bearish). This newLevel is then used to update the FVG's currentTop or currentBottom.
The calling script (e.g., fvgMain.c) is responsible for storing and managing the array of fvgObject instances and passing them to these update functions.
█ NOTES
Bar State for LTF Detection: The detectFvg() function relies on barstate.isconfirmed to ensure FVG detection is based on closed bars, preventing FVGs from being detected prematurely on the currently forming bar.
Higher Timeframe Data (lookahead): The requestMultiTFBarData() function uses lookahead = barmerge.lookahead_on. This means it can access historical data from the higher timeframe that corresponds to the current bar on the chart, even if the higher timeframe bar has not officially closed. This is standard for multi-timeframe analysis aiming to plot historical HTF data accurately on a lower timeframe chart.
Parameter Typing: Functions like detectMultiTFFvg and detectFvg infer the type for boolean (classifyLV) and numeric (lvAtrMultiplier) parameters passed from the main script, while explicitly typed series parameters (like htfHigh1, currentAtr) expect series data.
fvgObject Dependency: The FVG detection functions return fvgObject instances, and fvgInteractionCheck takes an fvgObject as a parameter. This UDT is defined in the FvgTypes library, making it a dependency for using FvgCalculations.
ATR for LV Classification: The tfAtr (for MTF/HTF) and currentAtr (for LTF) parameters are expected to be the Average True Range values for the respective timeframes. These are used, if classifyLV is enabled, to determine if an FVG's size qualifies it as a "Large Volume" FVG based on the lvAtrMultiplier.
MTF/HTF FVG Appearance Timing: When displaying FVGs from a higher timeframe (MTF/HTF) on a lower timeframe (LTF) chart, users might observe that the most recent MTF/HTF FVG appears one LTF bar later compared to its appearance on a native MTF/HTF chart. This is an expected behavior due to the detection mechanism in `detectMultiTFFvg`. This function uses historical bar data from the MTF/HTF (specifically, data equivalent to `HTF_bar ` and `HTF_bar `) to identify an FVG. Therefore, all three bars forming the FVG on the MTF/HTF must be fully closed and have shifted into these historical index positions relative to the `request.security` call from the LTF chart before the FVG can be detected and displayed on the LTF. This ensures that the MTF/HTF FVG is identified based on confirmed, closed bars from the higher timeframe.
█ EXPORTED FUNCTIONS
requestMultiTFBarData(timeframe)
Requests historical bar data for specific previous bars from a specified higher timeframe.
It fetches H , L , T (for the bar before last) and H , L , T (for the bar three periods prior)
from the requested timeframe.
This is typically used to identify FVG patterns on MTF/HTF.
Parameters:
timeframe (simple string) : The higher timeframe to request data from (e.g., "60" for 1-hour, "D" for Daily).
Returns: A tuple containing: .
- htfHigh1 (series float): High of the bar at index 1 (one bar before the last completed bar on timeframe).
- htfLow1 (series float): Low of the bar at index 1.
- htfTime1 (series int) : Time of the bar at index 1.
- htfHigh3 (series float): High of the bar at index 3 (three bars before the last completed bar on timeframe).
- htfLow3 (series float): Low of the bar at index 3.
- htfTime3 (series int) : Time of the bar at index 3.
detectMultiTFFvg(htfHigh1, htfLow1, htfTime1, htfHigh3, htfLow3, htfTime3, tfAtr, classifyLV, lvAtrMultiplier, tfType)
Detects a Fair Value Gap (FVG) on a higher timeframe (MTF/HTF) using pre-fetched bar data.
Parameters:
htfHigh1 (float) : High of the first relevant bar (typically high ) from the higher timeframe.
htfLow1 (float) : Low of the first relevant bar (typically low ) from the higher timeframe.
htfTime1 (int) : Time of the first relevant bar (typically time ) from the higher timeframe.
htfHigh3 (float) : High of the third relevant bar (typically high ) from the higher timeframe.
htfLow3 (float) : Low of the third relevant bar (typically low ) from the higher timeframe.
htfTime3 (int) : Time of the third relevant bar (typically time ) from the higher timeframe.
tfAtr (float) : ATR value for the higher timeframe, used for Large Volume (LV) FVG classification.
classifyLV (bool) : If true, FVGs will be assessed to see if they qualify as Large Volume.
lvAtrMultiplier (float) : The ATR multiplier used to define if an FVG is Large Volume.
tfType (series tfType enum from no1x/FvgTypes/1) : The timeframe type (e.g., types.tfType.MTF, types.tfType.HTF) of the FVG being detected.
Returns: An fvgObject instance if an FVG is detected, otherwise na.
detectFvg(classifyLV, lvAtrMultiplier, currentAtr)
Detects a Fair Value Gap (FVG) on the current (LTF - Low Timeframe) chart.
Parameters:
classifyLV (bool) : If true, FVGs will be assessed to see if they qualify as Large Volume.
lvAtrMultiplier (float) : The ATR multiplier used to define if an FVG is Large Volume.
currentAtr (float) : ATR value for the current timeframe, used for LV FVG classification.
Returns: An fvgObject instance if an FVG is detected, otherwise na.
checkMitigation(isBullish, fvgTop, fvgBottom, currentHigh, currentLow)
Checks if an FVG has been fully mitigated by the current bar's price action.
Parameters:
isBullish (bool) : True if the FVG being checked is bullish, false if bearish.
fvgTop (float) : The top price level of the FVG.
fvgBottom (float) : The bottom price level of the FVG.
currentHigh (float) : The high price of the current bar.
currentLow (float) : The low price of the current bar.
Returns: True if the FVG is considered fully mitigated, false otherwise.
checkPartialMitigation(isBullish, currentBoxTop, currentBoxBottom, currentHigh, currentLow)
Checks for partial mitigation of an FVG by the current bar's price action.
It determines if the price has entered the FVG and returns the new fill level.
Parameters:
isBullish (bool) : True if the FVG being checked is bullish, false if bearish.
currentBoxTop (float) : The current top of the FVG box (this might have been adjusted by previous partial fills).
currentBoxBottom (float) : The current bottom of the FVG box (similarly, might be adjusted).
currentHigh (float) : The high price of the current bar.
currentLow (float) : The low price of the current bar.
Returns: The new price level to which the FVG has been filled (e.g., currentLow for a bullish FVG).
Returns na if no new partial fill occurred on this bar.
fvgInteractionCheck(fvg, highVal, lowVal)
Checks if the current bar's price interacts with the given FVG.
Interaction means the price touches or crosses into the FVG's
current (possibly partially filled) range.
Parameters:
fvg (fvgObject type from no1x/FvgTypes/1) : The FVG object to check.
Its isMitigated, isVisible, isBullish, currentTop, and currentBottom fields are used.
highVal (float) : The high price of the current bar.
lowVal (float) : The low price of the current bar.
Returns: True if price interacts with the FVG, false otherwise. Library

Price Action Volumetric Order Blocks [UAlgo]"Price Action Volumetric Order Blocks" indicator aims to identify significant price zones in the market based on a combination of price action and volume analysis. It utilizes the concept of "Order Blocks," which are areas on the chart where large orders are believed to have been placed, influencing price behavior. By analyzing price swings and volume activity, the indicator attempts to highlight potential support and resistance levels.
🔶 Key Features
Swing Length: This input allows you to adjust the timeframe used to identify price swings for order block detection. A longer swing length will focus on larger timeframes and potentially capture stronger order blocks.
Show Last X Order Blocks: This controls the number of order blocks displayed on the chart. You can choose to visualize a specific number of the most recent order blocks.
Violation Check: This setting determines how the indicator identifies potential order block violations. You can choose between "Wick" or "Close" violations. A "Wick" violation occurs when the price (wick) extends beyond the order block boundaries, while a "Close" violation signifies that the closing price breaches the order block.
Hide Overlap: This option allows you to manage the display of overlapping order blocks. If set to "True," only non-overlapping order blocks will be shown, potentially offering a clearer visualization.
Colors: You can customize the color scheme for bullish (upward) and bearish (downward) order blocks to enhance visual clarity on the chart.
🔶 Interpreting the Indicator
Order Blocks: The teal-colored boxes represent bullish order blocks, indicating areas of demand where buying pressure is likely to be strong. Red-colored boxes represent bearish order blocks, indicating areas of supply where selling pressure is likely to be dominant. These zones often signal potential reversal points or consolidation areas.
Strength Calculations: The indicator calculates the relative strength of bullish and bearish blocks based on volume. A higher bullish strength indicates stronger buying pressure, while higher bearish strength suggests more selling pressure. Traders can use this information to gauge the strength of a price level and predict future price movements.
Market Structure Lines: The indicator displays horizontal lines to depict the current market structure, labeled as "MSB" (Market Sell Balance) or "BOS" (Break of Structure). These lines can help visualize the prevailing trend direction.
Order Block Violations: When a price wick or close breaches an order block (depending on the chosen violation type), the corresponding order block visualization is removed from the chart. This can signify a potential weakening of the identified support or resistance zone.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results. Indicator

Fair Value Gaps Setup 01 [TradingFinder] FVG Absorption + CHoCH🔵 Introduction
🟣 Market Structures
Market structures exhibit a fractal and nested nature, which leads us to classify them into internal (minor) and external (major) categories. Definitions of market structure vary, with different methodologies such as Smart Money and ICT offering distinct interpretations.
To identify market structure, the initial step involves examining key highs and lows. An uptrend is characterized by successive highs and lows that are higher than their predecessors. Conversely, a downtrend is marked by successive lows and highs that are lower than their previous counterparts.
🟣 Market Trends and Movements
Market trends consist of two primary types of movements :
Impulsive Movements : These movements align with the main trend and are characterized by high strength and momentum.
Corrective Movements : These movements counter the main trend and are marked by lower strength and momentum.
🟣 Break of Structure (BOS)
In a downtrend, a Break of Structure (BOS) occurs when the price falls below the previous low and establishes a new low (LL). In an uptrend, a BOS, also known as a Market Structure Break (MSB), happens when the price rises above the last high.
To confirm a trend, at least one BOS is necessary, which requires the price to close at least one candle beyond the previous high or low.
🟣 Change of Character (CHOCH)
Change of Character (CHOCH) is a crucial concept in market structure analysis, indicating a shift in trend. A trend concludes with a CHOCH, also referred to as a Market Structure Shift (MSS).
For example, in a downtrend, the price continues to drop with BOS, showcasing the trend's strength. However, when the price rises and exceeds the last high, a CHOCH occurs, signaling a potential transition from a downtrend to an uptrend.
It is essential to note that a CHOCH does not immediately indicate a buy trade. Instead, it is prudent to wait for a BOS in the upward direction to confirm the uptrend. Unlike BOS, a CHOCH confirmation does not require a candle to close; merely breaking the previous high or low with the candle's wick is sufficient.
🟣 Spike | Inefficiency | Imbalance
All these terms mean fast price movement in the shortest possible time.
🟣 Fair Value Gap (FVG)
To pinpoint the "Fair Value Gap" (FVG) on a chart, a detailed candle-by-candle analysis is necessary. This process involves focusing on candles with substantial bodies and evaluating them in relation to the candles immediately before and after them.
Here are the steps :
Identify the Central Candle : Look for a candle with a large body.
Examine Adjacent Candles : The candles before and after this central candle should have long shadows, and their bodies must not overlap with the body of the central candle.
Determine the FVG Range : The distance between the shadows of the first and third candles defines the FVG range.
This method helps in accurately identifying the Fair Value Gap, which is crucial for understanding market inefficiencies and potential price movements.
🟣 Setup
This setup is based on Market Structure and FVG. After a change of character and the formation of FVG in the last lag of the price movement, we are looking for trading positions in the price pullback.
Bullish Setup :
Bearish Setup :
🔵 How to Use
After forming the setup, you can enter the trade using a pending order or after receiving confirmation. To increase the probability of success, you can adjust the pivot period market structure settings or modify the market movement coefficient in the formation leg of the FVG.
Bullish Setup :
Bearish Setup :
🔵 Setting
Pivot Period of Market Structure Detector :
This parameter allows you to configure the zigzag period based on pivots. Adjusting this helps in accurately detecting order blocks.
Show major Bullish ChoCh Lines :
You can toggle the visibility of the Demand Main Zone and "ChoCh" Origin, and customize their color as needed.
Show major Bearish ChoCh Lines :
Similar to the Demand Main Zone, you can control the visibility and color of the Supply Main Zone and "ChoCh" Origin.
FVG Detector Multiplier Factor :
This feature lets you adjust the size of the moves forming the Fair Value Gaps (FVGs) using the Average True Range (ATR). The default value is 1, suitable for identifying most setups. Adjust this value based on the specific symbol and market for optimal results.
FVG Validity Period :
This parameter defines the validity period of an FVG in terms of the number of candles. By default, an FVG remains valid for up to 15 candles, but you can adjust this period as needed.
Mitigation Level FVG :
This setting establishes the basic level of an FVG. When the price reaches this level, the FVG is considered mitigated.
Level in Low-Risk Zone :
This feature aims to reduce risk by dividing the FVG into two equal areas: "Premium" (upper area) and "Discount" (lower area). For lower risk, ensure that "Demand FVG" is in the "Discount" area and "Supply FVG" in the "Premium" area. This feature is off by default.
Show or Hide :
Given the potential abundance of setups, displaying all on the chart can be overwhelming. By default, only the last setup is shown, but you can enable the option to view all setups.
Alert Settings :
On / Off : Toggle alerts on or off.
Message Frequency : Determine how often alerts are triggered.
Options include :
"All" (alerts every time the function is called)
"Once Per Bar" (alerts only on the first call within the bar)
"Once Per Bar Close" (alerts only at the last script execution of the real-time bar upon closing)
The default setting is "Once Per Bar".
Show Alert Time by Time Zone : Set the alert time based on your preferred time zone, such as "UTC-4" for New York time. The default is "UTC".
Display More Info : Optionally show additional details like the price range of the order blocks and the date, hour, and minute in the alert message. Set this to "Off" if you prefer not to receive this information.
Indicator

Fair Value Gaps Mitigation Oscillator [LuxAlgo]The Fair Value Gaps Mitigation Oscillator is an oscillator based on the traditional Fair Value Gaps (FVGs) imbalances. The oscillator displays the current total un-mitigated values for the number of FVGs chosen by the user.
The indicator also displays each New FVG as a bar representing the current ratio of the New FVG in relation to the current un-mitigated total for its direction.
🔶 USAGE
When an FVG forms, it is often interpreted as strong market sentiment in the direction of the gap. For example, an upward FVG during an uptrend is typically seen as a confirmation of the strength and continuation of the trend, as it indicates that buyers are willing to purchase at higher prices without much resistance, suggesting strong demand and positive sentiment.
By analyzing the mitigation (or lack thereof), we can visualize the increase of directional strength in a trend. This is where the proposed oscillator is useful.
🔶 DETAILS
The oscillator's values are expressed as Percentages (%). Each FVG is allocated 100% of the total of its width with a max potential value of 100 and minimum potential value of 0.
Based on the "FVG Lookback" Input, the FVGs are scaled to fit within the range of +1 to -1. Using a higher "FVG Lookback" value will allow you to get indications of longer-term trends.
A higher value of the normalized bullish FVG areas suggest a stronger and cleaner uptrend, while lower values of the bearish the normalized bullish FVG areas suggest a stronger and cleaner downtrend.
+1 or -1 indicates that there is a Full Lookback of FVGs, and each one is fully un-mitigated, and the opposite direction of FVGs is entirely Mitigated.
When the price closes over/under or within an FVG it begins to get mitigated, when this happens the % of mitigation is subtracted from the total.
When a New FVG is formed, a Histogram bar is created representing the ratio of the current FVG's width to the total width off all un-mitigated FVGs.
The entire bar represents 100% of total un-mitigated FVG Width.
The filled area represents the current FVG's width relative to the whole.
A 50% hash mark is also displayed for reference.
🔶 SETTINGS
FVG Lookback - Determines the number of FVGs (Bullish and Bearish Pairs) to keep in memory for analysis.
Indicator
