已更新
Swing Trap PRO [EXCAVO]

Swing Sweep Detection with Volume Absorption, Strength Scoring, TP/SL Hit Tracking, and POC Confirmation
The Swing Trap PRO detects swing traps - moments when price sweeps beyond a
confirmed pivot level on a wick and immediately closes back inside the range. The
indicator tracks up to 50 simultaneous traps with volume absorption analysis, automatic
TP/SL level calculation, and independent hit tracking for each level. Traps are
confirmed only when price subsequently closes beyond the Point of Control of the probe
candle, separating genuine traps from random wicks.
Unlike simple wick-detection scripts that mark any candle touching a swing level, this
implementation requires three conditions simultaneously: the wick must exceed the pivot
level, both the open and close must remain on the opposite side, and the lower-timeframe
volume distribution must pass the configured filter before a probe is registered.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator to any chart. Swing levels form immediately
as pivot highs and lows are detected using the configured length.
Step 2 → Note probe markers (circles). A probe is registered when price
sweeps beyond a swing level on a wick and closes back inside -
the core swing trap condition.
Step 3 → A confirmation arrow appears when price closes beyond the POC
of the probe candle, completing the trap sequence. Unconfirmed
probes expire after the Max Trap Age limit.
Step 4 → TP/SL levels appear automatically after confirmation. When a
target is reached, the line turns solid green with a checkmark.
SL shortens to a 5-bar marker once any TP is hit first.
Step 5 → The absorption percentage near each probe shows how much of the
probe candle's volume was traded beyond the swing level. Green
= strong (70%+), white = moderate (40-70%), gray = weak.
Step 6 → A new confirmed trap automatically closes all previous traps,
keeping the chart clean with one active TP/SL set at a time.
Step 7 → The optional Trend Filter (EMA 200) limits detections to the
dominant trend direction. The dashboard shows current trap
status and the confirmation rate across all detected probes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Pivot Detection
Swing highs and lows are identified using ta.pivothigh and ta.pivotlow with the
configured Pivot Length. The most recent confirmed pivot price and bar index are stored.
The pivot bar is offset by the confirmation depth so all references use bar_index only
(no timestamps), avoiding coordinate instability on zoom or scroll.
◆ Probe Detection
A bearish probe fires when:
high > swing_high AND open < swing_high AND close < swing_high
A bullish probe fires when:
low < swing_low AND open > swing_low AND close > swing_low
The wick depth percentage is then computed:
wick_pct = (high - swing_high) / swing_high * 100 [bearish]
wick_pct = (swing_low - low) / swing_low * 100 [bullish]
The retracement speed measures how completely price closed back inside the range:
retr_speed = (high - close) / (high - low) [bearish]
◆ Volume Absorption and POC
When a probe is detected, lower-timeframe bars covering the probe candle are queried
using request.security_lower_tf. For each LTF bar, volume is classified as "outside"
or "inside" the swing level:
absorb_pct = out_vol / total_vol * 100
The LTF bar with the highest volume defines the Point of Control (POC):
poc = ltf_close at max(ltf_volume)
◆ Strength Score (0-100)
Each probe receives a composite strength score from three components:
wick_pts = min(30, wick_pct / 2.0 × 30) [wick depth, max 30 pts]
vol_pts = min(40, vol_ratio / 3.0 × 40) [vol vs 20-bar SMA, max 40 pts]
speed_pts = min(30, retr_speed × 30) [close-back speed, max 30 pts]
score = wick_pts + vol_pts + speed_pts
◆ Confirmation and TP/SL
After a probe, the trap awaits a closing bar beyond the POC. Once confirmed:
TP1 = swing_level + atr × tp1_mult
TP2 = swing_level + atr × tp2_mult
TP3 = swing_level + atr × tp3_mult
SL = swing_level - atr × sl_mult
The indicator monitors every subsequent bar for TP and SL price hits and updates
line styles accordingly. A new confirmed trap closes all prior open traps.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
Unlike simple sweep detectors that mark any wick touching a swing level, this
implementation requires simultaneous wick, open, and close conditions plus
lower-timeframe volume validation before a probe is registered. The confirmation
step (close beyond POC) adds a second gate that reduces the probe-to-noise ratio.
◆ Multi-Trap History
Tracks up to 50 simultaneous traps with independent lifecycle management. Each trap
progresses through probe, confirmation, and resolution stages. A new confirmed trap
closes all previous traps. Old traps fade with transparency aging.
◆ Volume Absorption Analysis
Lower-timeframe bars within the probe candle are used to measure how much volume was
traded beyond the swing level. This swept volume percentage distinguishes high-conviction
traps from low-volume wicks on thin order books.
◆ Strength Score
Each trap receives a 0-100 score combining wick depth (30 pts), volume ratio vs 20-bar
average (40 pts), and retracement speed (30 pts). Higher scores indicate traps where
price moved aggressively beyond the level and closed back equally fast on elevated volume.
◆ TP/SL Hit Tracking
Three ATR-based take profit levels and a stop loss are drawn from the swing level. The
indicator tracks whether each level was reached by subsequent price action. A TP line
turns solid green with a checkmark when hit. SL shortens to a 5-bar marker once any TP
is hit first, reflecting the reduced downside exposure after a partial exit.
◆ POC Confirmation Gate
Traps require a second trigger: price must close beyond the LTF Point of Control of the
probe candle. This confirmation reduces false probe counts and improves the
confirmation-to-probe ratio shown in the dashboard.
◆ EMA 200 Trend Filter
Optional filter that only allows bullish traps above EMA 200 and bearish traps below,
reducing counter-trend detections in strongly trending conditions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (top right by default) showing:
Legend table (bottom left) explains every chart element. Toggle in Dashboard settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Detection
Volume Analysis
Levels
Visualization
Dashboard
Alert Settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
JSON alert mode available for webhook integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published as invite-only. The protected source contains
the multi-trap lifecycle engine, the volume absorption scoring system,
the POC-based confirmation logic, and the TP/SL hit tracking state
machine. These components represent original methodology. The description
above provides full transparency on what the indicator calculates and how.
Best regards,
EXCAVO
The Swing Trap PRO detects swing traps - moments when price sweeps beyond a
confirmed pivot level on a wick and immediately closes back inside the range. The
indicator tracks up to 50 simultaneous traps with volume absorption analysis, automatic
TP/SL level calculation, and independent hit tracking for each level. Traps are
confirmed only when price subsequently closes beyond the Point of Control of the probe
candle, separating genuine traps from random wicks.
Unlike simple wick-detection scripts that mark any candle touching a swing level, this
implementation requires three conditions simultaneously: the wick must exceed the pivot
level, both the open and close must remain on the opposite side, and the lower-timeframe
volume distribution must pass the configured filter before a probe is registered.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator to any chart. Swing levels form immediately
as pivot highs and lows are detected using the configured length.
Step 2 → Note probe markers (circles). A probe is registered when price
sweeps beyond a swing level on a wick and closes back inside -
the core swing trap condition.
Step 3 → A confirmation arrow appears when price closes beyond the POC
of the probe candle, completing the trap sequence. Unconfirmed
probes expire after the Max Trap Age limit.
Step 4 → TP/SL levels appear automatically after confirmation. When a
target is reached, the line turns solid green with a checkmark.
SL shortens to a 5-bar marker once any TP is hit first.
Step 5 → The absorption percentage near each probe shows how much of the
probe candle's volume was traded beyond the swing level. Green
= strong (70%+), white = moderate (40-70%), gray = weak.
Step 6 → A new confirmed trap automatically closes all previous traps,
keeping the chart clean with one active TP/SL set at a time.
Step 7 → The optional Trend Filter (EMA 200) limits detections to the
dominant trend direction. The dashboard shows current trap
status and the confirmation rate across all detected probes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Pivot Detection
Swing highs and lows are identified using ta.pivothigh and ta.pivotlow with the
configured Pivot Length. The most recent confirmed pivot price and bar index are stored.
The pivot bar is offset by the confirmation depth so all references use bar_index only
(no timestamps), avoiding coordinate instability on zoom or scroll.
◆ Probe Detection
A bearish probe fires when:
high > swing_high AND open < swing_high AND close < swing_high
A bullish probe fires when:
low < swing_low AND open > swing_low AND close > swing_low
The wick depth percentage is then computed:
wick_pct = (high - swing_high) / swing_high * 100 [bearish]
wick_pct = (swing_low - low) / swing_low * 100 [bullish]
The retracement speed measures how completely price closed back inside the range:
retr_speed = (high - close) / (high - low) [bearish]
◆ Volume Absorption and POC
When a probe is detected, lower-timeframe bars covering the probe candle are queried
using request.security_lower_tf. For each LTF bar, volume is classified as "outside"
or "inside" the swing level:
absorb_pct = out_vol / total_vol * 100
The LTF bar with the highest volume defines the Point of Control (POC):
poc = ltf_close at max(ltf_volume)
◆ Strength Score (0-100)
Each probe receives a composite strength score from three components:
wick_pts = min(30, wick_pct / 2.0 × 30) [wick depth, max 30 pts]
vol_pts = min(40, vol_ratio / 3.0 × 40) [vol vs 20-bar SMA, max 40 pts]
speed_pts = min(30, retr_speed × 30) [close-back speed, max 30 pts]
score = wick_pts + vol_pts + speed_pts
◆ Confirmation and TP/SL
After a probe, the trap awaits a closing bar beyond the POC. Once confirmed:
TP1 = swing_level + atr × tp1_mult
TP2 = swing_level + atr × tp2_mult
TP3 = swing_level + atr × tp3_mult
SL = swing_level - atr × sl_mult
The indicator monitors every subsequent bar for TP and SL price hits and updates
line styles accordingly. A new confirmed trap closes all prior open traps.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
Unlike simple sweep detectors that mark any wick touching a swing level, this
implementation requires simultaneous wick, open, and close conditions plus
lower-timeframe volume validation before a probe is registered. The confirmation
step (close beyond POC) adds a second gate that reduces the probe-to-noise ratio.
◆ Multi-Trap History
Tracks up to 50 simultaneous traps with independent lifecycle management. Each trap
progresses through probe, confirmation, and resolution stages. A new confirmed trap
closes all previous traps. Old traps fade with transparency aging.
◆ Volume Absorption Analysis
Lower-timeframe bars within the probe candle are used to measure how much volume was
traded beyond the swing level. This swept volume percentage distinguishes high-conviction
traps from low-volume wicks on thin order books.
◆ Strength Score
Each trap receives a 0-100 score combining wick depth (30 pts), volume ratio vs 20-bar
average (40 pts), and retracement speed (30 pts). Higher scores indicate traps where
price moved aggressively beyond the level and closed back equally fast on elevated volume.
◆ TP/SL Hit Tracking
Three ATR-based take profit levels and a stop loss are drawn from the swing level. The
indicator tracks whether each level was reached by subsequent price action. A TP line
turns solid green with a checkmark when hit. SL shortens to a 5-bar marker once any TP
is hit first, reflecting the reduced downside exposure after a partial exit.
◆ POC Confirmation Gate
Traps require a second trigger: price must close beyond the LTF Point of Control of the
probe candle. This confirmation reduces false probe counts and improves the
confirmation-to-probe ratio shown in the dashboard.
◆ EMA 200 Trend Filter
Optional filter that only allows bullish traps above EMA 200 and bearish traps below,
reducing counter-trend detections in strongly trending conditions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (top right by default) showing:
- Status - current trap direction and bars since confirmation (e.g. BULL 5b)
- Level - swing level price for the latest active trap
- Conf Rate - confirmation percentage (confirmed probes / total probes)
Legend table (bottom left) explains every chart element. Toggle in Dashboard settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Detection
- Pivot Length - 5 (bars for swing detection, higher = stronger pivots)
- Scan Bullish Traps - ON (detect sweeps below swing lows)
- Scan Bearish Traps - ON (detect sweeps above swing highs)
- Max Trap Age - 500 (bars before unconfirmed trap expires)
- Max Concurrent Traps - 50 (simultaneous traps tracked)
- Allow Repainting - OFF (detections on confirmed bars only)
Volume Analysis
- Volume Filter - None (filter by volume percentage beyond swing)
- Filter Threshold - 25% (minimum/maximum swept volume percentage)
- Auto LTF Resolution - ON (automatic lower timeframe calculation)
Levels
- Show TP / SL Levels - ON (draw target and stop lines)
- SL Multiplier - 0.3 xATR (stop distance from swing level)
- TP1 Multiplier - 1.5 xATR (first target distance)
- TP2 Multiplier - 3.0 xATR (second target distance)
- TP3 Multiplier - 5.0 xATR (third target distance, closes the trap)
- Trend Filter (EMA 200) - OFF (limits detections to dominant trend direction)
Visualization
- Bullish Color - dark blue (customizable)
- Bearish Color - dark red (customizable)
- Show Trap Levels - ON (swing level lines)
- Show Probe Markers - ON (circle markers at probe candles)
- Show Confirm Arrows - ON (arrows on confirmation bars)
- Show Pending Zone - ON (background between probe and confirm)
Dashboard
- Show Dashboard - ON (information panel)
- Dashboard Position - Top Right (moveable to any corner)
- Show Legend - ON (chart element reference)
Alert Settings
- JSON Alerts (for bots) - OFF (enable for webhook/bot integration)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
- Bullish Probe - sweep below swing low detected on bar close
- Bearish Probe - sweep above swing high detected on bar close
- Bullish Confirm - bullish trap confirmed (close above POC)
- Bearish Confirm - bearish trap confirmed (close below POC)
JSON alert mode available for webhook integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published as invite-only. The protected source contains
the multi-trap lifecycle engine, the volume absorption scoring system,
the POC-based confirmation logic, and the TP/SL hit tracking state
machine. These components represent original methodology. The description
above provides full transparency on what the indicator calculates and how.
Best regards,
EXCAVO
Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.
版本注释
CHANGED- Entry / SL / TP levels restyled to the standard EXCAVO trade-level
palette: orange entry, red stop, blue targets — consistent with
Trendline Bounce PRO and Channel Breakout PRO.
- Alerts now fire on confirmed traps only. Probe (unconfirmed)
detections remain visible on the chart but no longer raise alerts.
- JSON confirm alerts carry the full level set (entry, TP1-3, SL,
strength) for bot integrations.
NEW
- "Any Confirm" alert condition — single alert covering both bullish
and bearish confirmed traps.
版本注释
- Entry/SL/TP now anchor at trap confirmation, not the old swing — levels arevalid going forward.
- Entry = confirmation close. SL = beyond the sweep wick + ATR buffer.
TP1/2/3 = 1R/2R/3R of the entry-to-SL risk.
- New Min Strength filter (Auto): keeps high-conviction traps; threshold adapts
to timeframe. Manual mode available.
- Confirmation arrows moved beyond the stop (no longer hidden by candles).
Entry line shortened.
- Removed redundant "Any Confirm" alert. JSON now includes entry, fires on bar
close (non-repainting).
付费空间可用
此指标仅对EXCAVO PRO: Indicators + My Positions 订阅用户开放。加入订阅即可访问此脚本及EXCAVO的其他脚本。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
付费空间可用
此指标仅对EXCAVO PRO: Indicators + My Positions 订阅用户开放。加入订阅即可访问此脚本及EXCAVO的其他脚本。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。