OPEN-SOURCE SCRIPT
STRAT 3-2-2 (30m) • Upcoming / Approach / Entry + Alerts

This indicator is built for The STRAT trading method, specifically the 3-2-2 reversal pattern. It monitors price action on the 30-minute timeframe (HTF = 30m) and visually/alert-wise highlights where a 3-2-2 setup, approach, or entry trigger occurs.
---
⚙️ How it works
1. Detects bar types:
3 (Outside Bar) = range breaks both high & low of the previous bar
2u (Up bar) = higher high, not outside
2d (Down bar) = lower low, not outside
1 (Inside bar) = fully contained within prior bar
2. Looks for 3-2-2 setups:
Bullish 3-2-2 = 3 → 2d → 2u (expect reversal UP)
Bearish 3-2-2 = 3 → 2u → 2d (expect reversal DOWN)
3. Defines trigger levels:
Bullish trigger = high of the first “2d” bar
Bearish trigger = low of the first “2u” bar
4. Signals 3 phases:
Upcoming: pattern is forming, second “2” hasn’t triggered yet
Approach: price comes within 50% (adjustable) of the trigger level
Entry: price breaks the trigger (actual reversal confirmation)
5. Visualization:
Labels above/below candles show “Approach” and “Entry”
Background or bar colors (toggle in settings) highlight Setup / Approach / Entry
Optional dotted line marks the trigger level for clarity
---
🔔 Alerts
Two alert systems are built in:
1. Safe static conditions (for normal TradingView alert setup):
APPROACH: Bullish 3-2-2 (30m)
APPROACH: Bearish 3-2-2 (30m)
ENTRY: Bullish 3-2-2 (30m)
ENTRY: Bearish 3-2-2 (30m)
2. Dynamic messages (using alert() calls with price info):
If you create an alert with “Any alert() function call”, the pop-up will include the trigger price.
---
📋 Inputs (Settings)
Signal timeframe (HTF) → default 30m
Confirm signals at HTF bar close → waits for bar close (non-repainting)
Approach = % of first '2' bar range → default 50%
Show labels → On/Off
Color candles instead of background → toggle between candle color vs. chart background
---
⚙️ How it works
1. Detects bar types:
3 (Outside Bar) = range breaks both high & low of the previous bar
2u (Up bar) = higher high, not outside
2d (Down bar) = lower low, not outside
1 (Inside bar) = fully contained within prior bar
2. Looks for 3-2-2 setups:
Bullish 3-2-2 = 3 → 2d → 2u (expect reversal UP)
Bearish 3-2-2 = 3 → 2u → 2d (expect reversal DOWN)
3. Defines trigger levels:
Bullish trigger = high of the first “2d” bar
Bearish trigger = low of the first “2u” bar
4. Signals 3 phases:
Upcoming: pattern is forming, second “2” hasn’t triggered yet
Approach: price comes within 50% (adjustable) of the trigger level
Entry: price breaks the trigger (actual reversal confirmation)
5. Visualization:
Labels above/below candles show “Approach” and “Entry”
Background or bar colors (toggle in settings) highlight Setup / Approach / Entry
Optional dotted line marks the trigger level for clarity
---
🔔 Alerts
Two alert systems are built in:
1. Safe static conditions (for normal TradingView alert setup):
APPROACH: Bullish 3-2-2 (30m)
APPROACH: Bearish 3-2-2 (30m)
ENTRY: Bullish 3-2-2 (30m)
ENTRY: Bearish 3-2-2 (30m)
2. Dynamic messages (using alert() calls with price info):
If you create an alert with “Any alert() function call”, the pop-up will include the trigger price.
---
📋 Inputs (Settings)
Signal timeframe (HTF) → default 30m
Confirm signals at HTF bar close → waits for bar close (non-repainting)
Approach = % of first '2' bar range → default 50%
Show labels → On/Off
Color candles instead of background → toggle between candle color vs. chart background
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。