OPEN-SOURCE SCRIPT
Ale tonkis Swing failure + 5M

Indicator Description: Ale Tonkis Swing Failure (SFP)
This script is an advanced Swing Failure Pattern (SFP) and Change in State of Delivery (CISD) indicator. It is designed to identify liquidity sweeps and market structure shifts across multiple timeframes simultaneously.
Key Features
Pivot Detection: Automatically identifies high and low pivot points based on a user-defined lookback period.
Liquidity Sweep Analysis: Detects when the price "sweeps" (goes beyond) a previous pivot high or low without closing significantly past it, signaling a potential reversal.
CISD (Change in State of Delivery): Tracks internal market structure shifts to confirm the SFP signal.
Multi-Timeframe (MTF) Dashboard: A real-time table in the top-right corner monitors the trend state across four different timeframes: M1, M3, M5, and M15.
Visual Alerts: The script uses dynamic bar coloring and labels (▲/▼) to signal entry points directly on the chart.
Technical Updates (M5 Integration)
The code has been specifically modified to include the 5-minute (M5) timeframe within the Multi-Timeframe logic:
Data Fetching: A new request.security call was added to retrieve the sfp_trend_state from the 5-minute interval.
Table Expansion: The display table was resized from 4 rows to 5 rows to accommodate the new data without overlapping.
UI Alignment: The M5 state is now positioned between M3 and M15, providing a smoother transition for traders analyzing mid-range scalping opportunities.
How to Read the Dashboard
LONG (Green): Indicates a bullish SFP has occurred and the trend remains positive on that timeframe.
SHORT (Red): Indicates a bearish SFP has occurred and the trend remains negative.
Empty/Black: No active SFP trend is currently detected on that specific timeframe.
This script is an advanced Swing Failure Pattern (SFP) and Change in State of Delivery (CISD) indicator. It is designed to identify liquidity sweeps and market structure shifts across multiple timeframes simultaneously.
Key Features
Pivot Detection: Automatically identifies high and low pivot points based on a user-defined lookback period.
Liquidity Sweep Analysis: Detects when the price "sweeps" (goes beyond) a previous pivot high or low without closing significantly past it, signaling a potential reversal.
CISD (Change in State of Delivery): Tracks internal market structure shifts to confirm the SFP signal.
Multi-Timeframe (MTF) Dashboard: A real-time table in the top-right corner monitors the trend state across four different timeframes: M1, M3, M5, and M15.
Visual Alerts: The script uses dynamic bar coloring and labels (▲/▼) to signal entry points directly on the chart.
Technical Updates (M5 Integration)
The code has been specifically modified to include the 5-minute (M5) timeframe within the Multi-Timeframe logic:
Data Fetching: A new request.security call was added to retrieve the sfp_trend_state from the 5-minute interval.
Table Expansion: The display table was resized from 4 rows to 5 rows to accommodate the new data without overlapping.
UI Alignment: The M5 state is now positioned between M3 and M15, providing a smoother transition for traders analyzing mid-range scalping opportunities.
How to Read the Dashboard
LONG (Green): Indicates a bullish SFP has occurred and the trend remains positive on that timeframe.
SHORT (Red): Indicates a bearish SFP has occurred and the trend remains negative.
Empty/Black: No active SFP trend is currently detected on that specific timeframe.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.