OPEN-SOURCE SCRIPT
Telah dikemas kini TheStrat: Failed 2 + 2 Confirmation

TheStrat: Failed-2 + 2 Confirmation (2-2 option)
This indicator spots a classic Strat “failed 2 → 2” sequence on consecutive bars, and fires alerts only when both conditions are met:
Failed-2 bar on the prior candle
Failed 2-Down (F2D): Took the prior low but closed green
Failed 2-Up (F2U): Took the prior high but closed red
By default this is strict (excludes outside bars/3’s). You can toggle to allow 3’s if you prefer a looser definition.
Current bar is a clean “2”
2U = broke prior high only; 2D = broke prior low only (excludes 3’s).
Optional: Require flip so the second bar must reverse direction (F2D→2U for longs, F2U→2D for shorts). Turn this off if you want any 2 after a Failed-2.
What gets plotted
Tiny markers on each Failed-2 as they occur (F2U/F2D).
A label when the combo confirms on the next bar:
Bullish: F2D→2U (or F2D→2 if flip is off) below the bar
Bearish: F2U→2D (or F2U→2) above the bar
Alerts (set from the “Add Alert” dialog)
Failed2 + 2 (Bull): Prior bar was F2D; current bar is a 2 (flip optional).
Failed2 + 2 (Bear): Prior bar was F2U; current bar is a 2 (flip optional).
Inputs
Colors for Failed-2 markers and combo labels
Require flip (on by default) → focuses on true 2-2 reversals
Count outside bars (3) as Failed-2? (off by default) → stricter = fewer, cleaner signals
How to trade it (typical Strat style)
Bullish combo (F2D→2U): Entry on break of the combo bar’s high; risk under its low (or under the prior bar).
Bearish combo (F2U→2D): Entry on break of the combo bar’s low; risk above its high.
First target = prior pivot (“magnitude”), then nearby pivots/BF levels. Improve odds by aligning with time-frame continuity (e.g., day/week in your direction).
Notes / Best practices
Uses barstate.isconfirmed → signals/labels are based on closed bars to avoid repaint.
If you see too many Failed-2 tags, keep outside-bar counting OFF (strict mode).
This indicator spots a classic Strat “failed 2 → 2” sequence on consecutive bars, and fires alerts only when both conditions are met:
Failed-2 bar on the prior candle
Failed 2-Down (F2D): Took the prior low but closed green
Failed 2-Up (F2U): Took the prior high but closed red
By default this is strict (excludes outside bars/3’s). You can toggle to allow 3’s if you prefer a looser definition.
Current bar is a clean “2”
2U = broke prior high only; 2D = broke prior low only (excludes 3’s).
Optional: Require flip so the second bar must reverse direction (F2D→2U for longs, F2U→2D for shorts). Turn this off if you want any 2 after a Failed-2.
What gets plotted
Tiny markers on each Failed-2 as they occur (F2U/F2D).
A label when the combo confirms on the next bar:
Bullish: F2D→2U (or F2D→2 if flip is off) below the bar
Bearish: F2U→2D (or F2U→2) above the bar
Alerts (set from the “Add Alert” dialog)
Failed2 + 2 (Bull): Prior bar was F2D; current bar is a 2 (flip optional).
Failed2 + 2 (Bear): Prior bar was F2U; current bar is a 2 (flip optional).
Inputs
Colors for Failed-2 markers and combo labels
Require flip (on by default) → focuses on true 2-2 reversals
Count outside bars (3) as Failed-2? (off by default) → stricter = fewer, cleaner signals
How to trade it (typical Strat style)
Bullish combo (F2D→2U): Entry on break of the combo bar’s high; risk under its low (or under the prior bar).
Bearish combo (F2U→2D): Entry on break of the combo bar’s low; risk above its high.
First target = prior pivot (“magnitude”), then nearby pivots/BF levels. Improve odds by aligning with time-frame continuity (e.g., day/week in your direction).
Notes / Best practices
Uses barstate.isconfirmed → signals/labels are based on closed bars to avoid repaint.
If you see too many Failed-2 tags, keep outside-bar counting OFF (strict mode).
Nota Keluaran
updated chartNota Keluaran
Updated script for intrabar alertsNota Keluaran
Updated color for alert icon within chart.Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.