PROTECTED SOURCE SCRIPT
Strat Combo Detector (ATH)

The Strat Combo Detector detects user-defined strat combos (inside/directional/outside bars) on a chosen higher timeframe and optionally marks examples for research.
What it does: This indicator accepts a flexible timeframe string (e.g., 12h, 1H, 3D, or minute counts like 60), parses a human-entered combo string such as 3-2-2 or 3-1, and checks whether the most-recent bars match the requested pattern.
Why it's helpful/unique:
How the bar types are defined:
Use the description above to reproduce the logic -- thresholds and ties are coded with <=/>= intentionally to include equal highs/lows.
How to use: Set Detection Timeframe, provide a combo. string like 2-3 or 3-2-2, toggle whether to include forming candles, and enable labels only if you want visible markers.
Limitations & notes: This is a detection/research helper, not an execution system. Alerts use a fixed message (Pine requires constant alert strings) -- customize alert text when creating an alert in the TradingView UI. Results depend on timeframe and symbol; verify with your own backtests.
Disclaimer: Not trading advice. Use risk management. Do your own backtesting.
What it does: This indicator accepts a flexible timeframe string (e.g., 12h, 1H, 3D, or minute counts like 60), parses a human-entered combo string such as 3-2-2 or 3-1, and checks whether the most-recent bars match the requested pattern.
Why it's helpful/unique:
- Supports flexible timeframe input (converts h suffix to minutes), making it easier to work with non-standard higher timeframe labels.
- Parses human-friendly combo strings and defends against invalid tokens.
- Offers an Include Open Bars option for users who want to detect forming candles vs only confirmed bars.
- Default publishing behavior keeps chart clean (labels off); there's an example-label mode to generate a small nuber of annotated examples for screenshots.
How the bar types are defined:
- 1=inside (high<=previous high and low >= previous low)
- 2=directional (neither inside nor outside)
- 3=outside (high > previous high and low < previous low).
Use the description above to reproduce the logic -- thresholds and ties are coded with <=/>= intentionally to include equal highs/lows.
How to use: Set Detection Timeframe, provide a combo. string like 2-3 or 3-2-2, toggle whether to include forming candles, and enable labels only if you want visible markers.
Limitations & notes: This is a detection/research helper, not an execution system. Alerts use a fixed message (Pine requires constant alert strings) -- customize alert text when creating an alert in the TradingView UI. Results depend on timeframe and symbol; verify with your own backtests.
Disclaimer: Not trading advice. Use risk management. Do your own backtesting.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.