Judas Swing Detector [AGPro Series]Judas Swing Detector
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The Judas Swing is a well-known intraday pattern in ICT (Inner Circle Trader)
methodology describing how price often makes a deceptive initial move at the
London or New York session open — pulling in participants in one direction —
before reversing to reveal the session's true directional bias.
Judas Swing Detector systematically identifies, visualizes, and tracks this
pattern across every London and New York session open. It shades the trap
zone, flags the reversal bar, highlights the true-direction bias, and maintains
a rolling 20-session performance log so users can assess how consistently the
pattern resolves on their chosen symbol and timeframe.
IMPORTANT — Timeframe requirement: This indicator is designed for intraday
charts of 1 hour or lower (1m, 5m, 15m, 30m, 1h). Session windows anchor the
entire logic, and a 1-hour Judas window cannot be resolved on 4-hour or higher
charts. The panel always shows an "Optimal TF: 1m - 1h" footer, and the TF
status row turns yellow with "use <=1h" if the current chart exceeds this
range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
UNIQUE EDGE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Unlike generic session-open or breakout indicators, Judas Swing Detector is
built around a defined four-state lifecycle (Pending → Active → Forming →
Confirmed / Failed) with ATR-normalized thresholds, so detection remains
stable across different volatility regimes and asset classes.
Three design choices make it distinct:
1. Independent two-way extremum tracking inside the Judas window — both the
maximum upward and maximum downward excursion are recorded, and the larger
of the two is declared the fake move when the window closes. This removes
ambiguity in choppy openings.
2. Separate fake-move and reversal thresholds. The initial push must exceed
a minimum ATR-scaled size to qualify, and the reversal must travel a second
ATR-scaled distance beyond the session open — filtering out shallow round
trips that would otherwise inflate the signal count.
3. Rolling 20-session statistics panel reporting success rate, average fake
distance, and directional bias, giving discretionary traders an objective
view of how the pattern is behaving on their instrument before they act on
it.
4. Support/resistance-style invalidation zone drawn at the fake-move extremum
after confirmation. This gives a clear visual anchor: if price later
re-enters this zone from the opposite side during the session, the Judas
read is considered broken. The zone is a reference, not an automatic
signal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
METHODOLOGY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1 — Session anchoring
At the first bar of the configured London or New York window the script
records the session open price, resets the two-way extremum trackers, and
transitions to the Active state.
Step 2 — Fake-move accumulation
During the window the script tracks both the maximum high and minimum low
relative to the session open. Neither is committed as the fake move until the
window closes.
Step 3 — Window-close evaluation
When the window ends the larger excursion (up vs down) becomes the fake
direction. If its size reaches the user-defined ATR multiple it qualifies and
the script transitions to the Forming state; otherwise it resets to idle.
Step 4 — Reversal confirmation
In the Forming state the script waits for price to cross the session open in
the opposite direction of the fake move and travel at least the configured
ATR-scaled distance beyond it. When that happens the swing is Confirmed and
the true direction is drawn on the chart. If the reversal window expires
without confirmation the swing is recorded as Failed.
Step 5 — History log
Every confirmed and failed outcome is appended to a rolling 20-session log
used by the statistics panel.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SIGNALS & ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
On-chart visuals:
• Dashed vertical line at session start (accent color)
• "LON" or "NY" label at the session anchor bar (Balanced / Detailed only)
• Shaded fake-move box from session open to fake extremum, colored opposite
to the true direction (a bearish trap is shaded in the bear tone because
the true direction is down — and vice versa)
• Optional "Fake" distance label at the extremum (Detailed density only)
• Reversal marker "X UP" or "X DOWN" at the confirmation bar, offset
from the candles for readability
• Horizontal support/resistance-style invalidation zone around the fake
extremum, extending 40 bars to the right — a visual reference for where
the Judas read would break down if price re-enters the zone
Alert conditions (toggle individually in settings):
• Judas Swing Forming — fake move has qualified, waiting for reversal
• Judas Swing Confirmed — reversal threshold crossed, true direction known
• Judas Swing Failed — reversal window expired without confirmation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
KEY INPUTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Session Windows
• Track London Open — toggle London session monitoring
• London Judas Window (NY time) — session string, default 0200-0300
• Track New York Open — toggle NY session monitoring
• NY Judas Window (NY time) — session string, default 0930-1030
• Session Timezone — timezone used to interpret the windows
• Reversal Window (minutes) — maximum time after window close in which a
valid reversal can still be recorded
Detection Logic
• Min Fake-Move Size (ATR mult) — minimum excursion required to qualify
• Reversal Confirmation (ATR mult) — distance beyond session open needed
to confirm the reversal
• ATR Length — lookback for threshold scaling
Visuals
• Show Session Start Line, Show Fake-Move Zone, Show Reversal Marker,
Show Invalidation Zone — individual visual toggles
• Label Density — Minimal / Balanced / Detailed
• Font Size — tiny / small / normal / large (applies to labels and panel)
• Theme — Dark / Light (panel only, chart candles unaffected)
Panel
• Show Info Panel — master toggle
• Panel Location — 6 chart positions
• Always displays: current session, state, true direction, fake distance,
rolling 20-session statistics (success rate, avg distance, bull/bear
bias), current TF status, and a footer reminding the optimal timeframe
range
Alerts — three individual toggles (Forming / Confirmed / Failed)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Supported timeframes: 1m, 5m, 15m, 30m, 1h. These resolve a session's early
structure cleanly while keeping enough bars inside each Judas window for the
extremum tracker to work with. Recommended default: 15m or 1h.
Not supported: 4h, 1D, 1W. On these timeframes a single bar exceeds the
session window, so nothing is detected. The panel will show a yellow "use
<=1h" hint if you accidentally switch to one of these.
Recommended instruments: FX majors (EURUSD, GBPUSD, USDJPY), index futures
(NQ, ES), liquid crypto (BTC, ETH). The ATR-normalized thresholds keep the
logic portable across these asset classes.
Workflow suggestion:
1. Apply the indicator and let it observe several sessions so the panel
populates a meaningful sample.
2. Review the 20-session success rate on your specific symbol and timeframe.
This is not a forecast — it is a descriptive statistic of how the pattern
has resolved in recent history on that chart.
3. Use the Forming alert as a heads-up, and the Confirmed alert as the main
event. The true-direction arrow marks the bias of the remaining session,
not a trade entry or exit.
4. Combine with your own structural context — higher timeframe bias, key
levels, liquidity pools — before acting on any signal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
LIMITATIONS & TRANSPARENCY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Not a strategy. This is a discretionary analysis tool; it neither places
orders nor implies any specific trade setup.
• Intraday timeframes only. The logic requires 1h or lower charts to resolve
the session windows. On 4h, 1D or higher the indicator will not detect
anything and the panel will show a "use <=1h" notice.
• No forecasting. Displayed statistics describe past behavior on the current
chart only and do not imply future performance.
• Pattern-dependent. When price opens and trends cleanly in one direction
without a fake move, the pattern legitimately will not trigger. Low
signal count on such sessions is expected behavior, not a malfunction.
• Session boundary sensitivity. Results depend on the configured session
windows and timezone. Outside the major FX and equities session hours the
ICT framing may not translate cleanly.
• Extreme-volatility sessions. During very large gaps or news spikes the ATR
thresholds can be dominated by a single bar; users should review the
defaults in those conditions.
• Symbol coverage. Pip conversion handles forex and JPY pairs explicitly and
falls back to tick-based sizing for other asset types. Values are intended
as relative magnitudes, not broker-specific pip quotes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
RISK DISCLOSURE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is provided for educational and analytical purposes only. It
does not constitute financial advice, a recommendation, or a solicitation to
buy or sell any instrument. Trading involves substantial risk of loss; past
pattern behavior is not indicative of future results. Users are responsible
for their own trading decisions and for verifying that any signal aligns with
their own methodology and risk management.
The source code is published under the Mozilla Public License 2.0. Feedback
and constructive suggestions are welcome.
Indicador Pine Script®






















