OPEN-SOURCE SCRIPT

Failed 2 + 3→1 & 1→3 & 1 bar Alerts

91
Failed 2 + Enhanced Strength + 3→1 & 1→3 & Inside Bar Alerts (with Dashboard)
This indicator is a strict, rule-based market structure and reversal framework built on The Strat methodology. It detects Failed 2 reversals, compression/expansion sequences (3→1 and 1→3), and confirmed Inside Bars, then grades Failed 2 signals using a multi-factor strength scoring system. A real-time dashboard displays the most recent Failed 2 signal and its strength.
The script is designed for bar-close accuracy, objective signal qualification, and visual clarity, without directional bias baked into the dashboard.
1. Core Signal Types Detected
A. Strict Failed 2 Reversals
Only true, textbook Failed 2 structures are detected. No loose or interpretive logic is used.
Failed 2 Up (F2U)
A bearish reversal following an attempted break higher:
Current bar makes a higher high than the prior bar
Current bar does NOT make a lower low
Close is below the prior bar’s high
Candle closes red (close < open)
Failed 2 Down (F2D)
A bullish reversal following an attempted break lower:
Current bar makes a lower low than the prior bar
Current bar does NOT make a higher high
Close is above the prior bar’s low
Candle closes green (close > open)
These rules ensure the market attempted continuation and failed, which is the defining characteristic of a Failed 2.
B. Inside Bars (IB)
An Inside Bar is defined as:
High is lower than the prior bar’s high
Low is higher than the prior bar’s low
Inside Bars are only confirmed on bar close.
⚠️ Important filtering rule:
Inside Bar labels are NOT displayed if the bar is part of a 3→1 or 1→3 sequence, preventing duplicate or misleading labels.
C. 3→1 and 1→3 Sequences
3→1 Compression
Prior bar is a 3-bar (engulfs the previous bar)
Current bar is an Inside Bar
This represents volatility compression and potential energy build-up.
1→3 Expansion
Prior bar is an Inside Bar
Current bar is a 3-bar
This represents range expansion and initiative activity.
2. Failed 2 Strength Scoring System (0–5 Points)
Each Failed 2 signal is objectively graded using five independent criteria. Each criterion contributes 1 point.
Scoring Components
Rejection Strength
Measures how deeply price rejected back inside the prior bar’s range
Strong rejection = 1 point
Range vs ATR
Current bar range > 75% of ATR
Indicates expansion and participation
Relative Volume
Volume > 1.2× the moving average volume
Confirms real interest, not low-liquidity noise
Wick Dominance
Upper wick dominance for F2U
Lower wick dominance for F2D
Wick must exceed 50% of total candle range
Key Level Proximity
Close is within a configurable percentage of:
Prior High (for F2U)
Prior Low (for F2D)
Strength Tiers
0–2 points → Weak
3 points → Strong
4–5 points → Very Strong
Strength is displayed both visually on the chart and numerically in the dashboard.
3. Visual Labels
Failed 2 Labels
Displayed only when enabled:
F2U / F2D → Weak
F2U! / F2D! → Strong
F2U!! / F2D!! → Very Strong
Color intensity increases with strength:
Red tones for Failed 2 Up
Green tones for Failed 2 Down
Labels are positioned:
Above the bar for F2U
Below the bar for F2D
Sequence Labels
3→1: Green label below the bar
1→3: Orange label above the bar
Inside Bar Label
Label text: IB
Only shown on confirmed close
Only shown if not part of a sequence
Small, unobtrusive visual style
4. Alerts (Bar-Close Accurate)
The indicator provides four independent alert conditions:
Strict Failed 2
Triggers on bar close
Fires for either F2U or F2D
3→1 Sequence
Compression detected on bar close
1→3 Sequence
Expansion detected on bar close
Inside Bar
Confirmed Inside Bar on bar close
All alerts are non-repainting and designed for automation or discretionary execution.
5. Dashboard (Signal Memory System)
The dashboard provides context continuity beyond the signal bar itself.
What It Displays
Current Bar Signal
F2U, F2D, or “none”
Strength
Numeric score (e.g., 4/5)
Persists after the signal
Sequence
3→1, 1→3, or none
Persistence Logic
When a Failed 2 occurs:
Strength and direction are stored
They remain visible for a configurable number of minutes (default: 2)
This allows traders to:
Enter on pullbacks
Maintain context after the signal bar closes
Customization
Toggle dashboard on/off
Choose screen corner placement
Custom text color
⚠️ The dashboard is neutral:
It does not infer bias
It only reports factual, most-recent structure
6. Inputs Summary
Toggle labels for:
Failed 2
Sequences
Inside Bars
ATR length for strength normalization
Volume average length
Key level proximity threshold
Strength persistence duration (minutes)
Dashboard visibility and positioning

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.