OPEN-SOURCE SCRIPT
更新済 [Statistics] killzone SFP

SFP Statistics (ICT Sessions)
This indicator automatically finds and draws the high and low of the Asia, London, and New York trading sessions. It then hunts for Swing Failure Patterns (SFPs) that sweep these key session levels.
The main purpose of this script is to gather statistics on when these high-probability SFPs occur, allowing you to map out and identify the times of day when they are most frequent.
How to Use This Indicator
Set Your SFP Timeframe: In the settings, choose the timeframe you want to hunt for SFPs on (e.g., 1H, 15m). Important: You must also set your main chart to this exact same timeframe for the statistics to be collected correctly.
Define Your Sessions: Go to the "Session Definitions" tab.
Set the Global Timezone to your preferred trading timezone (e.g., "America/New_York"). This controls all session times and table times.
Adjust the start and end times for Asia, London, and NY AM sessions.
You can turn off sessions you don't want to track (like NY Lunch or NY PM).
You can also change the colors and text style for the session boxes here.
Set Confirmation Bars: In "SFP Engine Settings," the "Confirmation Bars" (default is 2) defines how many bars must close after the SFP bar without invalidating the level. An SFP is only "confirmed" and drawn after this period.
0 = Confirms immediately on the SFP candle's close.
2 = Confirms 2 bars after the SFP candle's close.
Read the Statistics: The "Custom SFP Statistics" table will appear on your chart. This table logs every confirmed SFP and tells you:
Which time of day they happen most.
How many were Bearish (swept a high) vs. Bullish (swept a low).
It's set by default to show the "Top 20" most frequent times, sorted chronologically.
Filter Your Chart (Optional): If your chart feels cluttered, go to "Visual Time Filter" and turn it ON.
Set a time window (e.g., "09:30-11:00").
The indicator will now only draw SFP signals that occurred within that specific time window. This is perfect for focusing on a single killzone.
How to Set Up Alerts
You can set up server-side alerts to be notified every time a new SFP is confirmed.
Check the "Enable SFP Alerts" box at the top of the indicator's settings.
Click the "Alert" button (alarm clock icon) on the TradingView toolbar.
In the "Condition" dropdown, select "SFP Statistics (ICT Sessions)".
In the second dropdown, choose "Any alert() function call".
Most Important Step: In the "Message" box, delete any default text and type in this exact placeholder:
{{alert_message}}
Set the trigger to "Once Per Bar Close".
Click "Create".
How Alerts Work (Triggers & Filtering)
Trigger: Alerts are tied to the confirmed signal. An alert will only fire after your "Confirmation Bars" have passed and the SFP is locked in. This prevents you from getting alerts on fake-outs.
Alert Filtering: The alerts are linked to the "Visual Time Filter". If you turn on the Visual Time Filter (e.g., to 09:30-11:00), you will only receive alerts for SFPs that are confirmed within that time window. If an SFP happens at 14:00, the script will ignore it, it will not be drawn, and it will not send you an alert. This allows you to get alerts only for the session you are actively trading.
Note: This is a first draft of this indicator. I will continue to work on it and improve it over time, as it may still contain small bugs.
Acknowledgements:
A big thank you to TFO (tradeforopp). The session detection logic and the visual style for the session boxes were adapted from his excellent "ICT Killzones & Pivots [TFO]" indicator.
This indicator automatically finds and draws the high and low of the Asia, London, and New York trading sessions. It then hunts for Swing Failure Patterns (SFPs) that sweep these key session levels.
The main purpose of this script is to gather statistics on when these high-probability SFPs occur, allowing you to map out and identify the times of day when they are most frequent.
How to Use This Indicator
Set Your SFP Timeframe: In the settings, choose the timeframe you want to hunt for SFPs on (e.g., 1H, 15m). Important: You must also set your main chart to this exact same timeframe for the statistics to be collected correctly.
Define Your Sessions: Go to the "Session Definitions" tab.
Set the Global Timezone to your preferred trading timezone (e.g., "America/New_York"). This controls all session times and table times.
Adjust the start and end times for Asia, London, and NY AM sessions.
You can turn off sessions you don't want to track (like NY Lunch or NY PM).
You can also change the colors and text style for the session boxes here.
Set Confirmation Bars: In "SFP Engine Settings," the "Confirmation Bars" (default is 2) defines how many bars must close after the SFP bar without invalidating the level. An SFP is only "confirmed" and drawn after this period.
0 = Confirms immediately on the SFP candle's close.
2 = Confirms 2 bars after the SFP candle's close.
Read the Statistics: The "Custom SFP Statistics" table will appear on your chart. This table logs every confirmed SFP and tells you:
Which time of day they happen most.
How many were Bearish (swept a high) vs. Bullish (swept a low).
It's set by default to show the "Top 20" most frequent times, sorted chronologically.
Filter Your Chart (Optional): If your chart feels cluttered, go to "Visual Time Filter" and turn it ON.
Set a time window (e.g., "09:30-11:00").
The indicator will now only draw SFP signals that occurred within that specific time window. This is perfect for focusing on a single killzone.
How to Set Up Alerts
You can set up server-side alerts to be notified every time a new SFP is confirmed.
Check the "Enable SFP Alerts" box at the top of the indicator's settings.
Click the "Alert" button (alarm clock icon) on the TradingView toolbar.
In the "Condition" dropdown, select "SFP Statistics (ICT Sessions)".
In the second dropdown, choose "Any alert() function call".
Most Important Step: In the "Message" box, delete any default text and type in this exact placeholder:
{{alert_message}}
Set the trigger to "Once Per Bar Close".
Click "Create".
How Alerts Work (Triggers & Filtering)
Trigger: Alerts are tied to the confirmed signal. An alert will only fire after your "Confirmation Bars" have passed and the SFP is locked in. This prevents you from getting alerts on fake-outs.
Alert Filtering: The alerts are linked to the "Visual Time Filter". If you turn on the Visual Time Filter (e.g., to 09:30-11:00), you will only receive alerts for SFPs that are confirmed within that time window. If an SFP happens at 14:00, the script will ignore it, it will not be drawn, and it will not send you an alert. This allows you to get alerts only for the session you are actively trading.
Note: This is a first draft of this indicator. I will continue to work on it and improve it over time, as it may still contain small bugs.
Acknowledgements:
A big thank you to TFO (tradeforopp). The session detection logic and the visual style for the session boxes were adapted from his excellent "ICT Killzones & Pivots [TFO]" indicator.
リリースノート
.オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。