STRAT Trap & VWAP Engine [WillyAlgoTrader]📊 STRAT Trap & VWAP Engine is an overlay toolkit that reads every candle through the lens of The STRAT methodology, detects failed-breakout "trap" candles, and turns them into fully managed trade plans — entry, structural stop, three R-multiple targets, break-even automation and webhook alerts — filtered by a volatility regime engine and accompanied by a pivot-anchored VWAP trail.
The core insight: the most information-dense candle on any chart is the one that breaks a prior extreme and then closes against its own break. The market went hunting for liquidity, found it, and failed to follow through. This indicator classifies every bar the STRAT way, catches exactly those divergence candles, and manages the resulting trade for you — while a regime filter keeps you out of chop and an anchored VWAP shows where the volume-weighted crowd is positioned inside the current trend leg.
Works on all markets (crypto, forex, stocks, indices, futures) and all timeframes.
📚 THE STRAT IN 60 SECONDS (for beginners)
The STRAT is a price-action methodology popularized by veteran floor trader Rob Smith. Its power is its simplicity: every candle on every chart is one of only three types, defined purely by its relationship to the previous candle's range:
— 1 (Inside bar) : the candle's entire range fits inside the previous candle (high <= prior high AND low >= prior low). The market is in equilibrium — nobody won.
— 2 (Directional bar) : the candle breaks ONE side of the previous candle. 2U breaks the prior high only; 2D breaks the prior low only. One side won.
— 3 (Outside bar) : the candle breaks BOTH sides (high > prior high AND low < prior low). Maximum disagreement — both sides were swept.
Sequences of these numbers form repeatable patterns. A 2D-2U is a reversal (sellers pushed down, buyers answered). A 2-1-2 is a pause-and-go. A 3-1-2 is compression after chaos resolving into direction. Because the classification is purely mechanical, there is zero subjectivity — two traders looking at the same chart will always count the same sequence.
The second pillar of The STRAT is Full Timeframe Continuity (FTC) : checking whether the higher timeframes (hourly, daily, weekly, monthly) are all trading in the same direction as your entry. When the 15-minute, hourly and daily candles are all green, a long is swimming with the current, not against it.
This indicator automates all of it — and then adds the twist that gives it its name.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A STRAT pattern tells you a structure formed — but not whether the breakout that follows is genuine. A trap detector spots failed breakouts — but without structural context it fires in the middle of chop. A regime filter knows trend from range — but generates no entries by itself. A VWAP shows positioning — but a session VWAP resets at midnight regardless of what the trend is doing. None of these alone produces a complete, managed trade.
Bar classification → pattern matrix → trigger FSM → trap detection → regime + volume + FTC filters → trade engine (SL/TP1-3/BE) → anchored VWAP context
The classifier turns raw candles into STRAT numbers. The pattern matrix scans the sequence for tradeable combinations and arms a setup with exact trigger and stop levels. The trigger FSM waits for a confirmed break — or the Trap engine fires instead when a candle breaks an extreme and closes against it. Every prospective entry then passes through three independent gates (PVTE regime, volume confirmation, FTC alignment) before the trade engine takes over: structural stop, three R-multiple targets, automatic break-even, and a webhook alert at every stage. The anchored VWAP restarts at each confirmed structural pivot inside the regime, showing the volume-weighted average of the current leg — the reference institutional participants care about.
Remove any link and the chain breaks: patterns without triggers are just decoration; traps without a regime filter fade every wiggle; a trade engine without structural stops places arbitrary lines; a VWAP without pivot anchoring measures the wrong leg.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Mechanical STRAT classifier with a data-driven pattern matrix.
Every bar is classified exhaustively:
— Inside (1): high <= high and low >= low
— Outside (3): high > high and low < low
— 2U: high > high and low >= low
— 2D: low < low and high <= high
Patterns are not hardcoded if-chains — they live in a priority-ordered matrix scanned longest-first, so a 2-2-2 continuation (Extended mode) outranks the 2-2 it contains, and overlapping patterns resolve deterministically. Core set: 2-2 Rev/Cont, 3-2, 3-2-2, 2-1-2 Rev/Cont, 3-1-2, 1-2-2 RevStrat. Extended (opt-in): 2-2-2, 2-2-2-2 "Randy Jackson", 1-bar 3 RevStrat (outside bar closing beyond the prior bar's range).
2️⃣ Three-stage trigger FSM: SETUP → PENDING → TRIGGERED.
When a pattern completes on a confirmed close, the engine arms: trigger = the final pattern bar's high (bull) or low (bear), stop = the opposite side. A wick break of the trigger level on a later confirmed bar fires TRIGGERED. An adverse CLOSE beyond the stop side invalidates. No break within Setup Expiry bars (default 3) expires the setup. On an outside bar that pierces both sides, the adverse close wins — the conservative read, because the intrabar touch order is unknowable.
3️⃣ Trap Bar entry engine — the headline feature (default mode).
A trap bar is a candle whose body color contradicts its STRAT direction:
— Red 2U : broke the prior high, closed below its open → buyers were trapped above the break → SHORT
— Green 2D : swept the prior low, closed above its open → sellers were trapped below → LONG
Entry = trap bar close; stop = beyond the sweep extreme (the trap bar's own high/low) + 0.25×ATR buffer, with a 0.5×ATR minimum distance always enforced. Dojis (close == open) never qualify. Three Entry Modes: Trap Bar (default), STRAT Trigger (classic breakout entries), Both — where a trap candle on a trigger bar overrides the trigger's direction, because the failed breakout IS the trade.
4️⃣ Structural stop anchoring, four modes.
For trigger entries the SL Anchor input chooses: Trigger Level (default — just beyond the broken high/low; price trading back through the broken level means the breakout failed), Setup Bar (opposite side of the setup bar — wider, fully structural), Wick-Anchored (beyond the entry bar's own wick), or ATR (close ± SL Multiplier × ATR). All structural modes use:
stop_long = min(anchor − 0.25×ATR, close − 0.5×ATR)
which simultaneously applies the buffer and guarantees the minimum distance. A Max Risk cap (default 3×ATR, 0 = off) skips entries whose structural risk is too wide — outside-bar setups are the usual offenders.
5️⃣ Full trade management with honest intrabar accounting.
TP1/TP2/TP3 are R-multiples of the actual entry→stop distance (Risk Presets: Conservative 1R/2R/4R with 2.5×ATR stop, Balanced 1R/2R/3R, Aggressive, Scalping, or Custom). After TP1 is touched the stop moves to entry ( break-even ) — and a BE moved on a bar cannot stop that same bar out (the SL check uses the bar-start stop). When SL and a first TP1/TP3 touch land on the same bar, the TP registers and blocks the SL — an optimistic intrabar model, disclosed openly : the true touch order inside one bar is unknowable without tick data. A trade closes only at TP3, SL, or a BE stop-out. Win = TP1 was touched.
6️⃣ PVTE Regime Filter — two-threshold hysteresis, ON by default.
A 3-state regime engine (BULL / BEAR / NEUTRAL) built on a selectable basis kernel (EMA default, DEMA, HMA, KAMA; length 21) and ATR bands (length 100):
outer band = basis ± ATR × 3.0
inner band = basis ± ATR × (3.0 − 1)
Regime is entered on a confirmed close through an outer band and exits to NEUTRAL only on a close through the OPPOSITE inner band — the two-threshold gap kills flip-flopping in chop. Longs pass only in BULL, shorts only in BEAR; NEUTRAL blocks both by default (Allow mode available). Every entry — trap or trigger — must pass this gate, which converts the naturally counter-trend trap fade into a trend-continuation tool: only sweeps AGAINST the regime get faded, in the regime's direction.
7️⃣ Pivot-anchored VWAP trail.
Inside an active regime, the VWAP anchors at each confirmed structural pivot (Pivot Length 13 bars each side) in the regime direction, backfills from the pivot bar in one pass, then accumulates incrementally:
aVWAP = Σ(price × volume) / Σ(volume), from the anchor bar
It re-anchors on every new in-regime pivot and hard-resets on regime change — so the dotted trail always represents the current leg's volume-weighted average, not a stale session artifact. Pivot confirmation is honest lag: the swing is only KNOWN Pivot Length bars after it forms; the trail is drawn from the confirmed pivot forward. Delayed confirmation, not repainting.
8️⃣ FTC strip and FTC Alignment filter.
A top-center strip shows every timeframe above your chart (15m → Quarter): green/red for the current higher-TF candle direction, with ·I / ·O flags when that candle is inside/outside its predecessor. The optional Min FTC Aligned filter (default 0 = off) requires N visible higher timeframes to agree with your entry direction. Honesty note, stated in the tooltip as well: continuity is a live-state concept, so the strip and this filter read the FORMING higher-TF candles — the only reload-unstable element in the indicator; everything else is confirmed-close based.
9️⃣ Volume confirmation gate.
Optional filter requiring entry-bar volume > SMA20 × threshold (default 1.2), automatically bypassed on instruments without volume data. Applies to both entry sources.
🔟 Bot-grade alert architecture.
Every event emits a structured JSON webhook (or human-readable text): setup_bull/bear, trigger_bull/bear, trap_long/short, be, tp1_hit, tp2_hit, tp3_close, sl_hit. Entry payloads carry pattern, price, entry, sl, tp1-3, the PVTE regime (−1/0/1) and a compact FTC string like "1H+4H+D-W+". Closure payloads carry the result (win/loss) and a be_stop flag — built from pre-reset snapshots so same-bar event collisions can never produce NaN fields. Alerts follow a fixed intrabar chronology (management → closures → entries → setups) and five category toggles let a bot mute any stream it doesn't act on. Nine static alertcondition entries cover the TV alert dialog.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Classify: On every bar the STRAT type (1 / 2U / 2D / 3) is computed and, on confirmed close, appended to the sequence.
Step 2 — Match: The pattern matrix scans the sequence newest-first, longest patterns first; the first match arms a setup with trigger/stop at the final pattern bar's extremes.
Step 3 — Resolve: A pending setup is checked each confirmed bar: adverse close → invalidated; wick break of the trigger → TRIGGERED; expiry (default 3 bars) → expired. Setup lines freeze and dim on any resolution.
Step 4 — Detect traps: Independently, every confirmed bar is tested for the trap condition (2U closing red / 2D closing green).
Step 5 — Filter: The prospective entry (trap first in Both mode) must pass PVTE regime, volume and FTC gates, then the Max Risk cap.
Step 6 — Open & manage: Entry at close; SL/TP1-3 computed; each later confirmed bar checks TP touches (TP priority), moves BE after TP1, and closes on TP3/SL/BE stop-out. Lines project forward, extend while active, persist after close as a record, and recolor teal on TP hits.
Step 7 — Track context: The PVTE regime FSM updates on closes; the anchored VWAP accumulates, re-anchors on new pivots, resets on regime change.
Step 8 — Report: Dashboard sections refresh (sequence, setup state, trade, session stats), and the alert engine emits events in fixed chronological order.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator to a clean chart. Defaults are ready to observe: Trap Bar entries, PVTE filter ON, regime bands and anchored VWAP visible.
2. Watch the numbers under the candles: 1 = pause, 2 = direction, 3 = sweep of both sides. This alone teaches you The STRAT faster than any book.
3. Wait for a LONG · Trap 2D or SHORT · Trap 2U label — the indicator found a failed break aligned with the regime and opened a managed plan.
4. Follow the plan on the chart: dotted entry line, solid red stop, dashed green targets. Watch TP1 turn teal and the entry label switch to "→ SL (BE)".
5. Once comfortable, create ONE PulseWire alert with condition "Any alert() function call" and paste your webhook URL — every event now reaches your phone or bot in JSON.
👁️ Reading the chart:
— Numbers 1/2/3 under bars = STRAT types (amber, green/red, magenta)
— 🟢 LONG · / 🔴 SHORT · labels = trade entries with the source pattern; the tooltip shows entry, SL, TP1-3 and risk
— ▲ / ▼ labels = STRAT triggers that did NOT open a trade (engine busy or filtered) — still valid signals for manual traders
— Solid/dotted horizontal pairs after a pattern = pending trigger (colored) and stop (muted); they dim if invalidated or expired
— Small triangles = hammer (below) / shooter (above), wick-dominant candles by the Actionable Wick fraction (default 0.75)
— Colored bands = PVTE regime envelope; dotted trail = anchored VWAP of the current leg
— Dashed horizontal levels = previous Day/Week/Month high/low with price tags (lookahead-safe)
— Top-center strip = Full Timeframe Continuity at a glance
📊 Dashboard fields:
— Seq: the last four confirmed STRAT types, oldest left
— Setup: pending pattern, direction and bars-waited/expiry — or "idle"
— Levels: the pending trigger (T) and stop (S) prices
— Candle: Hammer / Shooter / Inside on the current bar (informational)
— PVTE: current regime — BULL / BEAR / NEUTRAL / Off
— Trade section: entry, stop (with "BE @" after break-even), TP1-3 with ✓ marks, R:R at TP1, stop distance in %
— Stats section: trades, wins, losses, win rate with gauge, and the ▰▱ form strip of the last 10 — for the selected period (24H / 30D / All-Time)
🔧 Tuning guide:
— Too few trades: switch In NEUTRAL Regime to Allow, or set Entry Mode to Both, or raise Max Risk
— Too many shallow trades in chop: keep NEUTRAL = Block, raise the PVTE ATR Multiplier (wider regime bands), or add Min FTC Aligned = 2
— Stops feel too tight: change SL Anchor to Setup Bar (structural, wider) — targets scale with the wider risk automatically
— Stopped out by noise at breakeven: that is the cost of the BE rule; disable Break-Even After TP1 if you prefer to let trades breathe
— Chart too busy: Setup Labels, Trigger Labels and bar coloring are already off by default; Regime Bands and the VWAP trail have their own toggles
— Learning mode: turn Setup Labels and Trigger Labels ON and Trade Engine OFF — the chart becomes a pure STRAT trainer
⚙️ KEY SETTINGS
🎨 Appearance: Theme (Auto/Dark/Light — the palette adapts, signals stay readable on white and black), watermark, bar coloring (off), bar numbers (on), Signal Label Size.
📐 Pattern Engine: Extended Patterns (off), Setup Labels (off), Max Pattern Drawings (60, FIFO).
🎯 Trigger Engine: Setup Expiry (3 bars), Trigger/Stop Lines (on), Trigger Labels (off).
🛡️ Risk Management: Trade Engine (on), Entry Mode (Trap Bar), Risk Preset (Balanced), SL Anchor (Trigger Level), SL Buffer (0.25×ATR), ATR Length (14), TP1/2/3 multipliers (Custom preset), Max Risk (3×ATR), Break-Even After TP1 (on), line styles, label toggles, % distance on labels.
🔍 Filters: Volume Confirmation (off, ×1.2 SMA20), Min FTC Aligned (0 = off).
🌊 PVTE Regime Filter: filter toggle (on), Basis Kernel (EMA), Basis Length (21), ATR Length (100), ATR Multiplier (3.0), NEUTRAL behavior (Block), Regime Bands (on), Anchored VWAP (on), VWAP Pivot Length (13), VWAP Source (Close).
🕯️ Actionable Candles: hammer/shooter marks (on), Min Wick Fraction (0.75).
📊 Dashboard: position, size (Small-Huge), Market/Trade/Stats section toggles, Win Rate Period.
🔔 Alerts: master Enable, JSON/Text format, five category toggles (Entries, TP/BE, SL, Filtered Triggers, Setups).
🔔 ALERTS
— 🟢 trigger_bull / trap_long — entry with pattern, price, entry, sl, tp1-3, regime, ftc
— 🔴 trigger_bear / trap_short — mirrored short payload
— 🎯 tp1_hit / tp2_hit — target touches with level and entry
— 🛡️ be — stop moved to break-even
— 🏆 tp3_close — final target, result "win"
— 🛑 sl_hit — stop-out with be_stop flag and win/loss result
— 📐 setup_bull / setup_bear — a pattern armed with its trigger/stop levels
— Plain trigger alerts for signals that did not open a trade (filters/engine busy)
All fire on confirmed bar close. One alert covers everything: condition "Any alert() function call". Nine static alertcondition entries are also available in the TV dialog.
⚠️ IMPORTANT NOTES
— 🚫 No repainting of signals. Classification is fixed on bar close; all setups, triggers, traps, entries and closures are evaluated on barstate.isconfirmed only; pivots for the VWAP anchor use equal left/right lookback (delayed confirmation, drawn forward from the confirmed bar). One disclosed exception by design: the FTC strip and the optional FTC Alignment filter read the FORMING higher-timeframe candles, because timeframe continuity is a live-state concept — an entry allowed live can look filtered after a reload. That filter is OFF by default.
— 📐 Optimistic intrabar model. When SL and a first TP touch share one bar, the TP is credited (TP priority). Session statistics use this model and the "win = TP1 touched" definition; they reset on chart reload and are NOT a backtest — no commissions, slippage or position sizing.
— ⚖️ Trap entries are regime-gated fades. With the PVTE filter off, the trap engine will fade every divergence candle, including mid-range noise. The default configuration (NEUTRAL = Block) is intentional.
— 🛠️ This is an analysis tool, not an automated bot. It provides classification, signals, trade plans and alerts — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Instruments without volume data: the VWAP falls back to the price source and the volume filter bypasses automatically.
— 📚 The STRAT is a public price-action methodology popularized by Rob Smith. This is an original clean-room implementation: no third-party code is reused, and the pattern engine, trap logic, trade management and regime integration are built from scratch as described above. Indicator

Liquidity Grab & PRL Engine [erdensedat]Liquidity Grab & PRL Engine
Overview
The Liquidity Grab & PRL Engine is a highly advanced, institutional-grade market structure indicator designed to identify macro liquidity sweeps, track wick rejections, and pinpoint high-probability trend reversals. Instead of relying on lagging indicators, this engine reads raw price action and liquidity pools to catch the exact moment a trend is exhausted and ready to reverse.
It comes equipped with an automated trade setup generator (Entry, SL, and TP zones) and a built-in backtesting panel to track your daily and all-time win rates in real-time.
Core Concepts & How It Works
1. Macro Liquidity Pools
The algorithm constantly scans the chart for significant structural pivots (Macro Highs and Lows). Once a major pivot is identified, it draws an unmitigated "Macro Liq" (Orange dashed line) representing a structural liquidity pool. Retail traders often place their stop losses at these levels, making them a magnet for institutional price delivery.
2. Liquidity Grab Zone (The Trap)
When the price breaks a Macro Liquidity line, the indicator does not immediately signal a continuation. Instead, it marks the breakout candle as a "Liq Grab Zone". This assumes the breakout might be a fake-out designed to hunt stops (a sweep) before a reversal.
3. PRL (Possible Reversal Line) Tracking
This is where the magic happens. After a Liquidity Grab, the engine activates its dynamic wick-tracking system:
It anchors a tracking line to the absolute high/low of the grab candle.
As long as consecutive candles keep pushing the extreme (higher highs or lower lows), the slope line follows the price tightly.
The Reversal Signal: The moment a confirmed candle fails to break the previous extreme (a shorter wick), the tracking stops. A solid, horizontal PRL (Possible Reversal Line) is instantly born. This flat line indicates that the liquidity sweep is over, momentum has shifted, and a reversal is imminent.
4. Automated Trade Setups & Dynamic Fibo Engine
Once a PRL is confirmed, the engine automatically generates a full trade setup:
Entry Level: The exact price of the PRL formation.
TP 1 Zone: A semi-transparent target box dynamically calculated using hidden Fibonacci logic (0.618 to 0.764) based on the distance between the grab and the previous macro level.
Stop Loss (SL): A dynamic invalidation line calculated using an adjustable multiplier (default: -0.25) beyond the extreme wick.
Smart Display: Only the most recent setup is tracked dynamically across the chart. Past setups are frozen exactly where they hit TP, SL, or were invalidated by a new setup, leaving a clean historical footprint.
5. Pro Winrate & Performance Panel
The indicator acts as its own backtester. A sleek, non-intrusive UI panel tracks every executed setup in the background:
Live Status: Tells you if a trade is "Awaiting Setup", "Active", "TP Hit", or "SL Hit".
Daily Stats: Tracks today's closed trades, Win/Loss ratio, and total R-R flow (Risk-to-Reward accumulation).
All-Time Stats: Calculates the overall Win Rate of the strategy, automatically changing color (Green/Red) based on profitability.
6. MA Trend Filter (Optional)
For traders who prefer trading with the higher timeframe trend, there is an optional Moving Average filter (default: 200 EMA). When enabled, the engine will only validate Long setups if the price is above the MA, and Short setups if the price is below the MA, drastically increasing the quality of the signals.
How to Use It
Wait for the price to sweep a Macro Liq line and print a Liq Grab Zone.
Watch the dashed tracking line follow the wicks.
Wait for the solid PRL line to form (Confirmed Reversal).
Execute the trade at the Entry Level, place your stop at the SL Line, and target the TP Zone.
Disclaimer
This indicator is for educational and informational purposes only. Trading in financial markets involves a high degree of risk and may not be suitable for all investors. The automated setups and win rates displayed by this tool are based on historical price action and mechanical algorithms; they do not guarantee future results. Always perform your own analysis, practice strict risk management, and never trade with money you cannot afford to lose. The author (erdensedat) assumes no responsibility for any trading losses incurred while using this script. Indicator

Synapse Trail Pro [WillyAlgoTrader]◆ SYNAPSE TRAIL PRO — FREE & OPEN-SOURCE
Synapse Trail Pro is an overlay indicator that fuses a ratcheted ATR trail, a 3-factor market regime engine, a 5-factor signal quality score, and a complete risk-management layer (SL + TP1/TP2/TP3 + automatic break-even) into one decision-support system. Every signal arrives pre-graded (A / B / C), pre-leveled (SL and three targets drawn on the chart), and pre-contextualized (regime, HTF bias, volume, RSI, ATR percentile — all in one dashboard).
The core problem it solves: classic SuperTrend-style trails fire too many signals in choppy markets, and the trader is left guessing which ones to trust. Synapse Trail Pro keeps the clean visual of an ATR trail but scores each signal 0–100 using multi-factor confluence and tells you the market regime in plain language — so you know at a glance whether the chart wants a trend signal taken or skipped.
This is fully free, open-source Pine v6 — no paywall, no invite, no DM required. Use it, study it, adapt it.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A trail line alone tells you direction. A quality score alone tells you confidence. A regime filter alone tells you environment. None of these are useful in isolation — a high-confidence signal in a choppy regime is still a coin flip, and a clean trail flip in a strong trend with no volume confirmation can still fail.
Synapse Trail Pro fuses them into a single pipeline:
ATR Trail (with optional ratchet) → Direction Flip Detection → Regime Score (ADX + Choppiness + R²) → Quality Score (HTF + Volume + RSI + Regime + Break Strength) → Grade A/B/C → Risk Levels (preset SL + TP1/TP2/TP3) → Break-Even after TP1 → Lifecycle Stats
The trail produces the raw signal. The regime engine tells you whether the market is even capable of trending right now. The quality score weighs five independent confluence factors against that regime. The grade compresses the score into a single letter you can act on. The risk layer then drops your SL, three TPs, and break-even logic onto the chart automatically — so the moment the signal fires, you already see the trade plan.
Without the regime engine, you'd take signals in chop. Without the quality score, you'd treat every flip equally. Without the risk levels, you'd still be calculating SL and TPs manually after the signal. Each component covers a blind spot of the others.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Ratcheted ATR Trail with Adaptive Volatility Multiplier.
The trail center is an EMA (default 21) of close, with bands at ±ATR × multiplier (default base 1.618 — the golden ratio). When the Ratchet option is on (recommended), the lower band only moves up in a long position and the upper band only moves down in a short — never loosens, only tightens. On a direction flip, the band resets to its raw value.
When the Adaptive Volatility Multiplier is on, the base multiplier auto-scales based on the 100-bar ATR percentile rank:
— Low vol (rank < 30) → multiplier × 0.8 (narrower band, catch the move earlier)
— Mid vol (30–70) → multiplier × 1.0 (default)
— High vol (rank > 70) → multiplier × 1.25 (wider band, avoid noise wicks)
Why this matters: a fixed multiplier overreacts in calm markets and gets whipsawed in volatile ones. Percentile-rank scaling keeps the trail behavior consistent across market conditions.
2️⃣ Composite Market Regime Score (0–100) — three-factor blend.
Each bar, three independent measurements vote on whether the market is trending or choppy:
— ADX (weight 40%) : standard Directional Movement ADX, length 14. Score = min(ADX / 50 × 100, 100). High ADX = strong directional pressure.
— Choppiness Index (weight 35%) : ChopIdx = 100 × log10(sum(TR, N) / (highest(high, N) − lowest(low, N))) / log10(N), then inverted to a trend score: chopScore = 100 − ChopIdx. Length 14. Low choppiness = clean directional movement.
— R² Linearity (weight 25%) : R² = correlation(close, bar_index, 50)². Measures how linearly price is moving. R² near 1 = clean trend, R² near 0 = pure noise.
Final regime score = ADX × 0.40 + chopScore × 0.35 + R² × 100 × 0.25.
Thresholds:
— Score ≥ 60 → Trending (green)
— Score < 35 → Choppy (red) — signals flagged with ⚠ or hard-skipped
— Between → Mixed (yellow)
Why three indicators instead of one: ADX measures strength but lags. Choppiness measures range expansion but can spike on news. R² measures linearity but is noisy on short windows. Combined and weighted, they cover each other's failure modes.
3️⃣ 5-Factor Quality Score (0–100) with letter grading.
When a trail-flip signal fires, it's scored on five confluence factors:
— HTF Bias (max 30 points) : higher-timeframe (4× current TF by default) EMA-50 bias. Match = 30, against = 0, HTF data missing or filter off = 15 (neutral credit).
— Volume Confirmation (max 20 points) : volume > 20-bar SMA × 1.3 (configurable). Auto-bypassed and given full credit on volume-less instruments (FX).
— RSI Momentum (max 20 points) : bullish signal needs RSI > 50, bearish needs RSI < 50.
— Regime Score (max 20 points) : regimeScore × 0.20.
— Break Strength (max 10 points) : how far past the band close pierced, capped at 3 × ATR. breakStrength = min(|breakDist| / ATR, 3) / 3 × 100, then × 0.10.
Grades:
— Score ≥ 75 → A (high-quality, all factors aligned)
— Score ≥ 55 → B (acceptable, most factors aligned)
— Score < 55 → C (weak — most factors against, consider skipping)
A "Min Quality Score" input lets you hide everything below a threshold (e.g., set to 55 to show only A and B grades).
4️⃣ Risk Presets with Per-Trade Snapshot Locking.
Four risk presets (plus Custom) auto-set SL × ATR and TP1/TP2/TP3 as R-multiples:
— Conservative : SL 2.5 × ATR, TP 1R / 2R / 4R
— Balanced (default): SL 1.5 × ATR, TP 1R / 2R / 3R
— Aggressive : SL 1.0 × ATR, TP 1.5R / 2.5R / 4R
— Scalping : SL 0.8 × ATR, TP 0.8R / 1.5R / 2R
— Custom : full manual control
Critical detail: SL and TP multipliers are snapshotted at entry . If you change the preset mid-trade, the open position keeps its original levels — and the Avg R statistic stays accurate (each closed trade contributes its own-time R values).
5️⃣ Break-Even Logic with Diagnostic BE-Save Counter.
When Break-Even After TP1 is on (recommended), reaching TP1 automatically moves the stop-loss to entry price. From the next bar onward, any wick at entry stops out at break-even instead of original SL — letting winners run risk-free to TP2/TP3.
A dedicated BE Saves counter on the dashboard tracks wins that closed because BE-stop fired (TP1 reached but TP3 didn't). A high BE-save ratio is a diagnostic signal that your TP3 may be too far — consider tightening.
6️⃣ Same-Bar Hit Guard + Realistic Closure Logic.
Two guards prevent unrealistic results:
— Entry-bar hold : SL/TP hits are ignored on the entry bar itself. A hairpin wick can't instantly stop out a fresh position.
— Same-bar SL+TP1 : if both SL and TP1 are hit on the same bar, the trade closes as a LOSS (conservative — mirrors realistic broker behavior on a single wick).
Closures are routed through a single classifier function so flip-closures, SL-closures, and TP3-closures are all tallied identically.
7️⃣ Flip Detection + Dedicated Flip Alert.
A "flip" is when an opposite signal fires while a position is still active. The old trade is classified and counted (its TP-reached state determines W/L and R-multiple), THEN the new position opens. A dedicated POSITION FLIP alert fires in addition to the new buy/sell alert, with from-direction, to-direction, prior entry, and new entry — useful for closing managed positions externally.
8️⃣ Unified Dashboard with Three Toggleable Sections.
One positioned table with three sections you can switch on/off individually:
— Trade section : Direction (with grade), SL (with BE marker), TP1/TP2/TP3 (with ✓ on hit), Risk % / R:R with unicode gauge, Bars in Trade.
— Market section : Regime (with 0–100 gauge), HTF bias, Volume status, RSI, ATR | Volatility-rank with adaptive multiplier.
— Statistics section : Total signals + grade breakdown (A:N B:N C:N), Buy/Sell split, Closed trades, W/L, Win rate, Avg R-multiple, BE Saves, Flips.
Dynamic section headers carry live context (e.g., "─── Trade · LONG · 23 bars ───") so the divider itself summarizes state.
9️⃣ Three Trail Visual Schemes for Different Aesthetics.
— Adaptive (Bull/Bear) : classic bright green/red — high visibility.
— Premium Indigo (recommended): muted indigo (long) and earth-brown (short) — financial-terminal aesthetic, never competes with green TP lines.
— Monochrome : neutral grey for ultra-minimal charts.
Optional Double Trail Line adds a dashed secondary line offset by a fraction of ATR (configurable 0.05–1.0 × ATR), creating a "channel" visual. The dashed segments are drawn via a ring-buffer of line.new(... line.style_dashed) instead of plot() — this produces PulseWire's native dashed look that plot() can't render natively.
🔟 Theme Auto-Detection + Premium Color Palette.
The indicator detects whether your chart background is dark or light (using color.r(chart.bg_color) < 128) and adapts every palette element accordingly. Theme can also be force-set to Dark or Light. Light-theme variants use deeper, more saturated colors to maintain contrast (e.g., deep crimson SL on white, dark amber for BE).
All label text colors are calibrated for ≥4.5:1 contrast against their background (e.g., dark green text on bright green long labels = 7.8:1 ratio).
1️⃣1️⃣ Webhook-Ready JSON Alerts with Full Payload.
Every buy/sell/flip/SL-hit/TP-hit/BE-activation event can fire as plain text OR structured JSON. The JSON payload includes action, ticker, timeframe, price, SL, TP1/TP2/TP3, R:R, grade, quality score, regime, choppy flag, and flip flag — ready for any webhook automation.
🧠 HOW IT WORKS — STEP BY STEP
Step 1 — ATR + Trail Center: ATR(13) and EMA(21) of close are computed. Raw bands = EMA ± ATR × multiplier (base 1.618).
Step 2 — Adaptive Multiplier (optional): If on, the multiplier scales by 100-bar ATR percentile (×0.8 / ×1.0 / ×1.25).
Step 3 — Ratchet Logic (optional): In a long, the lower band can only move up. In a short, the upper band can only move down. On a direction flip, the band resets to raw.
Step 4 — Direction Flip Detection: Close > prev upper band → direction = 1 (long). Close < prev lower band → direction = −1 (short). A change in direction is the raw signal.
Step 5 — Regime Score: ADX × 0.40 + ChopScore × 0.35 + R² × 100 × 0.25. Trending ≥ 60, Choppy < 35.
Step 6 — Quality Score: HTF (0/15/30) + Volume (0 or 20) + RSI (0 or 20) + Regime × 0.20 + BreakStrength × 0.10. Grade A ≥ 75, B ≥ 55, C < 55.
Step 7 — Filtering: Min Quality threshold, choppy-skip toggle, barstate.isconfirmed gating.
Step 8 — Risk Levels: SL = entry ± ATR × slMult. TP1/TP2/TP3 = entry ± slDistance × tpMult. All snapshotted to the trade.
Step 9 — Lifecycle: On TP1 first-touch → BE activates (SL → entry). On SL or TP3 → trade closes, classified by tp1Reached (WIN if true, LOSS if false), R-multiple credited (1/3 per TP partition), state reset.
Step 10 — Visuals + Alerts: SL/TP lines drawn forward, labels updated on hit (✓ + cyan), alerts fired with full payload, dashboard updated.
📖 HOW TO USE — BEGINNER GUIDE
🎯 Quick start (5 steps):
1. Add Synapse Trail Pro to your chart on any timeframe.
2. Open Settings. Leave defaults for the first session — they are tuned for general use (Balanced preset, Premium Indigo trail, HTF filter on, BE on).
3. Wait for the first signal to fire (▲ Long or ▼ Short marker). The marker shows the grade (A/B/C) and a ⚠ flag if in choppy regime.
4. Read the dashboard (top-right by default). Note the Direction , Grade , Regime , and the SL/TP1/TP2/TP3 levels — these are your full trade plan.
5. Execute the trade in your broker using the SL and TPs from the dashboard. Optionally partition position 1/3 at each TP.
👁️ Reading the chart:
— 🟢 ▲ Long Grade-letter below a bar = Buy signal. Color matches grade quality.
— 🔴 ▼ Short Grade-letter above a bar = Sell signal.
— ⚠ next to the grade = signal fired in choppy regime (be cautious or skip).
— Trail line = current direction context. Indigo = long bias, terracotta = short bias (in Premium scheme).
— Dashed secondary line = soft/hard limit zone, offset by a fraction of ATR.
— ENTRY line (dotted blue) = your entry reference price.
— SL line (solid red) = your stop-loss.
— TP1 / TP2 / TP3 lines (dashed green) = your take-profit targets. Turn solid teal with ✓ on hit.
— Entry → SL (BE) label in amber = break-even is active (TP1 was reached, SL is now at entry).
📊 Dashboard fields (Trade section):
— Direction : LONG / SHORT / FLAT + Grade letter.
— SL : stop-loss price. Shows "BE @" prefix when break-even is active.
— TP1 / TP2 / TP3 : target prices. ✓ prefix once reached.
— Risk / R:R : distance % from entry to SL + current R:R + visual gauge.
— Bars in Trade : how many bars since entry.
📊 Dashboard fields (Market section):
— Regime : Trending / Mixed / Choppy + 0–100 gauge.
— HTF : higher-timeframe bias (Bullish / Bearish / Flat / off).
— Volume : Confirmed / Weak / no data / off.
— RSI : current 14-period RSI value, color-coded.
— ATR | Vol : ATR value, 100-bar volatility percentile, and current adaptive multiplier.
📊 Dashboard fields (Statistics section):
— Signals : total fired + breakdown (A:N B:N C:N).
— Buy / Sell : directional split.
— Closed : total wins + losses (flip, SL, and TP3 closures all counted).
— W / L : wins / losses.
— Win Rate : TP1-reached = WIN. Color-coded ≥ 55% green, ≥ 45% yellow, else red.
— Avg R : average realized R-multiple per closed trade.
— BE Saves : wins that closed because BE-stop fired (diagnostic).
— Flips : trades closed by opposite signal mid-position.
💡 Beginner trading workflow:
1. Start with the Balanced preset and HTF Bias Filter ON .
2. Only take A-grade or B-grade signals — set Min Quality Score to 55.
3. Skip every signal flagged with ⚠ (choppy regime) until you understand the regime engine — or enable Hard-skip Choppy .
4. Use the Premium Indigo trail scheme — the muted colors keep your focus on the SL/TP levels, not the trail itself.
5. Always partition position 1/3 at each TP — that's what the R-multiple math assumes.
6. After 30–50 trades, review the Statistics section: if Avg R is positive, the setup works. If BE Saves > 30% of wins, consider tightening TP3.
🔧 Tuning guide:
— Too many signals: increase Min Quality Score to 75 (A-grade only), enable Hard-skip Choppy.
— Too few signals: lower Min Quality to 0, turn off HTF filter, switch from Balanced to Aggressive preset.
— Stops too tight: switch to Conservative preset (SL 2.5 × ATR).
— Stops too wide: switch to Scalping preset (SL 0.8 × ATR).
— BE stopping you out too often: disable Break-Even After TP1.
— Trail too jumpy: increase Trail EMA Length from 21 to 34, enable Ratchet.
— Trail too sluggish: decrease Trail EMA Length to 13, decrease ATR Length to 8.
— Chart too busy: turn off Double Trail Line and Regime Background, set Trail History Bars to 50.
⚙️ KEY SETTINGS REFERENCE
⚙️ Main Settings:
— ATR Length (default 13): ATR period for volatility band.
— Base ATR Multiplier (default 1.618 — golden ratio): base band width.
— Trail EMA Length (default 21): EMA period for trail center.
— Adaptive Volatility Multiplier (default off): auto-scale multiplier by 100-bar ATR percentile.
— Ratchet Trail (default on): trail only tightens in position direction.
🔍 Signal Filters:
— Min Quality Score (default 0): hide signals below threshold (0 = all, 55 = B+, 75 = A only).
— Hard-skip Choppy Signals (default off): fully suppress signals in choppy regime.
— Use HTF Bias Filter (default on): Quality Score bonus for HTF-aligned signals.
— HTF for Bias (default empty = auto 4×): higher timeframe for bias check.
— Use Volume Confirmation (default off): bonus when volume > 20-SMA × threshold.
— Volume Threshold (default 1.3): volume × SMA20 to count as confirmation.
🌊 Market Regime:
— ADX Length (default 14)
— Choppiness Length (default 14)
— R² Regression Length (default 50)
🛡️ Risk Management:
— Risk Preset (default Balanced): Conservative / Balanced / Aggressive / Scalping / Custom.
— Custom SL × ATR (default 1.5)
— Custom TP1/TP2/TP3 × Risk (default 1.0 / 2.0 / 3.0)
— Break-Even After TP1 (default on): move SL to entry on TP1.
— Show SL/TP Lines / Labels / % Distance : all on by default.
— Entry / SL / TP Line Styles : Dotted / Solid / Dashed defaults.
🎨 Visual:
— Theme (default Auto)
— Trail Color Scheme (default Adaptive Bull/Bear) — try Premium Indigo for a financial-terminal look.
— Trail Line Width (default 2)
— Trail History Bars (default 0 = all)
— Double Trail Line (default on)
— Double Trail Offset × ATR (default 0.25)
— Show Buy/Sell Labels / Grade / Regime Background / Watermark
📊 Dashboard:
— Show Dashboard (default on) — master toggle
— Position (default Top Right) — 6 positions available
— Trade / Market / Statistics Section toggles
🔔 Alerts:
— Webhook JSON Format (default off): plain text or structured JSON.
— Alert on TP Hits (default off)
— Alert on SL Hit (default on)
— Alert on Position Flip (default on)
🔔 ALERTS
— 🟢 BUY — ticker, TF, price, SL, TP1/TP2/TP3, R:R, grade, quality score, regime, choppy flag, flip flag
— 🔴 SELL — same payload
— 🔄 POSITION FLIP — from-direction, to-direction, prior entry, new entry
— 🛑 SL HIT — entry, SL price, time
— 🛡️ BE STOP-OUT — fires instead of regular SL when break-even was active
— 🎯 TP1 / TP2 / TP3 HIT — first-touch only, no duplicate fires
— 🛡️ BREAK-EVEN — fires the bar TP1 is reached and SL moves to entry
All alerts support plain text and JSON webhook format. All fire bar-close confirmed (alert.freq_once_per_bar_close).
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. Alerts fire once per bar close. The HTF security() call uses the canonical non-repaint pattern (close + ema with lookahead_on), reading the closed HTF bar without future leakage.
— 📐 The trail flip is the raw signal source; quality score and filters only suppress, never invent signals. Same-bar SL+TP1 always resolves as a LOSS (conservative bias toward stop).
— 📐 Statistics counters are session-scoped — they reset on script reload, input change, or by incrementing the "Reset Stats Counter" input. The Stats section is descriptive, not predictive: past behavior on a chart does not guarantee future behavior on the same chart.
— ⚖️ Win = TP1 reached (regardless of how the trade ultimately closed). Avg R assumes 1/3 position partitioned at each TP. These are conventions; your live execution may differ.
— 🛠️ This is an analysis tool, not an automated trading bot. It detects trail flips, scores quality, projects SL/TP zones, and tracks outcomes — trade decisions and execution remain yours.
— 🌐 Works on all markets and timeframes. Volume-based filters auto-bypass on instruments without volume data (FX). Adaptive multiplier and regime engine scale naturally across symbols.
— 📜 Fully open-source Pine v6. Read the code, fork it, adapt it. Feedback and forks welcome. Indicator

Liquidity Pools Pro [WillyAlgoTrader]💧 Liquidity Pools Pro is a fully free overlay indicator that automatically detects liquidity zones (equal highs and equal lows), scores them on a 4-factor strength model, catches sweeps (liquidity grabs) with reversal confirmation, and instantly delivers a complete trade plan: entry, stop-loss, three take-profits, and automatic break-even on TP1.
It unifies into a single coherent engine what traders usually have to assemble from 5–7 separate scripts: an adaptive pivot detector, a 4-factor pool scoring system (touches + recency + volume + HTF), sweep detection with close-back confirmation, an ATR-based risk calculator, risk presets, and an informative dashboard.
Works on any instrument (BTC, EURUSD, stocks, indices, futures) and any timeframe without retuning — every threshold is scaled through ATR.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A simple pivot detector just plots dots. A simple sweep signal fires on every wick. A plain ATR stop-loss ignores context. Individually these are noise. Combined, they form a complete mechanism for identifying zones where smart money harvests liquidity, and trading the reversal from them.
Integration chain:
Adaptive Pivot Detection → ATR-based Equality Tolerance → Pool Matching & Clustering → 4-Factor Strength Scoring → HTF Confluence Boost → Sweep Detection (wick + close-back) → Risk Engine (SL/TP/BE) → Position Lock + State Machine → Dashboard + Alerts
— The pivot detector adapts to volatility: length grows when ATR is high (less noise on crypto) and shrinks when ATR is low (faster reaction on forex).
— Tolerance in ATR units lets the engine treat highs/lows as "equal" on any instrument — no manual tick configuration.
— Matching clusters pivots into pools (multiple touches at one zone = thicker liquidity).
— Scoring filters out weak pools and highlights exactly the ones price returns to for stop-runs.
— HTF Confluence adds +20 to strength when a pivot on the higher timeframe aligns — a filter against lower-timeframe traps.
— Sweep is identified as a wick beyond the level + close back inside (classic failed breakout / liquidity grab).
— The risk engine builds a complete trade plan for each signal and trails the stop to break-even after TP1.
— Position Lock prevents opposite signals from silently overwriting the SL/TP of an open position.
Remove any one link and the chain breaks. Sweeps without scoring = noise. Scoring without sweeps = pretty boxes that never trigger. Risk engine without position lock = silent overwrite of an open trade. This pipeline solves all three problems.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Adaptive Pivot Length — pivot length that adjusts itself to the market.
Most indicators use a fixed pivot length (5, 10, 20). That works on one timeframe of one instrument — and breaks on anything else.
Here the length is computed dynamically:
— volRatio = ATR(14) / ATR(50)
— adaptiveLen = round( clamp( 10 / max(0.5, volRatio), 4, 16 ) )
In high-volatility regimes (volRatio > 1) length shrinks to 4–6 bars — the indicator reacts faster. In low-volatility regimes (volRatio < 1) length grows to 14–16 bars — small noise is filtered out. Can be disabled and set manually (default 8 when Adaptive is OFF).
2️⃣ ATR Equality Tolerance — scale-invariant definition of "equal" levels.
Two pivots are treated as touches of the same liquidity zone if the distance between them ≤ ATR × tolerance (default 0.25).
— 0.15 = strict (tight pools, fewer matches)
— 0.25 = balanced (recommended)
— 0.50 = loose (wider pools, more matches)
This solves a fundamental problem: on BTCUSD, "equal within $50" is normal; on EURUSD the same value is huge. ATR-based tolerance gives one setting that works across all instruments.
3️⃣ 4-factor Strength Score — pool weight on a 0–100 scale.
Every pool is scored as the sum of four components, clamped to 0–100:
— 🎯 Touches (up to 35 points) : (touchCount − 1) × 9, capped at 35. One pivot = 0, two = 9, three = 18, four = 27, five+ = 35.
— ⏳ Recency (up to 35 points) : 35 × 0.5^(ageBars / halfLife). Fresh pool = 35, after one half-life = 17.5, after two = 8.75. Default halfLife = 150 bars.
— 📊 Volume (up to 20 points) : log(max(1, cumVol / median)) × 8, capped at 20. Accumulated on every bar that touches the zone — not just the pivot bar.
— 🔭 HTF Confluence (+20 bonus) : if a higher-timeframe pivot exists within tolerance × 1.5 — +20 added to the total.
Examples:
— Fresh 1-touch pool, no volume, no HTF: 0 + 35 + 0 + 0 = 35
— Fresh 2-touch pool: 9 + 35 + 0 + 0 = 44
— Fresh 3-touch pool with 2× median volume: 18 + 35 + 5.5 + 0 = 58.5
— Old (1 half-life) 2-touch pool: 9 + 17.5 + 0 + 0 = 26.5
4️⃣ Sweep Detection with close-back confirmation — real liquidity grabs, not false wicks.
Pool state transitions follow strict logic:
— STATE_ACTIVE → STATE_SWEPT: wick pierced the level but bar closed beyond it (this is a breakout, not a reversal)
— STATE_ACTIVE → STATE_MITIGATED: wick pierced AND bar closed back inside (real liquidity sweep)
The default signal (Require Body Reversal = ON) only fires on MITIGATED. This is classic SMC "fakeout → reversal" logic. Disable it and any wick sweep will fire (more aggressive, more noise).
5️⃣ Volume-at-Level Accumulation — real volume at the level, not just at the pivot.
Most indicators count volume only on the pivot bar. That's misleading — true liquidity accumulates across all the touches.
Here, on every confirmed bar the engine checks for a zone touch (high or low inside levelBot–levelTop), and if found, adds the bar's volume to the pool's cumVol. Across 40 active pools this is O(P) per bar — fast.
6️⃣ HTF Confluence Engine — higher-timeframe pivots as a filter.
When enabled, pivots from the configured HTF (default 4H) are requested via request.security with lookahead_on on a closed bar (no repaint). If a pool aligns with an HTF pivot within tolerance × 1.5 — +20 is added to its score.
Used to filter signals: HTF-confluent pools cross the strength threshold faster.
7️⃣ 5 Risk Presets + Custom — ready-made SL/TP per trading style.
— Conservative: SL 2.5×ATR, TP 1R/2R/4R
— Balanced: SL 1.5×ATR, TP 1R/2R/3R (default)
— Aggressive: SL 1.0×ATR, TP 1.5R/2.5R/4R
— Scalping: SL 0.8×ATR, TP 0.8R/1.5R/2R
— Custom: manual multipliers
Calculation:
— slDistance = ATR(14) × slMult
— entry = close on the signal bar
— SL = entry ∓ slDistance
— TP1/2/3 = entry ± slDistance × tpMult
8️⃣ Automatic Break-Even after TP1 — stop trails to entry on its own.
After TP1 is touched (and SL didn't fire on the same bar), the active SL is moved to entry. From that point on, any pullback to entry = break-even exit. TP2/TP3 logic continues to track.
Edge case is handled: if both TP1 and SL fire on the same bar, the stop is evaluated against the ORIGINAL value (effectiveSL captured before the BE update). No "magic" loss-saving.
9️⃣ Position Lock — protection against silent trade overwrites.
While a trade is active (activeDir ≠ 0), new signals are blocked. Exception: if the current bar is closing the position (SL or TP3 hit), it's treated as "closing now" and an opposite signal is allowed through.
Without this protection, a fresh signal would silently overwrite the SL/TP of an open position — critical for both manual trading and webhook-based autotrading.
🔟 Pro-style visuals with adaptive contrast.
— Liquidity zones: colored boxes with transparency tied to strength (transparency = 88 − strength × 0.33)
— Mid-line: dotted line through the center of each zone
— Pool labels: SSL/BSL × touch count volume
— SL: solid red line (dims when BE activates)
— Entry: dotted blue
— TP1/2/3: dashed green (turn cyan + ✓ when hit)
— Themes: Auto/Dark/Light with WCAG AA contrast on every background
1️⃣1️⃣ Full alert suite for autotrading — JSON or plain text.
Every signal and trade event triggers alert() in one of two formats:
— Plain text: "🟢 SWEEP BUY | TICKER | TF | Price: X | Pool: 58/100 | SL: ... | TP1: ... | TP2: ... | TP3: ... | R:R: 1.0"
— JSON for webhooks: {"action":"buy","ticker":...,"tf":...,"price":...,"sl":...,"tp1":...,"tp2":...,"tp3":...,"rr":...,"pool_strength":...}
All alerts use alert.freq_once_per_bar_close (no intra-bar duplicates).
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Pivot detection: on each bar, ta.pivothigh and ta.pivotlow are evaluated with the dynamic left length (adaptiveLen) and the configured right confirmation.
Step 2 — Matching: each new pivot is compared against all active pools of the same type (high/low). If distance ≤ tolerance AND age ≤ maxLookback, it's added as a new touch (level is recalculated as a weighted average).
Step 3 — Pool creation: if no match is found, a new pool is created with touchCount = 1 and the current volume. The HTF bonus is applied if confluent.
Step 4 — Volume accumulation: on each confirmed bar, if high or low touches an active zone, the bar's volume is added to that pool's cumVol.
Step 5 — Strength compute: on demand (lazy), the final strength is calculated using the 4-factor formula.
Step 6 — Sweep check: for every active pool, wickSweep (wick beyond the level) and closeBack (close back inside) are evaluated. State becomes MITIGATED if both true; SWEPT if only wickSweep.
Step 7 — Signal generation: if pool strength ≥ minStrengthSignal AND mitigation is confirmed (or Body Reversal is OFF) AND signals are enabled — a BUY/SELL fires.
Step 8 — Risk setup: on a confirmed signal, entry/SL/TP1/TP2/TP3 are constructed, position lock is engaged, and lines + labels are drawn.
Step 9 — Trade tracking: every bar, SL/TP1/TP2/TP3 hits are evaluated with same-bar-misfire protection (justOpened flag).
Step 10 — Break-even: on TP1 first touch (without simultaneous SL hit), SL is moved to entry, the original SL line dims, and the ENTRY label gets a "→ SL (BE)" suffix.
Step 11 — Auto-reset: on SL hit or TP3 hit, all trade-state variables reset, lines are deleted, position = FLAT.
Step 12 — Pruning: when active pools > maxActivePools (default 40), the oldest swept pool is removed first, then the weakest active pool.
📖 HOW TO USE — STEP-BY-STEP FOR NEWCOMERS
🎯 Quick start (5 minutes):
1. Add the indicator to any instrument and any timeframe.
2. Wait 50–100 bars for the warmup period — the indicator needs to accumulate ATR and pivot history.
3. Keep the dashboard ON (default position: Top Right) — it shows how many pools are tracked.
4. Pick a Risk Preset for your style: Scalping for M1–M5, Balanced for M15–H1, Conservative for H4–D1.
5. Create an alert: right-click on the chart → Add alert → Condition: Liquidity Pools Pro → Any alert() function call → Frequency: Once per bar close.
👁️ Reading the chart:
— 🔴 Red box = Sell-Side Liquidity (SSL) = equal highs where long stops sit. Price tends to wick into them to harvest stops.
— 🟢 Green box = Buy-Side Liquidity (BSL) = equal lows where short stops sit.
— 🔢 Number in brackets = pool strength, 0–100. Higher = thicker liquidity.
— ✖ ×3, ×4 = number of touches at this zone. More touches = more reliable.
— 📊 2.5M, 850K = cumulative volume traded at the level.
— ⚪ Dimmed gray box = swept or mitigated pool (already triggered).
— 🟢 "Long" below the bar = buy signal (BSL sweep + reversal).
— 🔴 "Short" above the bar = sell signal (SSL sweep + reversal).
— 🔵 Blue dotted line = ENTRY.
— 🔴 Red solid line = SL (stop-loss).
— 🟢 Green dashed lines = TP1/TP2/TP3. Cyan with ✓ = already hit.
— 🟠 Amber ENTRY label with "→ SL (BE)" = stop has been moved to break-even.
📊 Dashboard fields:
— Symbol / TF: current instrument and timeframe.
— Pivot Len: pivot length (with "(adapt)" tag when Adaptive is ON).
— Active Pools: total active pools and side breakdown (↑ highs, ↓ lows).
— Strong SSL ↑ / Strong BSL ↓: price and strength of the strongest pool on each side.
— Nearest Above / Below: pools closest to current price.
— Stats: Mit:N Sig:M/T — number of mitigations, signals, total pools. If Sig = 0 — lower the sensitivity (see Tuning).
— Position: current trade state (LONG/SHORT/FLAT).
— SL / TP1 / TP2 / TP3: levels of the active trade. ✓ = hit. "BE @" = stop at break-even.
— Plan R:R: TP1 multiplier (1.0R, 1.5R, 2.0R, etc.).
— Risk %: percent risk from entry to SL.
🔧 Tuning guide — when something feels off:
— Too few signals (Stats Sig: 0/N): lower Min Pool Strength for Signal from 25 to 15. Or disable Require Body Reversal — pure wick sweeps will fire.
— Too many signals, lots of noise: raise Min Pool Strength to 40 (only 2-touch pools) or 60 (only strong multi-touch with volume). Enable HTF Confluence.
— Too many zones, chart is crowded: raise Min Strength to Display to 30–40 — weak pools will be hidden but still tracked internally.
— Zones too narrow, false equality: increase Equality Tolerance from 0.25 to 0.40.
— Zones too wide, catching everything: decrease Equality Tolerance to 0.15.
— Stops getting hit too often: switch from Balanced to Conservative (SL 2.5×ATR instead of 1.5×ATR).
— Signals appear but no position opens: a trade is already active (Position Lock). Check the Position row in the dashboard.
— Strange scoring on forex: disable Volume-Weighted Strength (forex often lacks reliable volume data).
💡 TRADING IDEAS
— Manual trading on signals: only take trades where pool strength ≥ 50 and HTF Confluence is enabled.
— Zones only, no signals: disable Enable Sweep Signals and use the indicator as a pure liquidity map for manual setups.
— Scalping setup: preset Scalping + M1–M5 + Min Strength 15 + Adaptive Pivot ON.
— Swing setup: preset Conservative + H4–D1 + Min Strength 50 + HTF Confluence ON (Daily HTF).
— Webhook autotrading: enable Webhook JSON Format + alert.freq_once_per_bar_close + connect a bot to the JSON payload.
— Confluence with other indicators: combine signals with a trend filter (EMA50, SuperTrend) — only longs above EMA50, only shorts below.
⚙️ KEY SETTINGS
🎯 Liquidity Detection:
— Adaptive Pivot Length (default ON): auto-adjust pivot length to volatility.
— Manual Pivot Length (8): used when Adaptive is OFF.
— Right Confirmation Bars (2): bars to the right needed to confirm a pivot.
— Equality Tolerance ×ATR (0.25): level equality threshold.
— Max Pivot Lookback (200): how far back to search for matches.
— Max Active Pools (40): hard cap on simultaneously tracked pools.
💪 Strength Scoring:
— Min Strength to Display (0): pools below this score are hidden (visual only).
— Strength Half-Life (150): bars after which the recency factor halves.
— Volume-Weighted Strength (ON): include the volume factor in scoring.
📡 Sweep Signals:
— Enable Sweep Signals (ON): generate BUY/SELL signals.
— Min Pool Strength for Signal (25): minimum pool strength to fire.
— Require Body Reversal (ON): require close-back inside the level (recommended).
🔭 HTF Confluence:
— Enable HTF Confluence (default OFF): use higher-timeframe pivots as a filter.
— Higher Timeframe (240 = 4H): which HTF to query.
🛡️ Risk Management:
— Risk Preset (Balanced): Conservative / Balanced / Aggressive / Scalping / Custom.
— ATR Length (Risk) (14): ATR period for SL distance.
— Custom SL/TP1/TP2/TP3 ×ATR / ×Risk : manual multipliers.
— Show SL/TP Lines & Labels (ON): draw trade levels on the chart.
— Break-Even After TP1 (ON): auto-trail stop to entry.
— Show % Distance on Labels (ON): append % from entry to SL/TP labels.
🎨 Visual:
— Theme (Auto): Auto / Dark / Light with adaptive contrast.
— Show Liquidity Zones / Strength Bar / Labels / Volume / Swept Zones / Buy-Sell Markers / Watermark : visual toggles.
— Label Font Size / Signal Marker Size : Tiny → Huge.
📊 Dashboard:
— Show Dashboard (ON), Position (Top Right): corner placement.
🔔 Alerts:
— Webhook JSON Format (OFF): JSON or plain text.
— Alert on SL Hit (ON), Alert on TP Hits & BE (OFF): alert toggles.
🎨 Colors:
— Bullish (Demand) Color / Bearish (Supply) Color : zone colors.
🔔 ALERTS
— 🟢 SWEEP BUY — BSL sweep + reversal, payload: ticker, tf, price, sl, tp1, tp2, tp3, rr, pool_strength
— 🔴 SWEEP SELL — SSL sweep + reversal, same payload structure
— 🛑 SL HIT — stop-loss triggered (or 🛡️ BE STOP-OUT when Break-Even is active)
— 🎯 TP1 HIT / 🎯 TP2 HIT / 🏆 TP3 HIT — take-profit hits (only fired when SL didn't trigger on the same bar)
— 🛡️ BREAK-EVEN — stop moved to entry
All alerts support both plain text and JSON webhook formats. All fire on alert.freq_once_per_bar_close — no intra-bar duplicates and no repaint.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. Signals are generated only on barstate.isconfirmed (closed bar). Pivots are confirmed with a right window of rightConfirmInput bars (default 2) — meaning the actual swing point is in the past by N bars, but the indicator does not redraw already-drawn pools. HTF data via request.security uses lookahead_on on the offset bar — a standard non-repainting technique.
— 📐 Warmup period: the first 50+ bars (max(50, atrLenRisk + 10)) the indicator does not generate signals — it accumulates ATR and pivot history.
— ⚖️ Position Lock is not absolute against opposite signals: if the active trade closes on the current bar (SL or TP3 hit), an opposite signal will pass. This is by design — instant two-way blocking is impossible.
— 📊 Volume factor is optional: on forex instruments without reliable volume, disable Volume-Weighted Strength.
— 🛠️ This is an analysis tool, not a trading bot. The indicator detects liquidity zones, scores them, identifies sweeps, and proposes a trade plan — but the decision to open a position is yours. Past performance does not guarantee future results. Test on demo before trading live.
— 🌐 Universal compatibility: works on any instrument (crypto, forex, stocks, indices, futures) and any timeframe (M1 → M).
Version v1.1.5. Fully free. Open-source. Indicator

Adaptive Fibonacci Trailing System [WillyAlgoTrader]🚀 Adaptive Fibonacci Trailing System (AFT) is a premium overlay toolkit that combines a regime-aware adaptive trailing stop, a dynamic Fibonacci premium/discount cloud, a 6-factor confidence grading engine, full SL/TP risk management with break-even logic, and a built-in backtest tracker — all in one indicator. Every signal arrives with a clear direction, a confidence grade (A+ / A / B / C), a recommended position size, and pre-placed stop-loss and three take-profit levels.
This is not a static trailing stop. This is not another Fibonacci retracement tool you have to draw by hand. This is a complete trade-management system that automatically detects market structure, classifies the current regime (Trending / Ranging / Volatile), adapts its stop placement to the conditions, scores every setup from 0 to 100%, and tracks every closed trade so you can see whether your settings actually work on your market.
🎯 WHO THIS IS FOR
— Trend traders who want a structural trailing stop that adapts to volatility instead of trailing a fixed percentage
— Swing traders who need clean Buy/Sell signals with pre-calculated SL, TP1, TP2, TP3
— Day traders and scalpers who need fast regime detection so they don't trade trend signals in a ranging market
— Discretionary traders who want a confidence score to filter low-quality setups
— Systematic traders who want JSON webhook alerts for automation
— Anyone tired of generic Fibonacci tools that ignore market context
— Traders who want a built-in backtest tracker to validate the system on their own market and timeframe
💎 WHY TRADERS CHOOSE THIS INDICATOR
✅ Adaptive trailing stop — not a fixed ATR multiple.
The trailing stop is anchored to Fibonacci levels of the most recent swing range and adjusts itself based on the detected regime. In trending markets it widens to let winners run. In ranging markets it tightens to exit fast. In volatile markets it sits at the midpoint. You don't choose a static distance — the indicator chooses the right distance for current conditions.
✅ Built-in market regime detection.
Every bar is classified as Trending , Ranging , or Volatile using ADX and a volatility ratio (current ATR vs. 50-bar average). Hysteresis is applied so the regime doesn't flicker on borderline values. You always know what kind of market you're in before you take the trade.
✅ Dynamic Fibonacci cloud.
A premium/discount zone is drawn live between the 0.382 and 0.618 levels of the current swing structure. The cloud re-anchors automatically every time the structure changes — no manual drawing, no stale levels from last week. Three visual styles available: Gradient, Solid, or Pulsing (brightens when price approaches the 0.5 inflection point).
✅ Two signal modes for two trader styles.
Trail Flip mode fires signals only when the adaptive trail flips direction — fewer signals, strong trend conviction. 0.5 Cross mode fires when price crosses the Fibonacci 0.5 (premium/discount inflection) with full triple-confirmation — earlier entries, more signals. The 0.5 Cross mode also has three strictness levels (Strict / Relaxed / None) so you can dial signal frequency to match your style.
✅ 6-factor confidence score on every signal.
Every Buy/Sell signal comes with a percentage score and a letter grade. Grades range from D (poor) to A+ (premium setup). The score combines structure strength, regime alignment, ADX strength, volume, volatility favorability, and Fibonacci/SMA50 confluence — weighted into a single number you can filter on. Set a minimum confidence threshold and weak signals are blocked automatically.
✅ Adaptive position sizing.
Set your base risk per trade once. The indicator scales it by signal grade: C grade gets 0.5× base, B grade 0.75×, A grade 1.0×, A+ grade 1.5×. You take small positions on average setups and larger positions on premium setups — automatically. Recommended risk % is shown live in the dashboard.
✅ Full risk management with one-click presets.
Choose Conservative, Balanced, Aggressive, Scalping, or Custom. Every Buy/Sell signal automatically draws Entry, SL, TP1, TP2, TP3 lines on the chart with price and percent-from-entry labels. Lines extend forward and update live until the trade closes.
✅ Break-even trail after TP1.
When TP1 is hit, the stop-loss automatically moves to entry. Your remaining position becomes risk-free. The original SL line dims to show it's no longer active, and the entry label updates to "→ SL (BE)" so you always know where the real stop is.
✅ Built-in backtest tracker — per-grade.
Every closed trade is tracked: total trades, wins, losses, win rate, average R, profit factor, total R. Then it's broken down by confidence grade so you can see whether A+ signals actually outperform B signals on your market. If they don't, you know to retune. The tracker auto-resets when you change critical inputs so old stats never pollute new tests.
✅ Triple-confirmation breakout filter.
Direction changes require body ratio + ATR-based penetration + regime gate. No more wick-based fakeouts triggering position flips. You can dial the strictness for both modes independently.
✅ Universal — works on every market and timeframe.
Forex, crypto, stocks, futures, indices. Scalping (1m, 5m), intraday (15m, 1h), swing (4h, 1D), position (1W). The structure engine adapts to whatever pivot length you set. Volume is auto-detected and gracefully ignored on FX where it's unreliable.
✅ Professional dashboard with full live state.
At a glance: Regime, ADX, Volatility ratio, Signal mode, Confidence + grade, Suggested risk %, Direction, Trail Stop price, Timeframe, full SL/TP/RR/Risk block, and a complete Backtest section with per-grade breakdown.
✅ Alerts in plain text or JSON for webhooks.
Buy / Sell / SL hit / TP1, TP2, TP3 hit / Break-even activated. JSON payload includes ticker, timeframe, price, SL, all three TPs, R:R, regime, mode, confidence, grade, and recommended risk % — ready to feed any automation pipeline.
🚀 HOW IT CHANGES YOUR WORKFLOW
Before: You draw Fibonacci retracements by hand on every swing. You guess where to place the stop — fixed ATR multiple, recent low, gut feel. You take signals in any market without checking if it's trending or ranging. You have no idea whether your "best" setups actually win more often. You miss break-even opportunities and watch winners turn into losers. You manage three TPs in your head and forget which one was already hit.
After: You add the indicator. The Fibonacci cloud is already drawn — re-anchored to the current swing automatically. The dashboard tells you the regime, the signal grade, and the recommended risk % before you click Buy. SL, TP1, TP2, TP3 are pre-placed and labeled with prices and percentages. When TP1 hits, your stop is moved to entry without you touching anything. Every closed trade is logged and broken down by grade. After 50 trades, you know exactly which signal mode and confidence threshold work on your market.
What used to take 5 minutes of manual setup per trade now takes 5 seconds — read the dashboard, decide.
📖 HOW TO USE
🎯 Quick start (for beginners):
1. Add the indicator to your chart (any market, any timeframe).
2. Look at the dashboard in the top-right corner. It tells you the regime (Trending / Ranging / Volatile), the current confidence score, and the suggested risk %.
3. Wait for a "▲ Long " or "▼ Short " label to appear under or above a candle. The grade letter (C, B, A, A+) tells you the quality of the signal.
4. The indicator automatically draws Entry, SL, TP1, TP2, TP3 lines on the right side of the chart with prices and percentages.
5. Place your trade with the suggested risk % from the dashboard. Use the SL and TP levels exactly as drawn.
6. When TP1 hits (line turns cyan with a ✓), your SL automatically moves to entry — your trade is now risk-free. Let it run to TP2 and TP3.
7. The Backtest panel at the bottom of the dashboard tracks every closed trade. Watch your stats grow.
👁️ Reading the chart:
— 🟢 Green "▲ Long " label = Buy signal with grade letter
— 🔴 Red "▼ Short " label = Sell signal with grade letter
— 🟡 The colored cloud between two Fib lines = the current premium/discount zone
— The middle dotted line (Fib 0.5) = the inflection between premium and discount
— Solid colored line that follows price = the adaptive trailing stop (green when long, red when short)
— Blue dotted line = your entry price
— Red solid line = your stop-loss
— Green dashed lines (3 of them) = TP1, TP2, TP3
— When a TP is hit, its line turns cyan and the label gets a ✓ check mark
— When break-even activates, the SL line dims and the entry label becomes amber with "→ SL (BE)"
📊 Dashboard fields:
— Regime : current market state (Trending, Ranging, Volatile)
— ADX : trend strength number
— Vol Ratio : how volatile the market is right now (1.0 = average)
— Signal : which signal mode is active and its strictness
— Confidence : the score and grade of the most recent / pending signal
— Sugg. Risk : the recommended position size as % of account
— Direction : current trail direction (Bullish / Bearish / Flat)
— Trail Stop : the live trailing stop price
— TF : your current timeframe
— SL / TP1 / TP2 / TP3 : active trade levels (BE @ price when break-even is on)
— R:R : risk-to-reward ratio at TP1
— Risk : distance from entry to SL as % of price
— Backtest section : Trades, Win Rate, Avg R, Profit Factor, Total R
— By Grade : same stats broken down by A+ / A / B / C / D
💡 Trading ideas:
— Trend-follower setup : Use Trail Flip mode + Conservative risk preset on 1H or 4H. Take only A and A+ signals. Let trades run to TP3.
— Premium/discount swing setup : Use 0.5 Cross + Strict + Balanced risk on 15m or 1H. The 0.5 cross catches reversals at the Fibonacci inflection point.
— Scalping setup : Use 0.5 Cross + Relaxed + Scalping preset on 1m or 5m. Lower the minimum confidence to 50%. Exit at TP1 or TP2.
— Confirmation overlay : Run AFT alongside your existing system. Only take your trades when AFT confidence shows B or higher in the same direction.
— Beginner-safe mode : Set minimum confidence to 75 (A grade or above). Use Conservative risk preset. Let break-even handle most management.
— Backtest-then-trade workflow : Toggle Reset Backtest, scroll the chart back, let the indicator collect 30+ trades, check the per-grade stats, then start trading the grades that perform best.
🔧 Tuning guide:
— Too many signals? Increase Min Confidence (try 60 or 75), or switch from "None" to "Strict" cross strictness, or use Trail Flip mode.
— Too few signals? Lower Min Confidence (try 40 or 50), or set strictness to "Relaxed" or "None".
— Stop too tight? Switch trailing mode from Aggressive to Balanced or Conservative, or pick the Conservative risk preset.
— Stop too wide? Switch to Aggressive trailing mode or Aggressive / Scalping risk preset.
— Whipsaw on ranging markets? Increase Breakout Confirmation to 0.3 or 0.5, raise Min Body Ratio to 0.6.
— Want only premium setups? Set Min Confidence to 90 (A+ only). Expect 1-3 signals per week on most markets.
⚙️ KEY FEATURES
🏛️ Structure Engine:
— Score-filtered swing detection (every swing is rated by ATR-normalized impulse and volume)
— Adjustable pivot length (3 to 50 bars)
— Memory of the last 5 swings for stable Fibonacci anchoring
— Optional swing labels showing the score number
📡 Market Regime Engine:
— ADX-based trend detection with adjustable threshold
— Volatility ratio (current ATR vs. 50-bar average) for volatile-state detection
— Hysteresis on both thresholds — no regime flicker
— Optional background highlight for 10 bars after each regime change
🎯 Trailing Stop Engine:
— 4 modes: Aggressive (tight), Balanced, Conservative (wide), Adaptive (auto-adjusts to regime)
— Volatility-inverse adjustment: tighter in low vol, wider in high vol
— Direction-locked update: longs only lift the stop, shorts only lower it
— Triple-confirmation breakout filter (body ratio + ATR penetration + regime gate)
🌀 Fibonacci Cloud:
— Auto-anchored to the latest valid swing high/low
— 3 visual styles: Gradient, Solid, Pulsing
— Optional confluence markers when a Fib level aligns with SMA50
— Toggleable Fib level lines (0.382 / 0.5 / 0.618)
🛡️ Risk Management:
— 5 presets: Conservative, Balanced, Aggressive, Scalping, Custom
— ATR-based stop sizing with adjustable multiplier
— Three take-profit levels with adjustable risk-multiples
— Break-even trail toggle (moves SL to entry on TP1 hit)
— Live SL/TP lines with price + percent-from-entry labels
— Position lock: new signals are blocked while a trade is active
🎓 Confidence & Sizing Engine:
— 6-factor scoring (structure / regime / ADX / volume / volatility / confluence)
— 5 grades: D / C / B / A / A+
— Minimum confidence filter (0–100%) blocks weak signals
— Adaptive position sizing toggle scales risk by grade
— Adjustable base risk % per trade
📈 Backtest Tracker:
— Tracks every closed trade (closed by SL or TP3)
— Win/loss outcome model with TP1/TP2/TP3 partial-success recognition
— Win rate, average R, profit factor, total R
— Per-grade breakdown (validate the confidence engine on your market)
— Auto-reset on critical input changes
🎨 Visual System:
— Auto / Dark / Light theme detection
— Configurable label and dashboard font sizes
— Compact Pro-style design — no chart clutter
— Optional WillyAlgoTrader watermark
🔔 Alert System:
— Buy / Sell signals with full payload
— SL Hit, TP1/TP2/TP3 Hit, Break-even Activated
— Plain text or JSON webhook format
— Bar-close confirmed (no repainting)
📊 Dashboard:
— 5 position options (corners + middle right)
— 3 font sizes
— Adapts to your visible feature set (collapses sections that aren't enabled)
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals fire only on confirmed bar close. Pivots use equal left/right lookback (the swing point is in the past by N bars — this is delayed confirmation, not repainting). Alerts use alert.freq_once_per_bar_close.
— 📐 The trailing stop and Fibonacci anchors require at least two opposing swings in memory. Fresh charts and new symbols need a brief warm-up period (typically 50 bars).
— 📐 On markets with no reliable volume data (most FX pairs), the volume-confirmation factor is replaced by a neutral default. The indicator works fully on FX.
— ⚖️ The backtest tracker counts only confirmed closures (SL hit or TP3 hit). Partial profits at TP1/TP2 are recognized in the win/loss outcome but realize at the level reached when the trade ultimately closes. Real-trading slippage, spread, and fees are not modeled.
— ⚖️ The confidence score is a quantitative filter, not a prediction of profit. It reflects setup quality based on the inputs available — not future performance.
— 🛠️ This is an analysis and trade-management tool, not an automated trading bot. It detects structure, classifies regime, scores setups, places SL/TP levels, and tracks outcomes — trade decisions remain yours .
— 🌐 Universal compatibility — works on all markets (Forex, crypto, stocks, futures, indices) and all timeframes from 1m to 1M. Indicator

Breakout Pattern Setup [WillyAlgoTrader]📐 Breakout Pattern Setup is an overlay indicator that automatically detects converging price channels (wedges, triangles, pennants) by fitting trendlines to confirmed pivot points using a boundary-fit algorithm, then monitors for breakouts confirmed by a 5-factor strength scoring engine — with directional probability scoring while price is inside the channel, volume contraction verification, and automatic TP/SL placement based on the measured move (channel width projected from breakout). Once a breakout fires, the trade stays open until TP3 (full measured move) or SL is reached — with trailing to breakeven after TP1.
The core concept: converging channels compress volatility — when price breaks out of a narrowing range, the ensuing move tends to be proportional to the channel's maximum width. This indicator automates the entire workflow: detect pivots, fit upper and lower trendlines, verify convergence and volume contraction, score the breakout quality when it occurs, set targets based on the measured move, and track the trade to completion.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Manual channel drawing is subjective — two traders will draw different trendlines from the same pivots. A breakout without strength scoring treats strong and weak breaks equally. Targets without measured-move anchoring are arbitrary.
This indicator chains each component into a sequential pipeline:
Pivot detection → Boundary-fit algorithm (best trendline pairs) → Convergence + width + volume contraction verification → Channel visualization → Directional probability scoring → Breakout detection + 5-factor strength scoring → TP/SL from measured move → Trailing SL to breakeven after TP1 → Trade outcome tracking (win rate)
The pivot detection feeds raw swing points to the boundary-fit algorithm. The algorithm tests all pivot pair combinations and selects the lines with the most touches and least deviation — producing objective, reproducible trendlines. The convergence filter ensures only narrowing channels qualify (not parallel channels or expanding formations). Volume contraction confirms the volatility squeeze is genuine. The directional score gives real-time probability before the breakout occurs. The 5-factor strength score evaluates the breakout candle itself. And the measured-move TP/SL system manages the trade from entry through breakeven trail to final outcome.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Boundary-fit trendline algorithm.
The algorithm finds optimal upper and lower trendlines by exhaustive search over confirmed pivots:
Upper boundary: For every pair of pivot highs (A, B) within the lookback window:
— Project a line through A and B
— Check all other pivot highs: none may exceed the line by more than deviationMax × ATR (no overshoots beyond tolerance)
— Count how many pivot highs fall within touchTolerance × ATR of the line (touches)
— Keep the pair with the most touches
Lower boundary: Same process for pivot lows — no undershoot beyond tolerance, maximize touches.
A trendline is projected via: y = y1 + (y2 − y1) × (x − x1) / (x2 − x1). The touch tolerance (default 0.15× ATR) and deviation maximum (default 0.3× ATR) are both ATR-normalized, adapting to the instrument's volatility.
The scan runs on new pivots and every 10 bars (configurable interval), testing up to 15 recent pivots per side — producing the objectively best-fitting converging channel from available data.
2️⃣ Multi-criteria channel validation.
A detected channel must pass all five checks:
— 📏 Convergence : the channel is narrowing — current width < starting width. Convergence rate = 1 − (widthNow / widthStart) ≥ minConvergence (default 0.02 = at least 2% narrower)
— 📐 Width range : current width ≥ minChannelWidth × ATR (not too thin) AND < 10× ATR (not too wide)
— 📊 Volume contraction (when enabled): average volume inside the channel < 85% of average volume before the channel — confirms the volatility squeeze is accompanied by declining participation
— 📍 Price position : previous bar's close is inside the channel (not already broken out)
— ⚡ No inversion : upper boundary > lower boundary at the current bar
3️⃣ 5-factor breakout strength scoring (0–100).
When price closes beyond a channel boundary:
— 📏 Penetration depth (25%) : (close − boundary) / ATR, normalized to 0–1 (capped at 2× ATR). Deeper penetration = stronger commitment.
— 📊 Body ratio (15%) : candle body / candle range. Full-body candles (small wicks) indicate conviction. Doji/pin bars = weak.
— 📍 Body commitment (15%) : body midpoint beyond the boundary = 1.0, inside channel = 0.3. Full body commitment means the entire candle moved through, not just a wick.
— 📈 Volume confirmation (25%) : volume > SMA(20) × volumeSpikeMult = 1.0, otherwise 0.4. Above-average volume on the breakout bar confirms institutional participation.
— 💪 Momentum confirmation (20%) : RSI(14) > 50 for bullish (or < 50 for bearish) = 1.0, otherwise 0.4.
Classification: Strong (≥ 65), Medium (35–65), Weak (< 35). The strength is displayed on the breakout label and in the dashboard.
4️⃣ Directional probability scoring (0–100) while inside channel.
Before the breakout occurs, the indicator provides a real-time directional score:
— 📐 Channel slope bias (35%) : midline slope normalized by ATR — upward-sloping channels bias bullish, downward bias bearish
— 📊 RSI bias (35%) : (RSI − 50) / 50 — momentum direction
— 📍 Position in channel (30%) : (close − lower) / width — price near upper boundary biases bullish, near lower biases bearish
Score > 60% = bullish lean, < 40% = bearish lean, 40–60 = neutral. Displayed in the dashboard as "Bull Prob" — gives you a heads-up before the breakout direction is confirmed.
5️⃣ Measured-move TP/SL with trailing to breakeven.
On breakout:
— Target = breakout boundary + channel maximum width (the classic measured-move projection)
— TP1 = entry + fullMove / 3
— TP2 = entry + fullMove × 2/3
— TP3 = entry + fullMove (full measured move)
— SL = opposite channel boundary ± ATR padding (configurable, default 0)
After TP1 is hit, the SL moves to breakeven (entry price) — the entry label updates to show "(SL → BE)" and the original SL label dims. Trade stays open until TP3 (full measured move) or SL is reached. TP/SL labels show percentage distance from entry and update with ✓ / ✗ markers on hit. SL has priority on same-bar conflicts (SL checked before TPs).
6️⃣ Win/loss tracking with historical statistics.
The indicator tracks: total patterns detected, bull/bear breakout counts, wins (TP1 hit before SL), losses (SL hit before TP1), and win rate — all displayed in the dashboard. Two display modes: "All" (full history of all channels and trades) or "Last Only" (clean chart showing only the most recent pattern + trade, automatically cleaned up when a new pattern is detected).
7️⃣ Channel visualization with breakout color shift.
Before breakout: neutral channel lines (configurable color, default yellow) with optional fill. On bullish breakout: lines and fill shift to green. On bearish breakout: lines shift to red. Channel timeout (max width bars with no breakout) resets the scanner to look for new patterns.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Pivot detection: ta.pivothigh/ta.pivotlow with configurable lookback. Pivots stored in arrays (up to 60 recent, capped).
Step 2 — Boundary-fit scan: On new pivot or every 10 bars (if no active channel and no open trade): test all pairs of pivot highs for upper boundary, all pairs of pivot lows for lower boundary. Select best-fit lines by maximum touches.
Step 3 — Channel validation: Convergence rate ≥ minimum, width within range, volume contraction passes, price is inside, no inversion → channel activated.
Step 4 — Inside-channel monitoring: Directional probability score updated each bar. Channel lines extend. Background optional.
Step 5 — Breakout detection: Close beyond boundary + bar confirmed → 5-factor strength scoring → signal + TP/SL placement → channel lines recolored.
Step 6 — Trade tracking: TP1/TP2/TP3 and SL hit detection with SL priority. TP1 hit → trailing SL to breakeven. TP3 or SL → trade closed, channel reset, scanner resumes.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — it scans for converging channels automatically
2. Yellow channel lines appear when a valid pattern is detected
3. Dashboard shows "Active" + "Bull Prob" percentage
4. On breakout → "Long"/"Short" label + Entry/SL/TP1–TP3 lines appear
5. TP1 hit → SL moves to breakeven. TP3 → trade complete.
👁️ Reading the chart:
— 🟡 Channel lines = active converging pattern (pre-breakout)
— 🟢 Channel turns green = confirmed bullish breakout
— 🔴 Channel turns red = confirmed bearish breakout
— 🟢 "Long" / 🔴 "Short" label = confirmed breakout signal with strength
— 🔵 Blue line = entry, 🔴 red = SL, 🟢 green dashed = TP1/TP2/TP3
— ✓ on TP labels = target hit, ✗ on SL = stopped out
📊 Dashboard fields:
— Pattern: Active / Bull Break / Bear Break / Scanning
— Strength: Strong / Medium / Weak (5-factor score)
— Trade: Active / TP1 ✓ (BE) / TP2 ✓ / TP3 ✓ / SL Hit
— Bull Prob: directional probability (0–100%) while inside channel
— R:R (TP1): risk-to-reward ratio
— Touches: upper/lower boundary touch counts
— Vol Contraction: in-channel vs pre-channel volume ratio
— Convergence: narrowing rate percentage
— Patterns / Breaks / Win Rate: cumulative statistics
🔧 Tuning guide:
— No patterns found: decrease Min Touches (2), increase Max Channel Width (150+), decrease Min Convergence (0.01)
— Too many weak patterns: increase Min Touches (3), increase Min Channel Width ATR (0.7+)
— Weak breakouts: increase Volume Spike Mult (1.5+), enable Momentum Confirmation
— SL too tight: increase SL Padding (0.2–0.3 ATR)
— Want clean chart: set Pattern History to "Last Only"
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Pivot Detection Length (default 5): swing lookback
— Min Touches (default 2): pivots per boundary
— Max Channel Width (default 120 bars): lookback limit
— Min Convergence Rate (default 0.02): narrowing threshold
🔍 Filters:
— Volume Spike Mult (default 1.2): breakout bar volume requirement
— Volume Contraction (default On): require declining volume in channel
— Momentum Confirmation (default On): RSI alignment
🛡️ Risk:
— SL Padding (default 0 ATR): buffer beyond opposite boundary
— Label Offset (default 20 bars): right-side level label distance
🔧 Advanced:
— Touch Tolerance (default 0.15 ATR): pivot proximity to trendline
— Max Deviation (default 0.3 ATR): maximum pivot overshoot
— Min Channel Width (default 0.5 ATR): filter out thin channels
📐 Channel Lines:
— Show Channel Fill (default On), color and width configurable
🔔 Alerts
— 🟢 BUY / 🔴 SELL — breakout with strength, entry, SL, TP1–TP3
— 🟡 PATTERN DETECTED — new channel found
— 🎯 TP1 / TP2 / 🏆 TP3 HIT — trade progress
— 🛑 SL HIT — stopped out
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All breakout signals require barstate.isconfirmed. Channel detection runs on confirmed pivots (equal left/right lookback). The boundary-fit algorithm selects the best trendlines from historical pivots — the resulting lines are objective and reproducible.
— 📐 The boundary-fit algorithm tests all valid pivot pairs (up to 15 per side) and selects the combination with the most touches that satisfies the deviation constraint. This is an exhaustive search, not a linear regression — it produces the tightest-fitting boundary lines possible from the data.
— ⚖️ The measured-move target (channel width projected from breakout) is the classic technical analysis projection for converging patterns. TP1/TP2/TP3 divide this move into thirds: TP1 = 33%, TP2 = 67%, TP3 = 100% of the projected move.
— 📊 Volume contraction compares average volume inside the channel vs before the channel over the same number of bars. A ratio below 85% confirms genuine volatility compression.
— 🔒 Once a breakout fires, the trade stays open until TP3 or SL is reached — there is no intermediate invalidation. The channel remains active while the trade is open. Channels without a breakout timeout after the max channel width in bars.
— 📏 SL priority: on a bar where both SL and TP are touched, SL is checked first . After TP1, SL moves to breakeven (entry price).
— 🛠️ This is a pattern detection and breakout scoring tool , not an automated trading bot. It identifies converging channels, scores breakouts, and sets measured-move targets — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume features auto-adapt to instruments without volume data. Indicator

StealthTrail SuperTrend ML Pro [WillyAlgoTrader]🤖 StealthTrail SuperTrend ML Pro is an overlay indicator that builds on the adaptive SuperTrend core from StealthTrail and adds three layers of intelligence: an instrument profiling engine that classifies the market into Trending, Ranging, or Volatile regimes and auto-tunes all SuperTrend parameters accordingly; a 13-feature machine learning scoring system that evaluates every candidate signal on momentum, trend, volatility, structure, volume, HTF alignment, divergence, session quality, and regime context — producing a 0–100 confidence score; and a self-learning mechanism that tracks signal outcomes over time and dynamically adjusts the confidence gate to optimize signal quality. The result is a SuperTrend that configures itself, scores its own signals, and learns from its results.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A standard SuperTrend has fixed parameters that work well in one market regime and fail in another. Manually tuning ATR length, multiplier, and filters for each instrument and timeframe is time-consuming and becomes outdated when conditions change.
This indicator solves the problem through a three-layer intelligence stack:
Layer 1 — Regime classification → Auto-tuning: The instrument profiler continuously measures efficiency ratio (trend strength), autocorrelation (serial dependence), volatility clustering, and normalized volatility — classifying the market into TRENDING, RANGING, or VOLATILE. Each regime produces different optimal SuperTrend parameters. The auto-tuner interpolates ATR length, multiplier, cushion, cooldown, and RSI threshold using regime-weighted blending — so the SuperTrend self-configures for current conditions.
Layer 2 — ML signal scoring: Even with auto-tuned parameters, not every SuperTrend flip is a good trade. The 13-feature ML engine evaluates each flip against momentum, volume, trend efficiency, volatility shock, band distance, MACD, price structure, regime confidence, MTF alignment, ADX strength, RSI divergence, volume profile zone, and session quality. Each feature is normalized to 0–100, weighted, passed through a sigmoid function, and combined into a single confidence score. Signals below the confidence gate are rejected — they pass the classic SuperTrend logic but fail the multi-dimensional quality check.
Layer 3 — Self-learning gate: The ML confidence gate itself adapts over time. The system tracks each signal's outcome (win/loss evaluated after N bars using the ATR at entry for fair comparison). When the win rate exceeds 70%, the gate lowers (allowing more signals). When it drops below 50%, the gate raises (becoming stricter). A decay factor prevents old signals from dominating. This creates a feedback loop: the indicator learns which confidence level produces profitable signals on this specific instrument and timeframe.
Without auto-tuning, the SuperTrend uses static parameters. Without ML scoring, good and bad flips are treated equally. Without self-learning, the confidence gate is a fixed guess. Each layer eliminates a specific category of bad signals that the previous layer can't catch.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Instrument profiling and regime classification.
The profiler computes four metrics over a configurable lookback (default 100 bars):
— 📐 Efficiency Ratio : ER = |close − close | / sum(|close − close |, N). Measures net directional movement vs total path. ER → 1.0 = pure trend, ER → 0.0 = pure chop.
— 🔄 Autocorrelation : correlation between return and return over a sliding window. High positive autocorrelation = trending persistence. Near-zero = random. Negative = mean-reverting.
— 📏 Volatility Clustering : ratio of short-term ATR (20 bars) to long-term ATR (lookback). Values > 1.0 indicate a volatility spike (breakout or crash). Values < 1.0 indicate compression.
— 📈 Normalized Volatility : ATR / close × 100. Measures absolute volatility as percentage of price — allows cross-instrument comparison.
These are smoothed with EMA and combined into three regime scores:
— trendScore = ER × regimeSensitivity
— rangeScore = (1 − ER) × (1 − |autocorrelation|) × regimeSensitivity
— volatScore = clamp(volClustering − 1, 0, 2) × regimeSensitivity
The highest score determines the regime: TRENDING, RANGING, or VOLATILE. Regime confidence = highest_score / total_scores × 100%.
2️⃣ Regime-weighted auto-tuning (6 parameters).
Each SuperTrend parameter is computed as a weighted blend of regime-optimal values:
effectiveParam = wT × trendOptimal + wR × rangeOptimal + wV × volatileOptimal
Where wT, wR, wV are the normalized regime weights. The parameters and their regime-optimal ranges:
— ATR Length: Trending=10, Ranging=16, Volatile=21 (further scaled by normalized volatility)
— Base Multiplier: Trending=2.0, Ranging=3.2, Volatile=3.8 (scaled by normalized vol)
— Flip Cushion: Trending=0.05, Ranging=0.25, Volatile=0.15
— Signal Cooldown: Trending=2, Ranging=5, Volatile=3
— RSI Threshold: Trending=40, Ranging=52, Volatile=45
— RSI Length: derived as ATR Length × 0.9
— Adaptive Smoothing: ATR Length × 4.0
This means in a trending regime, the SuperTrend uses shorter ATR, lower multiplier (tighter bands), minimal cushion, and permissive RSI — catching trends early. In a ranging regime: longer ATR, wider multiplier, large cushion, strict RSI — avoiding chop. In volatile conditions: intermediate settings with wider bands to accommodate spikes.
3️⃣ 13-feature ML scoring engine.
Each feature is normalized to 0–100, multiplied by its weight, summed, normalized by total weight, and passed through a sigmoid function to produce the final 0–100 confidence score.
Features and their weights:
— 💪 F1: Momentum (RSI alignment with trend) — w=0.15
— 📈 F2: Volume Surge (volume / SMA ratio) — w=0.08
— 📐 F3: Trend Efficiency (ER × 100) — w=0.15
— ⚡ F4: Volatility Shock (inverted vol clustering) — w=−0.08 (negative = penalizes vol spikes)
— 📏 F5: Band Distance (sigmoid of close-to-band ATR distance) — w=0.10
— 📊 F6: MACD (normalized histogram vs ATR) — w=0.08
— 🏗️ F7: Price Structure (HH/HL for bull, LL/LH for bear over 10 bars) — w=0.08
— 🧠 F8: Regime Confidence (% confidence in current regime) — w=0.04
— 🌐 F9: MTF Confluence (aligned with HTF = 100, not = 0) — w=0.12
— 💪 F10: ADX Strength (ADX × 2.5, capped at 100) — w=0.10
— 🔀 F11: RSI Divergence (aligned div = 100, counter div = 10) — w=0.08
— 📊 F12: Volume Profile Zone (proximity to highest-volume bar) — w=0.06
— 🕐 F13: Session Quality (hour-based scoring for optimal trading sessions) — w=0.04
The raw weighted sum is normalized, then passed through: mlScore = 100 / (1 + exp(−0.08 × (normalizedScore − 50))). This sigmoid compresses extreme values and centers the output around 50.
All 13 weights plus the bias term are user-configurable — you can adjust how much each factor contributes. Negative weights penalize a factor (e.g., W4 = −0.08 means high volatility shock reduces the score).
4️⃣ Self-learning confidence gate.
The system maintains 5 pending signal slots. Each stores the entry price, direction, bar index, and ATR at entry. After the evaluation horizon (default 15 bars), the outcome is assessed:
win = (close − entryPrice) × direction > 0.5 × entryATR (profitable by at least half an ATR, using the ATR at entry time — not current ATR — for fair comparison)
A decay factor (0.98) is applied to historical totals before adding new results, preventing stale data from dominating. When total tracked signals ≥ 8:
— Win rate > 70% → gate decreases by 1.5 (more permissive)
— Win rate < 50% → gate increases by 1.5 (more restrictive)
— Gate is clamped to
The dashboard shows the current gate value, whether it's auto-adjusted, and the tracked win rate with sample size.
5️⃣ Multi-timeframe confluence with auto-HTF selection.
The indicator automatically selects the appropriate higher timeframe based on your current TF: 1M→15M, 5M→30M, 15M→1H, 1H→4H, 4H→D, D→W. Or you can manually specify the HTF.
Three strictness levels:
— Loose: MTF misalignment adds negative ML score but doesn't block
— Moderate: MTF misalignment reduces signal quality
— Strict: MTF misalignment hard-blocks the signal entirely
HTF trend is determined by EMA(20) vs EMA(50) on the higher timeframe.
6️⃣ Adaptive SuperTrend core (from StealthTrail).
The band calculation uses pre-computed interpolated ATR values (ATR bank at 9 fixed periods with lerp interpolation) for smooth adaptation to any auto-tuned ATR length. Same mechanics as StealthTrail: adaptive multiplier (ATR / SMA ratio), band ratcheting, flip cushion, and cooldown — but now all parameters are regime-driven.
7️⃣ Three-mode trailing TP/SL system.
Three SL modes: ATR (entry ± mult × ATR), Band (SuperTrend band as SL), Fixed % (percentage from entry).
Three trailing modes:
— ATR : trail at fixed ATR distance from price — simple, consistent
— Band : use the SuperTrend band itself as trailing stop — structurally anchored
— ATR → Band (hybrid) : start with tight ATR trail, switch to band when it catches up — best of both
The trail only ratchets in the profit direction (never moves away from price). TP1/TP2/TP3 hit markers (✓) appear on the chart. On TP3 or SL hit, the trade closes and lines are removed.
8️⃣ RSI divergence detection.
Scans for bullish divergence (price lower low, RSI higher low, RSI < 40) and bearish divergence (price higher high, RSI lower high, RSI > 60). Divergences aligned with the signal direction boost the ML score (F11 = 100). Counter-divergences penalize it (F11 = 10). Optional visualization as dots on the chart.
9️⃣ Volume profile zone proximity.
Tracks the highest-volume bar in the last 50 bars. Proximity to this bar's price level is scored: within 1.5× ATR = 100 (near institutional activity), further = proportionally lower. Signals near high-volume zones tend to have more follow-through.
🔟 Session quality scoring.
For intraday timeframes, each hour receives a quality score based on typical institutional activity: London/NY overlap (13–17 UTC) = 100, European session (8–12) = 80, US afternoon (18–20) = 70, Asian session (0–7) = 30. An optional kill zone filter suppresses all signals during specified hours.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Instrument profiling: ER, autocorrelation, vol clustering, normalized vol → EMA-smoothed → regime classification (TRENDING / RANGING / VOLATILE) with confidence %.
Step 2 — Auto-tuning: Regime weights blend optimal parameters for ATR length, multiplier, cushion, cooldown, RSI threshold/length.
Step 3 — SuperTrend calculation: Interpolated ATR from pre-computed bank → adaptive multiplier (ATR/SMA ratio) → upper/lower bands → ratcheting → flip detection with cushion + cooldown.
Step 4 — Classic filters: Momentum (RSI), volume, session, MTF hard-block (if strict).
Step 5 — ML feature extraction: 13 features normalized to 0–100 from current market state.
Step 6 — ML scoring: Weighted sum → weight normalization → sigmoid → 0–100 confidence score.
Step 7 — Signal decision: Classic filters pass AND (ML disabled OR mlScore ≥ gate) → confirmed signal.
Step 8 — Self-learning: Signal stored in pending slot → evaluated after horizon bars → win rate updated → gate adjusted.
Step 9 — TP/SL placement: SL from band/ATR/fixed% → TPs as ATR multiples → trailing stop ratchets per mode.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — Auto-Tune is ON by default, parameters self-configure
2. The SuperTrend band and Long/Short labels appear
3. Dashboard shows: trend, strength, regime, ML score, gate, win rate, TP/SL status
4. Enable ML Filter for quality scoring (off by default — enable after reviewing signal quality)
5. Self-Learning auto-adjusts the gate over time
👁️ Reading the chart:
— 🟢 Green band + "Long" label = confirmed bullish signal
— 🔴 Red band + "Short" label = confirmed bearish signal
— ⚫ Gray dot = classic filter blocked the flip
— 🟡 Yellow triangle = ML rejected the signal (score below gate)
— 🟢 Green dot below bar = bullish RSI divergence
— 🔴 Red dot above bar = bearish RSI divergence
— 📈 Regime badge = current market classification (📈 TRENDING / 📊 RANGING / ⚡ VOLATILE)
— 🟢 Green dashed = TP1/TP2/TP3, 🔴 Red dashed = SL, 🔵 Blue dotted = entry
— "TP1 ✓" / "SL ✗" labels = outcome markers
📊 Dashboard sections:
— Main: trend, signal, strength, ADX, HTF alignment
— 🤖 ML Engine: ML score, confidence gate (fixed or auto), win rate with sample size
— 🎯 Position: status (LONG/SHORT/FLAT), entry, SL (with trail mode icon), TP levels (✓ for hit), R:R ratio
— 🧠 Regime: classification + confidence %
🔧 Tuning guide:
— Start simple: Auto-Tune ON, ML OFF — let the regime engine handle parameters
— Add ML: Enable ML Filter after 50+ signals to see which score level produces winners
— Enable Self-Learning: after 100+ bars of ML being active — let the gate auto-calibrate
— Adjust weights: if you know your market (e.g., volume is unreliable on forex → set W2 to 0)
— Strict MTF: for higher-timeframe alignment — reduces signals, increases quality
— Trail Mode: Band for trend-following, ATR for scalping, ATR→Band for hybrid
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Auto-Tune (default On): regime-driven parameter self-configuration
— ATR Length / Base Multiplier : manual overrides when auto-tune is off
🧠 Adaptive Engine:
— Profiling Lookback (default 100): bars for regime classification
— Regime Sensitivity (default 1.0): scaling factor for regime scores
📐 Multi-Timeframe:
— MTF Confluence (default On): Auto/Manual HTF selection
— Strictness (default Moderate): Loose / Moderate / Strict
🤖 ML Signal Filter:
— Enable ML (default Off): activate 13-feature scoring
— Confidence Gate (default 21): minimum ML score to pass
— Self-Learning (default On): auto-adjust gate from tracked outcomes
— Evaluation Horizon (default 15 bars): outcome assessment window
— 13 individual weights + bias : fully configurable feature importance
🔍 Filters:
— Flip Cushion, Cooldown, RSI Momentum, Volume, Session Kill Zone
🎯 TP/SL:
— SL Mode (default Band): ATR / Band / Fixed %
— Trail Mode (default Band): ATR / Band / ATR → Band
— TP Levels (1–3): ATR multipliers (default 1.5 / 2.5 / 4.0)
🔔 Alerts
— 🟢 LONG / 🔴 SHORT — ticker, price, TF, band, ML score, ADX, HTF, SL, TP1, regime
— 🎯 TP1 / TP2 / TP3 HIT — trade progress
— 🛑 SL HIT — stopped out
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. The confirmed trend direction is stored separately from the real-time calculation — signals only fire on closed bars. HTF data uses lookahead_off. A warmup period (max of profiling lookback and 55 bars) prevents signals during insufficient data.
— 🤖 The ML scoring is not machine learning in the neural network sense . It's a weighted linear model with sigmoid activation — a logistic regression analog. The 13 features are hand-crafted from market microstructure, and the weights are configurable by the user. There is no gradient descent, backpropagation, or training phase. The "self-learning" adjusts only the confidence gate threshold, not the feature weights.
— 📐 Auto-tuning produces different parameters on every bar as the regime shifts. The ATR length and multiplier change continuously — this is by design. If you prefer fixed parameters, disable Auto-Tune.
— ⚖️ The self-learning gate requires at least 8 tracked signals before it begins adjusting. With the decay factor (0.98), the effective sample is weighted toward recent signals. The gate moves slowly (±1.5 per adjustment) and is clamped to .
— 📊 Win rate evaluation uses ATR at entry time , not current ATR. A signal is a "win" if price moves > 0.5× entry ATR in the signal direction within the evaluation horizon. This prevents volatile periods from inflating win counts.
— 🔄 The pre-computed ATR bank (9 fixed periods with lerp interpolation) is a performance optimization that allows smooth ATR adaptation to any auto-tuned length without calling ta.atr() dynamically — which Pine Script doesn't support with variable-length arguments.
— 📏 Volume Profile Zone tracks the single highest-volume bar in the last 50 bars, not a full volume profile. It decays after 50 bars with no new volume peak.
— 🕐 Session scoring uses UTC-based hours. On daily or higher timeframes, session quality defaults to 50 (neutral) as intraday session distinctions don't apply.
— 🛠️ This is a signal scoring and analysis tool , not an automated trading bot. It classifies regimes, scores signals, tracks outcomes, and manages TP/SL — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume features auto-adapt to instruments without volume data. Indicator

Adaptive Ichimoku Nexus [WillyAlgoTrader]☁️ Adaptive Ichimoku Nexus — a modern approach to the legendary all-time indicator Ichimoku Kinko Hyo. This overlay indicator replaces the fixed periods of the classic Ichimoku system with a volatility-adaptive engine that dynamically scales Tenkan-Sen, Kijun-Sen, and Senkou Span B lookback periods based on current market conditions. Every TK cross signal is scored by an 8-factor confluence engine (0–100) that combines all five Ichimoku dimensions with volume, momentum pulse, and momentum acceleration. The indicator also includes a dedicated Kumo breakout engine with retest detection, three Ichimoku-anchored SL modes with R:R-based TP levels, and a multi-timeframe Ichimoku alignment panel — creating a complete trading system built entirely on Ichimoku principles enhanced with adaptive intelligence.
Ichimoku Kinko Hyo was designed in the 1930s with fixed periods (9/26/52) calibrated for the Japanese trading week. These periods remain the default worldwide, but modern markets are faster, more volatile, and trade 24/7. A fixed 26-period Kijun-Sen responds identically whether the market is in a tight range or a momentum breakout — producing late signals in trends and whipsaws in consolidation.
This indicator preserves the complete Ichimoku structure — all five lines, the cloud, and the displacement — while making the periods responsive to current volatility. In high-volatility environments, all three Donchian-based periods shorten → the Tenkan reacts faster, the Kijun adapts sooner, the cloud thins and pivots quicker. In low-volatility consolidation, the periods lengthen → noise is filtered, fewer false TK crosses, thicker cloud provides stronger S/R. The entire Ichimoku system breathes with the market.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Classic Ichimoku already integrates five components into one system: Tenkan-Sen (momentum), Kijun-Sen (trend), Senkou Span A/B (future S/R), and Chikou Span (lagging confirmation). The genius of Ichimoku is that these five dimensions are designed to confirm each other — a "5/5 alignment" is one of the strongest signals in technical analysis.
This indicator enhances the system at three levels:
Level 1 — Adaptive periods: The volatility engine scales all three Donchian-based components (Tenkan, Kijun, Span B) proportionally, preserving the Ichimoku ratios while adapting the speed. This means the relationship between Tenkan and Kijun (the core signal mechanism) stays consistent — they just both become faster or slower together.
Level 2 — Confluence scoring: Instead of manually checking "Is Tenkan above Kijun? Is price above cloud? Is Chikou confirming?" — the 8-factor engine quantifies every Ichimoku dimension plus volume and momentum into a single 0–100 score. A score of 85 means virtually every Ichimoku component plus momentum and volume agrees. A score of 35 means the signal is conflicted — skip it.
Level 3 — Structural TP/SL: The Kumo edge and Kijun-Sen are natural Ichimoku support/resistance levels. Using them as stop-loss anchors (instead of arbitrary ATR multiples) produces structurally meaningful stops that respect the same framework generating the signals.
Level 4 — Momentum Pulse: Classic Ichimoku has no built-in momentum acceleration measure. The Momentum Pulse engine quantifies how fast the TK spread is changing and which direction the future cloud is rotating — capturing the urgency behind each signal.
Without adaptive periods, the system is rigid. Without scoring, you must manually assess 5+ factors. Without structural SL, your risk management ignores Ichimoku's own S/R levels. Without the Momentum Pulse, you can't distinguish between a strong and a fading TK cross. Each layer adds a dimension that classic Ichimoku lacks.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Volatility-adaptive Ichimoku periods.
When Adaptive mode is on, each Donchian midline (Tenkan, Kijun, Span B) uses a volatility-scaled period:
adaptedPeriod = basePeriod × (1 + strength × (1 − 2 × volRatio))
Where volRatio = (currentATR − lowestATR) / (highestATR − lowestATR) over the volatility lookback (default 50 bars), normalized to 0–1.
When volRatio → 1 (high volatility): adaptedPeriod = basePeriod × (1 − strength) — periods shorten
When volRatio → 0 (low volatility): adaptedPeriod = basePeriod × (1 + strength) — periods lengthen
The Adapt Strength parameter (default 0.4 = ±40%) controls the range of scaling. With basePeriod=26 and strength=0.4: periods range from 16 (high vol) to 36 (low vol). Each adapted period is clamped to a valid range and fed into the standard Donchian midline formula: (highest(high, period) + lowest(low, period)) / 2.
This means all five Ichimoku lines (Tenkan, Kijun, Senkou A, Senkou B, Chikou) adapt proportionally — the system remains internally consistent. In Classic mode, the standard fixed periods are used unchanged.
2️⃣ 8-factor confluence scoring engine (0–100).
Every bar computes both a bullish and bearish score from 8 factors:
— 📐 Price vs Cloud (20 pts) : above cloud = 20, inside = 8, below = 0 (bull). Symmetric for bear. The cloud is the strongest S/R in Ichimoku.
— ⚡ TK alignment (15 pts) : Tenkan > Kijun = 15 (bull). The core Ichimoku momentum signal.
— 👁️ Chikou confirmation (15 pts) : Chikou Span above price at displaced position = 15 (bull). The lagging confirmation.
— ☁️ Cloud direction (10 pts) : Span A slope > Span B slope = 10 (bull). Future cloud turning bullish indicates trend momentum.
— 📏 Kumo thickness (8 pts) : thick cloud = 8, thin cloud = 2. Thick cloud provides stronger S/R backing.
— 📈 Volume (10 pts) : volume > SMA(20) × 1.2 = 10. Confirms institutional participation.
— 💪 Momentum alignment (12 pts) : Momentum Pulse > 20 = 12, > 0 = 6. Strong momentum behind the signal.
— 🚀 Momentum acceleration (10 pts) : Momentum Pulse rising = 10. Trend is accelerating, not fading.
Max score = 100. Signals require score ≥ Min Confluence Score (default 50). Grades: Strong (≥ 80), Standard (≥ 50), Weak (< 50).
3️⃣ Momentum Pulse engine (−100 to +100).
A composite momentum measure built from three Ichimoku-derived components:
— TK spread normalized by ATR (weight 40): tkSpreadNorm = (Tenkan − Kijun) / ATR. Measures how far apart the momentum and trend lines are relative to volatility.
— TK spread acceleration (weight 100): tkSpreadNorm − tkSpreadNorm . Measures how fast the spread is changing — captures momentum buildup.
— Cloud slope differential (weight 30): (ΔSpanA − ΔSpanB) / ATR over 5 bars. Measures whether the future cloud is rotating bullish or bearish.
Combined: momentumPulse = tkSpread×40 + tkAcceleration×100 + cloudSlope×30, clamped to , smoothed with EMA(5). States: Accelerating (rising + positive), Bull Fading (falling + positive), Bear Accelerating (falling + negative), Bear Fading (rising + negative).
4️⃣ Three Ichimoku-anchored SL modes.
Stop-loss placement uses Ichimoku structure:
— Kumo Edge (default): SL at the nearest cloud boundary (kumoBot for longs, kumoTop for shorts) + ATR buffer. The cloud is Ichimoku's primary S/R — placing the stop here means your stop is at the strongest structural level in the framework.
— Kijun : SL at the Kijun-Sen ± ATR buffer. The Kijun is Ichimoku's equilibrium line — price tends to return to it.
— ATR : SL at entry ± 2× ATR. Pure volatility-based fallback.
TP1/TP2/TP3 are R:R multiples of the risk distance (default 1.5/2.5/4.0). A minimum risk distance of 0.5× ATR is enforced.
5️⃣ Kumo breakout engine with retest detection.
Detects when price closes above the cloud (was below or inside on the previous bar) with volume confirmation:
— kumoBreakUp: close > kumoTop AND previous close ≤ kumoTop AND volume > SMA(20) × breakoutMultiplier
— kumoBreakDown: close < kumoBot AND previous close ≥ kumoBot AND same volume condition
After a breakout, a retest signal fires if within 10 bars, price touches the cloud edge and closes back on the breakout side — confirming the cloud has flipped from resistance to support (or vice versa). Retest signals appear as small circles distinct from the larger diamond breakout markers.
6️⃣ Kijun-Sen S/R zone detection.
When the Kijun-Sen has been flat for 4+ consecutive bars and then starts moving, the flat level is marked as a support/resistance zone (shaded box ± 0.15× ATR). Flat Kijun is a well-known Ichimoku S/R concept — price tends to be attracted to flat Kijun levels. The indicator automates this detection and visualization.
7️⃣ Multi-timeframe Ichimoku alignment panel.
Three configurable timeframes (default 15M/1H/4H) each compute a full Ichimoku state using the classic periods:
— Bull ● : close > cloud AND Tenkan > Kijun
— Bear ● : close < cloud AND Tenkan < Kijun
— Neutral ○ : anything else
The panel shows per-TF alignment plus a summary: ALL BULL ✓ (all 3 TFs bullish), ALL BEAR ✓ (all 3 bearish), or Mixed. All MTF data uses + lookahead_on for non-repainting.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Volatility measurement: ATR(14) is normalized to 0–1 by its position within the recent high-low range over the volatility lookback.
Step 2 — Period adaptation: Each base period (9/26/52) is scaled by the adapt strength and vol ratio. High vol → shorter periods, low vol → longer. Classic mode bypasses this.
Step 3 — Ichimoku calculation: Tenkan = Donchian midline (adapted period). Kijun = Donchian midline (adapted period). Senkou A = avg(Tenkan, Kijun). Senkou B = Donchian midline (adapted period). Chikou = source price. Cloud displaced forward by displacement bars.
Step 4 — Kumo at current bar: Span A and Span B are read at displacement offset to get the current cloud boundaries. Thickness, price position (above/below/inside), and thin-cloud status are computed.
Step 5 — Momentum Pulse: TK spread, spread acceleration (vs 3 bars ago), and cloud slope differential — combined and EMA-smoothed.
Step 6 — Confluence scoring: 8 factors evaluated. Bull and bear scores computed independently.
Step 7 — Signals: TK cross + score threshold + enabled filters (Kumo thickness, volume, Chikou) → confirmed buy/sell. Kumo breakout: cloud boundary cross + volume surge → breakout signal. Retest: cloud edge touch within 10 bars of breakout.
Step 8 — TP/SL: SL from Kumo edge / Kijun / ATR mode. TPs as R:R multiples. TP/SL hits tracked per trade.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — the Ichimoku cloud and lines appear (adaptive by default)
2. "Long 78%" / "Short 65%" labels = TK cross signals with confluence score
3. ☁▲ / ☁▼ diamonds = Kumo breakout signals
4. Entry, SL, TP1–TP3 lines appear on each signal
5. Check the MTF panel for multi-timeframe alignment
👁️ Reading the chart:
— 🔵 Blue line = Tenkan-Sen (conversion, fast)
— 🔴 Pink line = Kijun-Sen (base, slow)
— 🟠 Orange line (displaced back) = Chikou Span
— 🟩🟥 Cloud fill = Kumo (green bullish, red bearish)
— 🟢 "Long XX%" label = confirmed bullish TK cross with score
— 🔴 "Short XX%" label = confirmed bearish TK cross with score
— 💎 Cyan diamond = Kumo breakout (☁▲ up / ☁▼ down)
— ⚫ Small circle = Kumo edge retest
— 🟪 Shaded zone = flat Kijun S/R area
— 🔵 Blue line = entry, 🔴 red = SL, 🟢 green = TP1/TP2/TP3
📊 Dashboard fields:
— Mode: Adaptive / Classic
— Trend: Bullish / Bearish / Neutral (price vs cloud + TK alignment)
— Signal: last signal with bars elapsed
— Score: confluence percentage with color grade
— Momentum: Pulse state + value (Accelerating / Bull Fading / Bear Accel / etc.)
— Cloud: price position (Above / Below / Inside / Thin)
— Trade: TP/SL progress (→ TP1, TP1 ✓ → TP2, TP3 ✓ Closed, SL ✗ Closed)
— MTF: 3-timeframe Ichimoku alignment + summary (ALL BULL / ALL BEAR / Mixed)
— Version
🔧 Tuning guide:
— Too many weak signals: increase Min Score (60–80), enable all filters
— Missing signals: decrease Min Score (30–40), disable Chikou filter
— Adaptive too aggressive: decrease Adapt Strength (0.2–0.3) or increase Volatility Lookback (100+)
— Want classic Ichimoku: switch to Classic mode — pure 9/26/52 with scoring and TP/SL
— Stops too tight: increase SL ATR Buffer (0.7–1.0) or switch to ATR SL mode
— Scalping: Conversion 5, Base 13, Span B 26, Displacement 13, Min Score 40
— Swing: Conversion 12, Base 34, Span B 68, Displacement 34, Min Score 65
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Calculation Mode (default Adaptive): Adaptive / Classic
— Conversion/Base/Span B/Displacement (default 9/26/52/26)
🔄 Adaptive Engine:
— Volatility Lookback (default 50): ATR normalization window
— Adapt Strength (default 0.4): period scaling range (±40%)
🔍 Filters:
— Min Confluence Score (default 50): 0–100 threshold
— Kumo Thickness Filter (default On): suppress in thin cloud
— Volume Filter (default On): auto-disabled on forex
— Chikou Confirmation (default On): require lagging span alignment
🎯 Smart TP/SL:
— SL Mode (default Kumo Edge): Kumo Edge / Kijun / ATR
— SL ATR Buffer (default 0.5): padding beyond SL level
— TP1/TP2/TP3 R:R (default 1.5/2.5/4.0)
💥 Kumo Breakout:
— Breakout Vol Mult (default 1.3): volume surge requirement
— Show Retest Signals (default On): cloud edge retest detection
🔄 Multi-Timeframe:
— TF 1/2/3 (default 15/60/240): configurable timeframes
🔔 Alerts
— 🟢 BUY / 🔴 SELL — TK cross with score, SL, TP1–TP3
— ☁️▲ KUMO BREAK UP / ☁️▼ KUMO BREAK DOWN
— 🎯 TP1 HIT / 🛑 SL HIT
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All TK cross signals and Kumo breakouts require barstate.isconfirmed. MTF data uses + lookahead_on. A warmup period (Span B + displacement, minimum 80 bars) prevents signals during insufficient data.
— ☁️ This preserves the complete Ichimoku structure. All five lines, the cloud, displacement, and Chikou are computed exactly as Ichimoku specifies — the only change is that in Adaptive mode, the three Donchian periods scale with volatility. Switching to Classic mode produces a standard Ichimoku with no modifications.
— 📐 The adaptive engine scales all three periods proportionally using the same vol ratio and strength. The relationship between Tenkan (fast) and Kijun (slow) is preserved — they don't drift independently.
— ⚖️ The confluence score is Ichimoku-native . Six of eight factors (price vs cloud, TK alignment, Chikou, cloud direction, Kumo thickness, momentum) are derived directly from Ichimoku components. Only volume and momentum acceleration are external additions.
— 📊 The Momentum Pulse is not a standalone oscillator — it's derived from TK spread dynamics and cloud rotation, both Ichimoku-native measurements. It quantifies what experienced Ichimoku traders assess visually: "Is this TK cross strong and accelerating, or weak and fading?"
— 🔄 Kumo breakout retest detection uses a 10-bar window after the initial breakout. Retests beyond 10 bars are not tracked.
— 🛠️ This is a signal and analysis tool , not an automated trading bot. It enhances Ichimoku with adaptive periods, scoring, and risk management — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume filter auto-disables on instruments without volume data. Indicator

Precision Sniper [WillyAlgoTrader]🎯 Precision Sniper is an overlay indicator that generates entry signals only when a 10-factor confluence scoring engine reaches a configurable threshold — combining EMA alignment, RSI momentum, MACD direction, VWAP position, volume confirmation, ADX trend strength, DI directional pressure, and higher-timeframe bias into a single composite score (0–10). Every signal comes with automatic TP/SL placement using either ATR-based or structure-based stops, plus a progressive trailing stop system that ratchets the stop to breakeven after TP1 and to TP1 level after TP2.
The core principle: instead of using a single crossover or oscillator reading to trigger a signal, this indicator requires multiple independent market dimensions to agree simultaneously. An EMA crossover alone can produce false signals in choppy markets. RSI confirmation alone can be early or late. Volume alone doesn't tell you direction. But when EMA alignment + RSI momentum + MACD direction + VWAP position + volume + ADX + DI + HTF trend all point the same way — and the composite score exceeds your threshold — the probability of a genuine directional move is significantly higher than any single factor alone.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Each factor in the scoring engine measures a different market dimension:
— EMA Fast/Slow crossover → detects the momentum shift that initiates the signal (trigger)
— EMA Trend → confirms the macro direction (structural filter)
— RSI → confirms momentum is in the non-extreme zone (avoids overbought entries)
— MACD histogram + MACD vs signal → confirms momentum is accelerating, not decelerating (2 factors)
— VWAP position → confirms price is on the right side of institutional fair value
— Volume → confirms market participation (not a low-liquidity wick)
— ADX + DI → confirms the market is trending AND directional pressure aligns (not ranging)
— HTF EMA bias → confirms the higher-timeframe trend agrees with the entry direction
These factors are deliberately orthogonal: EMA alignment can occur without volume, MACD can be bullish without RSI confirming, price can be above VWAP while ADX shows no trend. The scoring engine counts how many factors agree — only when enough dimensions align does the signal pass.
The entry signal feeds into the risk management system: structure-based SL provides a structurally meaningful stop (recent swing low/high), the R:R-based TPs create consistent reward targets, and the progressive trailing stop automatically manages the trade after entry — ratcheting protection as each target is hit. Without the trailing system, a signal that hits TP1 can still reverse to SL for a full loss. With it, after TP1 the worst case is breakeven.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ 10-factor confluence scoring engine (0–10 scale).
Every bar, both a bullish and bearish score are computed from 10 independent factors:
Bullish score calculation:
— 📐 EMA Fast > EMA Slow → +1.0 (short-term momentum is upward)
— 📏 Close > EMA Trend → +1.0 (price is above macro trend)
— 📊 RSI > 50 AND RSI < 75 → +1.0 (momentum is bullish but not overbought)
— 📈 MACD Histogram > 0 → +1.0 (momentum is positive)
— 📈 MACD Line > Signal Line → +1.0 (MACD has bullish crossover)
— ⚖️ Close > VWAP → +1.0 (price above institutional fair value)
— 📊 Volume > SMA(20) × 1.2 → +1.0 (above-average participation)
— 💪 ADX > 20 AND +DI > −DI → +1.0 (trending market with bullish pressure)
— 🌐 HTF EMA Fast > HTF EMA Slow → +1.5 (higher timeframe confirms direction)
— ✅ Close > EMA Fast → +0.5 (price is above the fast MA — minor confirmation)
Maximum bullish score: 10.0. Bearish score uses symmetric conditions (< instead of >, −DI > +DI, etc.). The HTF factor carries 1.5× weight because higher-timeframe alignment is the single strongest predictor of signal quality. The close > EMA Fast factor carries 0.5× because it's partially redundant with the crossover — it adds a minor confirmation that price didn't just touch the crossover but is clearly above it.
A signal fires when: EMA crossover occurs + price is on the correct side of both EMAs + RSI is not extreme + composite score ≥ Min Confluence Score (default 5 out of 10).
2️⃣ Structure-based stop loss with ATR fallback.
When enabled (default on), the stop loss is placed at the most structurally meaningful level:
For long trades:
— structureStop = recent swing low (over configurable lookback, default 10 bars) − 0.2× ATR padding
— atrStop = entry − ATR × SL multiplier
— finalStop = max(structureStop, atrStop) — the HIGHER (tighter) of the two
This "pick the tighter stop" logic ensures the SL is always at a meaningful structural level but never further than the ATR-based maximum. A minimum distance of 0.5× ATR is enforced to prevent unrealistically tight stops when the swing low is very close to entry.
For short trades: symmetric logic with min() instead of max(), swing high + padding.
When structure SL is disabled, the stop uses pure ATR: SL = entry ± ATR × multiplier.
3️⃣ Progressive trailing stop system.
After entry, the stop ratchets progressively as targets are hit:
— Initial state : SL at structure/ATR level
— After TP1 hit : SL moves to entry price (breakeven) — worst case is now 0 loss
— After TP2 hit : SL moves to TP1 level — worst case is now TP1 profit locked
— After TP3 hit : SL moves to TP2 level — TP2 profit locked, runner continues
The trailing stop line updates dynamically on the chart (orange dotted line with label). The SL hit check uses the pre-update trail value to prevent same-bar conflicts: if TP1 and the trail are both touched on the same candle, the TP1 hit processes first, then the trail is checked against its PRE-move value.
This progressive system means that once a trade reaches TP1, it can only end in breakeven or profit — never a loss. After TP2, the minimum outcome is TP1 profit locked.
4️⃣ Four presets with parameter scaling.
Each preset adjusts two key parameters:
— Conservative : min score floor 7/10, SL floor 2.0× ATR — requires strong consensus, wider stop
— Default : uses your manual settings
— Aggressive : min score ceiling 3/10, manual SL — accepts lighter consensus
— Scalping : min score ceiling 4/10, SL ceiling 1.0× ATR — lower bar, tighter stop
The preset modifies the effective score threshold and SL multiplier — the underlying 10 factors don't change, only how many must agree and how wide the stop is.
5️⃣ Volatility regime detection.
The dashboard displays the current volatility regime: volRatio = ATR(14) / SMA(ATR, 42). High (ratio > 1.3) = volatility above average — consider wider stops. Low (ratio < 0.7) = volatility compressed — watch for breakout. Normal = standard conditions. This provides at-a-glance context for how the current environment affects your settings.
6️⃣ EMA ribbon with macro trend overlay.
Three EMAs create a visual trend system:
— EMA Fast (default 9) = short-term momentum direction
— EMA Slow (default 21) = medium-term trend
— EMA Trend (default 55) = macro trend filter (shown as dot-style line)
The fast/slow ribbon fills green when fast > slow (bullish momentum) and red when fast < slow. Signals only fire when the EMA crossover occurs AND price confirms by closing on the correct side of both EMAs.
7️⃣ RSI extreme avoidance.
The signal engine requires RSI to be in a non-extreme zone: bullish signals require RSI > 50 AND < 75 (not overbought). Bearish signals require RSI < 50 AND > 25 (not oversold). This prevents the most common failure mode of momentum-based entries: buying into an already overbought market or selling into an oversold bounce.
8️⃣ Direction lock — one signal per trend leg.
After a buy signal fires, the next signal can only be a sell (and vice versa). This prevents signal clustering during strong trends where the confluence score might cross the threshold multiple times. If both buy and sell trigger on the same bar (rare edge case), buy takes priority (mutual exclusion).
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Core indicators: EMA Fast(9), EMA Slow(21), EMA Trend(55), RSI(13), MACD(12/26/9), VWAP(hlc3), Volume SMA(20), ADX/DI(14), HTF EMAs via request.security with + lookahead_on.
Step 2 — Confluence scoring: 10 factors evaluated independently for both bullish and bearish directions. Each factor adds its weight (1.0, 1.5, or 0.5) to the composite score. Max score = 10.0 per direction.
Step 3 — Signal trigger: EMA crossover (fast crosses slow) + price above/below both EMAs + RSI not extreme + composite score ≥ threshold + direction lock → confirmed signal on barstate.isconfirmed.
Step 4 — SL calculation: Structure mode: recent swing low/high ± 0.2× ATR padding, then pick the tighter of structure vs ATR stop. Minimum distance enforced at 0.5× ATR. Risk = |entry − SL|.
Step 5 — TP placement: TP1 = entry ± risk × tp1RR, TP2 = entry ± risk × tp2RR, TP3 = entry ± risk × tp3RR.
Step 6 — Trade monitoring: Each bar: check TP1/TP2/TP3 hits → ratchet trailing stop. Check SL hit against pre-ratchet trail value. Update visual lines and labels.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — the EMA ribbon appears showing current trend
2. Select a preset (Conservative for swing, Scalping for 1–5M)
3. Wait for a "Long" or "Short" label — check the dashboard for score
4. Entry, SL, TP1, TP2, TP3 lines appear automatically
5. After TP1 → orange trailing stop line moves to breakeven
6. After TP2 → trail moves to TP1 level. After TP3 → trail moves to TP2.
👁️ Reading the chart:
— 🟢 Green EMA ribbon fill = bullish momentum (fast > slow)
— 🔴 Red EMA ribbon fill = bearish momentum
— ⚫ Dot-style line = EMA Trend (55) — macro direction filter
— 🟢 "Long" label below bar = confirmed buy signal
— 🔴 "Short" label above bar = confirmed sell signal
— 🔵 Blue solid line = entry price
— 🔴 Red solid line = stop loss
— 🟢 Green dashed lines = TP1, TP2, TP3
— 🟠 Orange dotted line = trailing stop (updates after each TP hit)
📊 Dashboard fields:
— Trend: current EMA alignment (Bullish / Bearish / Neutral)
— Score: confluence score (e.g., "7.5 / 10")
— Status: trade state (Active / TP1 ✓ — Trail / TP2 ✓ — Trail / No Trade)
— HTF Bias: higher-timeframe trend (Bullish / Bearish / Neutral)
— Volatility: regime (High / Normal / Low)
— RSI, ADX: current values
— Timeframe, preset, version
🔧 Tuning guide:
— Too many signals: increase Min Score (6–8), use Conservative preset, set HTF filter to a higher TF
— Too few signals: decrease Min Score (3–4), use Aggressive preset
— Stops too tight: increase SL ATR Multiplier (2.0–2.5), increase Swing Lookback (12–20)
— Stops too wide: decrease SL ATR Multiplier (1.0), enable Structure-Based SL
— Scalping 1–5M: Scalping preset, EMA Fast 5/Slow 13/Trend 34, TP1 0.75/TP2 1.5/TP3 2.5
— Swing 4H–1D: Conservative preset, EMA Fast 12/Slow 26/Trend 100, TP3 5.0+
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— HTF Trend Filter (default current TF): higher timeframe for bias. Leave empty = disabled.
— Preset (default Default): Conservative / Default / Aggressive / Scalping
🎯 Entry Engine:
— EMA Fast (default 9) / Slow (default 21) / Trend (default 55)
— Min Confluence Score (default 5): minimum score out of 10 to trigger signal
— RSI Length (default 13)
🛡️ Risk Management:
— ATR Length (default 14) / SL ATR Multiplier (default 1.5)
— TP1/TP2/TP3 R:R (default 1.0 / 2.0 / 3.0)
— Trailing Stop (default On): ratchets SL to BE after TP1, to TP1 after TP2
— Structure-Based SL (default On): recent swing low/high as stop anchor
— Swing Lookback (default 10): bars for structure SL detection
🎨 Visual:
— EMA ribbon, TP/SL lines, trailing stop line, background tint (all toggleable)
— Configurable signal label size (Tiny–Huge)
— Auto / Dark / Light theme
🔔 Alerts
— 🟢 BUY / 🔴 SELL — ticker, price, SL, TP1, TP2, TP3, score, timeframe
— 🎯 TP1 HIT / TP2 HIT / 🏆 TP3 HIT — trade progress
— 🛑 SL HIT — stopped out
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. HTF data uses + lookahead_on for non-repainting values. TP/SL hits are checked only on bars after the entry bar (canCheckTPSL = bar_index > entryBar). A warmup period (max of EMA Trend length and 50 bars) prevents signals during insufficient data.
— 📐 The confluence score is not a win-rate predictor . A score of 8/10 means eight market dimensions agree on direction — it measures consensus quality. Higher scores correlate with stronger setups but do not guarantee outcomes.
— ⚖️ Structure-based SL picks the tighter of structure vs ATR stop — not the wider one. This means your actual risk per trade may be less than SL ATR Multiplier × ATR. Check the SL label on each trade for the actual stop level.
— 🔒 The trailing stop uses pre-update values for SL hit detection. If TP1 is hit and the trail moves to breakeven on the same bar, the SL check uses the old trail value — preventing false same-bar stop-outs.
— 📊 VWAP factor auto-falls back to close on instruments where ta.vwap returns na. Volume factor auto-passes (returns true) on instruments without volume data.
— 🔄 If buy and sell trigger simultaneously (extremely rare edge case), buy takes priority and the sell is suppressed.
— 🛠️ This is a signal and risk management tool , not an automated trading bot. It scores confluence, generates signals, places targets, and trails stops — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. All factors auto-adapt to available data. Indicator

Smart Breakout Targets [WillyAlgoTrader]📡 Smart Breakout Targets is an overlay indicator that detects volatility squeezes using a dual-engine system (Bollinger Band Width compression + ATR contraction), builds adaptive consolidation range boxes, waits for a confirmed impulse candle to break the range, and then automatically places entry, stop-loss, and three take-profit levels based on the breakout's risk distance — with full trade lifecycle tracking that monitors TP/SL hits and marks the outcome directly on the chart.
The core concept: volatility compression precedes expansion. When price coils into a tight range, a breakout from that range tends to produce a directional move proportional to how compressed the range was. This indicator automates the entire workflow: detect the compression, define the range, confirm the breakout, calculate the targets, track the outcome.
Most breakout indicators on PulseWire use a single volatility measure (typically Bollinger Band Width or Keltner Channel squeeze) to detect compression. A single measure can produce false positives — BB Width can narrow during a one-directional drift without true consolidation, or ATR can compress during a holiday session without tradeable structure. This indicator requires both engines to agree: BB Width must be below its threshold AND ATR must be below its compression ratio simultaneously. This dual confirmation eliminates the majority of false squeezes.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A squeeze detector alone tells you volatility is low — but it doesn't give you a range to trade against. A range box alone tells you where support and resistance are — but it doesn't confirm whether the breakout is genuine. An impulse filter alone measures candle quality — but without knowing the range boundaries, it doesn't know what's being broken. And TP/SL levels without range context have no structural anchor.
This indicator connects them into a complete breakout workflow:
BB Width squeeze + ATR compression → Range duration check → Adaptive Donchian range → Resistance/Support zones → Impulse candle confirmation → Filter gate (volume + HTF) → Entry at breakout → SL at opposite boundary + ATR buffer → TP1/TP2/TP3 as R:R multiples → Trade lifecycle tracking → Outcome labeling
The dual squeeze engine defines WHEN compression exists. The minimum squeeze duration confirms the consolidation is established, not momentary. The adaptive Donchian tracks the range boundaries DURING the squeeze (expanding with each new high/low). The impulse filter confirms the breakout candle has sufficient body size relative to ATR. The volume and HTF filters add optional quality gates. And the R:R-based targets anchor to the actual risk distance (entry to opposite range boundary), not to arbitrary ATR multiples.
Removing the dual engine reintroduces single-measure false squeezes. Removing the minimum duration allows momentary vol dips to create ranges. Removing the impulse filter lets weak candles trigger breakouts. Removing the ATR-buffered SL places stops too close to range boundaries. Each component solves a specific failure mode.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Dual-engine squeeze detection (BB Width + ATR compression).
Two independent volatility measures must agree before a squeeze is confirmed:
Engine 1 — Bollinger Band Width:
bbWidth = (upperBB − lowerBB) / basisBB, where upperBB = SMA(close, len) + mult × stdev(close, len). The BB Width is compared to its own SMA: bbSqueeze = bbWidth < SMA(bbWidth, len) × squeezeThreshold (default 0.6). This detects when the bands are significantly tighter than their recent average.
Engine 2 — ATR Compression:
atrVal = ATR(len/2), atrSma = SMA(ATR, len). Compression = atrVal < atrSma × atrCompressRatio (default 0.75). This detects when absolute volatility (measured by ATR) has contracted below its recent average. The ATR period is half the squeeze length for faster response to volatility changes.
Combined: isSqueeze = bbSqueeze AND atrCompress. Both engines must agree simultaneously. BB Width can narrow during a drift (price moving slowly but directionally) while ATR remains normal — the ATR engine blocks this false squeeze. Conversely, ATR can compress during a holiday while BB Width is normal — the BB engine blocks this. Dual agreement ensures genuine consolidation.
2️⃣ Minimum squeeze duration filter.
A squeeze counter tracks consecutive bars where both engines agree. The range box is only created when the squeeze has lasted at least minSqueezeBars (default 5). This prevents momentary dips in volatility (single-bar BB Width contraction during a large candle, for example) from creating spurious ranges. The counter resets to zero when either engine disagrees.
3️⃣ Adaptive Donchian range boundaries.
When a squeeze begins, the indicator initializes squeezeHigh and squeezeLow from the first bar. On each subsequent bar during the squeeze, the boundaries expand: squeezeHigh = max(squeezeHigh, high), squeezeLow = min(squeezeLow, low). This creates an adaptive Donchian channel that captures the full consolidation range — not just a fixed lookback but the exact range from squeeze start to squeeze end.
If the resulting range exceeds 6× ATR (extreme outlier), it's clamped to 3× ATR above and below the range center. This prevents excessively wide ranges from producing unreachable targets.
The range box also includes a resistance zone (top half-ATR, red-tinted) and a support zone (bottom half-ATR, green-tinted), highlighting the areas where price is most likely to be rejected on a false breakout.
4️⃣ Impulse candle breakout confirmation.
A breakout requires more than just closing beyond the range — the breakout candle must be an impulse candle:
Bullish breakout: close > rangeTop AND close > open AND |close − open| > ATR × impulseMultiplier (default 0.8)
Bearish breakout: close < rangeBottom AND close < open AND |close − open| > ATR × impulseMultiplier
This body size filter ensures the breakout candle has genuine momentum behind it — not a thin wick that barely clips the boundary. The impulse multiplier is configurable: lower values (0.3–0.5) accept weaker candles, higher values (1.0–1.5) require strong conviction bars.
5️⃣ R:R-based TP/SL with ATR-buffered stop.
On breakout, the indicator calculates:
— Entry = close of breakout candle
— Stop Loss = opposite range boundary ± ATR × slBuffer (default 0.5). For a bullish breakout: SL = rangeBottom − ATR × 0.5. The buffer prevents the stop from sitting exactly at the range boundary where it would be clipped by a retest wick.
— Risk distance = |entry − SL|
— TP1 = entry ± risk × tp1RR (default 1.0 = 1:1 R:R)
— TP2 = entry ± risk × tp2RR (default 2.0 = 1:2 R:R)
— TP3 = entry ± risk × tp3RR (default 3.0 = 1:3 R:R)
All levels are drawn as extending lines with price labels, plus linefill zones (red = risk area from entry to SL, green = reward area from entry to TP3).
6️⃣ Trade lifecycle tracking with outcome labels.
After a breakout fires, the indicator actively monitors whether price hits TP1, TP2, TP3, or SL:
TP hit detection: for long trades, high ≥ TPx AND high < TPx (first touch). For short trades, low ≤ TPx AND low > TPx. This ensures each TP is counted exactly once.
Trade close conditions:
— TP3 hit → trade marked as "Win (TP3)" → ✔ label placed on chart → all target lines removed
— SL hit → trade marked as "Loss (SL)" → ✘ label placed on chart → all target lines removed
— New breakout while trade active → previous trade replaced
The dashboard shows: Active / Win (TP3) / Loss (SL) with the last P&L in price units. Close labels include tooltips with full trade details (entry, TP3/SL level, P&L).
7️⃣ Overlap prevention for range boxes.
When enabled (default on), the indicator prevents a new range box from overlapping with an existing one. The squeezeStartBar of a new range must be after the right edge of the most recent existing box. This prevents cluttered, overlapping consolidation zones that would create confusing breakout levels.
8️⃣ Signal strength scoring (0–4).
Each breakout receives a strength score based on how many quality factors are present:
— +1 for impulse candle (always true on breakout, baseline)
— +1 for volume surge (if volume filter enabled and passed)
— +1 for HTF alignment (if HTF filter enabled and aligned)
— +1 for extended squeeze (squeeze duration ≥ 2× minimum)
Classification: Strong (≥3), Medium (≥2), Normal (<2). Displayed in the dashboard.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Volatility measurement: BB Width = (upperBB − lowerBB) / basis. ATR computed with period = squeezeLenght / 2. Both compared to their SMAs.
Step 2 — Squeeze detection: isSqueeze = (bbWidth < bbWidthSMA × threshold) AND (ATR < atrSMA × compressionRatio). Counter tracks consecutive squeeze bars.
Step 3 — Range construction: When squeeze starts, init boundaries from first bar's high/low. Each bar during squeeze: boundaries expand to include new highs/lows. Range capped at 6× ATR.
Step 4 — Range box creation: When squeeze ends (isSqueeze transitions from true to false) AND duration ≥ minimum bars AND not overlapping → create range box with resistance/support zones and centerline.
Step 5 — Breakout scan: On each confirmed bar, iterate through existing range boxes. If close > rangeTop with bullish impulse + filter pass → bullish breakout. If close < rangeBottom with bearish impulse + filter pass → bearish breakout. The broken range box is removed.
Step 6 — Target placement: Entry = close. SL = opposite boundary ± ATR buffer. TP1/TP2/TP3 = entry ± risk × R:R multipliers. Lines, labels, and fill zones are drawn.
Step 7 — Trade monitoring: Each bar, check if price touched TP1/TP2/TP3 or SL (first-touch detection using current vs previous bar comparison). On TP3 or SL → close trade, label outcome, remove visuals.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — gray range boxes appear at detected consolidation zones
2. Red-tinted zone at top = resistance, green-tinted at bottom = support
3. When price breaks out with an impulse candle → "Long" or "Short" label appears
4. Entry, SL, TP1, TP2, TP3 lines are automatically drawn
5. When price reaches TP3 → ✔ label. When SL hit → ✘ label. Trade auto-closes.
👁️ Reading the chart:
— ⬜ Gray box = consolidation range (detected squeeze zone)
— 🟥 Red-tinted top zone = resistance area within range
— 🟩 Green-tinted bottom zone = support area within range
— ➖ Dashed centerline = range midpoint
— 🟢 "Long" label below bar = confirmed bullish breakout
— 🔴 "Short" label above bar = confirmed bearish breakout
— Green solid line = entry price
— Red dashed line = stop loss
— Green dotted lines = TP1, TP2, TP3 levels
— 🟩 Green fill = reward zone (entry to TP3)
— 🟥 Red fill = risk zone (entry to SL)
— ✔ TP3 label = trade closed at target (win)
— ✘ SL label = trade stopped out (loss)
— 🟡 Yellow background (optional) = active squeeze
📊 Dashboard fields:
— Status: Active / Win (TP3) / Loss (SL)
— Signal: last breakout direction with bars elapsed
— Strength: signal quality (Strong / Medium / Normal)
— Trend: current trade direction
— Squeeze: active status with bar count
— Entry / Stop Loss: current trade levels
— Last P&L: profit/loss of last completed trade
— HTF Bias: higher-timeframe trend direction
— Version / TF
🔧 Tuning guide:
— Too many false squeezes: decrease Squeeze Threshold (0.4–0.5), decrease ATR Compression Ratio (0.6–0.7), increase Min Squeeze Bars (8–12)
— Missing squeezes: increase Squeeze Threshold (0.7–0.8), increase ATR Compression Ratio (0.8–0.9), decrease Min Squeeze Bars (3–4)
— Breakouts too weak: increase Impulse Body Threshold (1.0–1.5), enable Volume Filter
— Stops too tight: increase SL ATR Buffer (0.7–1.0)
— Want only trend-aligned breakouts: enable HTF Trend Filter
— Scalping 1–5M: Squeeze Length 15, Min Squeeze 3, Impulse 0.5, TP1 0.75
— Swing 4H–1D: Squeeze Length 30, Min Squeeze 8, Impulse 1.0, TP3 5.0
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Squeeze Detection Length (default 20): lookback for BB Width and ATR baseline
— BB Multiplier (default 2.0): standard deviation multiplier for Bollinger Bands
— Squeeze Threshold (default 0.6): BB Width must be below this fraction of its SMA
— ATR Compression Ratio (default 0.75): ATR must be below this fraction of its SMA
— Min Squeeze Bars (default 5): minimum consecutive squeeze bars for valid range
— Impulse Body Threshold (default 0.8): breakout candle body ≥ ATR × this value
— Prevent Overlap (default On): no overlapping range boxes
🎯 Targets:
— SL ATR Buffer (default 0.5): extra ATR distance beyond range boundary for stop
— TP1 R:R (default 1.0) / TP2 R:R (default 2.0) / TP3 R:R (default 3.0): risk-to-reward multiples
🔍 Filters:
— Volume Filter (default Off): breakout volume > SMA(20) × multiplier (default 1.5×)
— HTF Trend Filter (default Off): align breakouts with SMA(50) trend on HTF (default Daily)
🎨 Visual:
— Range boxes, resistance/support zones, centerline (all toggleable)
— Breakout signals, target levels, close labels (all toggleable)
— Squeeze background highlight (default Off)
— Configurable label sizes (signal, target, close — separate controls)
— Auto / Dark / Light theme
🔔 Alerts
— 🟢 BULL BREAKOUT / 🔴 BEAR BREAKOUT — ticker, price, SL, TP1, timeframe
— ✅ TP1 HIT / TP2 HIT / TP3 HIT — trade progress
— ✅ TP3 TRADE CLOSED — full win with P&L
— ❌ SL TRADE CLOSED — stopped out with P&L
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All breakout signals require barstate.isconfirmed. Range boxes are created on the bar after the squeeze ends (confirmed transition). TP/SL hit detection uses first-touch logic (current bar vs previous bar comparison). HTF filter uses + lookahead_on for non-repainting. A warmup period (max of squeeze length and 50 bars) prevents signals during insufficient data.
— 📐 The dual-engine squeeze is not a standard Bollinger/Keltner squeeze . It combines BB Width percentile compression with ATR contraction ratio — both must agree. This is stricter than a single-measure approach and produces fewer but higher-quality consolidation zones.
— ⚖️ The trade is tracked until TP3 or SL — there is no partial close logic. TP1 and TP2 are marked as they're hit (for visual reference and alerts) but the trade remains open until the final outcome. You can manage partial closes manually using the TP1/TP2 alerts.
— 📊 Signal strength reflects how many quality factors aligned at the time of breakout. A "Strong" signal had volume surge, HTF alignment, AND extended squeeze — but strength does not predict outcome.
— 🔄 If a new breakout occurs while a trade is active, the previous trade is replaced. The indicator tracks one trade at a time.
— 📏 Range box boundaries are adaptive Donchian — they expand during the squeeze to capture every high and low. They do not contract. This means the range can be wider than the BB Width suggests if a spike occurred during the squeeze.
— 🛠️ This is a breakout detection and target visualization tool , not an automated trading bot. It identifies squeeze zones, confirms breakouts, and places structural targets — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume filter auto-adapts to instruments without volume data. Indicator

Quasimodo Pattern Strategy Back Test [TradingFinder] QM Trading🔵 Introduction
The QM pattern, also known as the Quasimodo pattern, is one of the popular patterns in price action, and it is often used by technical analysts. The QM pattern is used to identify trend reversals and provides a very good risk-to-reward ratio. One of the advantages of the QM pattern is its high frequency and visibility in charts.
Additionally, due to its strength, it is highly profitable, and as mentioned, its risk-to-reward ratio is very good. The QM pattern is highly popular among traders in supply and demand, and traders also use this pattern.
The Price Action QM pattern, like other Price Action patterns, has two types: Bullish QM and Bearish QM patterns. To identify this pattern, you need to be familiar with its types to recognize it.
🔵 Identifying the QM Pattern
🟣 Bullish QM
In the bullish QM pattern, as you can see in the image below, an LL and HH are formed. As you can see, the neckline is marked as a dashed line. When the price reaches this range, it will start its upward movement.
🟣 Bearish QM
The Price Action QM pattern also has a bearish pattern. As you can see in the image below, initially, an HH and LL are formed. The neckline in this image is the dashed line, and when the LL is formed, the price reaches this neckline. However, it cannot pass it, and the downward trend resumes.
🔵 How to Use
The Quasimodo pattern is one of the clearest structures used to identify market reversals. It is built around the concept of a structural break followed by a pullback into an area of trapped liquidity. Instead of relying on lagging indicators, this pattern focuses purely on price action and how the market reacts after exhausting one side of liquidity. When understood correctly, it provides traders with precise entry points at the transition between trend phases.
🟣 Bullish Quasimodo
A bullish Quasimodo forms after a clear downtrend when sellers start losing control. The market continues to make lower lows until a sudden higher high appears, signaling that buyers are entering with strength. Price then pulls back to retest the previous low, creating what is known as the Quasimodo low.
This area often becomes the final trap for sellers before the market shifts upward. A visible rejection or displacement from this zone confirms bullish momentum. Traders usually place entries near this level, stops below the low, and targets at previous highs or the next resistance zone. Combining the setup with demand zones or Fair Value Gaps increases its accuracy.
🟣 Bearish Quasimodo
A bearish Quasimodo forms near the top of an uptrend when buyers begin to lose strength. The market continues to make higher highs until a sudden lower low breaks the bullish structure, showing that selling pressure is entering the market. Price then retraces upward to retest the previous high, forming the Quasimodo high, where breakout buyers are often trapped.
Once rejection appears at this level, it indicates a likely reversal. Traders can enter short near this area, with stop-losses placed above the high and targets near the next support or previous lows. The setup gains more reliability when aligned with supply zones, SMT divergence, or bearish Fair Value Gaps.
🔵 Setting
Pivot Period : You can use this parameter to use your desired period to identify the QM pattern. By default, this parameter is set to the number 5.
Take Profit Mode : You can choose your desired Take Profit in three ways. Based on the logic of the QM strategy, you can select two Take Profit levels, TP1 and TP2. You can also choose your take profit based on the Reward to Risk ratio. You must enter your desired R/R in the Reward to Risk Ratio parameter.
Stop Loss Refine : The loss limit of the QM strategy is based on its logic on the Head pattern. You can refine it using the ATR Refine option to prevent Stop Hunt. You can enter your desired coefficient in the Stop Loss ATR Adjustment Coefficient parameter.
Reward to Risk Ratio : If you set Take Profit Mode to R/R, you must enter your desired R/R here. For example, if your loss limit is 10 pips and you set R/R to 2, your take profit will be reached when the price is 20 pips away from your entry point.
Stop Loss ATR Adjustment Coefficient : If you set Stop Loss Refine to ATR Refine, you must adjust your loss limit coefficient here. For example, if your buy position's loss limit is at the price of 1000, and your ATR is 10, if you set Stop Loss ATR Adjustment Coefficient to 2, your loss limit will be at the price of 980.
Entry Level Validity : Determines how long the Entry level remains valid. The higher the level, the longer the entry level will remain valid. By default it is 2 and it can be set between 2 and 15.
🔵 Results
The following examples show the backtest results of the Quasimodo (QM) strategy in action. Each image is based on specific settings for the symbol, timeframe, and input parameters, illustrating how the QM logic can generate signals under different market conditions. The detailed configuration for each backtest is also displayed on the image.
⚠ Important Note : Even with identical settings and the same symbol, results may vary slightly across different brokers due to data feed variations and pricing differences.
Default Properties of Backtests :
OANDA:XAUUSD | TimeFrame: 5min | Duration: 1 Year :
BINANCE:BTCUSD | TimeFrame: 5min | Duration: 1 Year :
CAPITALCOM:US30 | TimeFrame: 5min | Duration: 1 Year :
NASDAQ:QQQ | TimeFrame: 5min | Duration: 5 Year :
OANDA:EURUSD | TimeFrame: 5min | Duration: 5 Year :
PEPPERSTONE:US500 | TimeFrame: 5min | Duration: 5 Year :
Strategy

Indicator

Indicator

Indicator
