OPEN-SOURCE SCRIPT
Mis à jour Swing Failure Signals [AlgoAlpha]

🟠OVERVIEW
This script detects swing failure patterns by tracking how price interacts with recent swing highs and lows, then confirming those sweeps with a change in candle behavior. The goal is to highlight areas where price briefly breaks a key level, fails to continue, and then shifts direction. These events often occur around liquidity runs, where stops are triggered before price reverses. The script draws levels, colors bars, and prints clear markers to help visualize where these failures occur and when they are confirmed.
🟠CONCEPTS
The logic starts with pivot-based swing detection. Recent swing highs and lows are stored and monitored. When price trades beyond one of these levels within a defined historical window, it is treated as a sweep. A sweep alone is not enough. The script then waits for a Change in State of Delivery (CISD), which is defined by a shift in candle structure that shows follow-through in the opposite direction. A tolerance filter measures how far price traveled beyond the level relative to the reaction that followed. If the reaction is strong enough and happens within a limited number of bars, the sweep is validated as a swing failure. In short: the swing defines the reference, the sweep shows intent, and the CISD confirms acceptance or rejection.
🟠FEATURES
🟠USAGE
This script detects swing failure patterns by tracking how price interacts with recent swing highs and lows, then confirming those sweeps with a change in candle behavior. The goal is to highlight areas where price briefly breaks a key level, fails to continue, and then shifts direction. These events often occur around liquidity runs, where stops are triggered before price reverses. The script draws levels, colors bars, and prints clear markers to help visualize where these failures occur and when they are confirmed.
🟠CONCEPTS
The logic starts with pivot-based swing detection. Recent swing highs and lows are stored and monitored. When price trades beyond one of these levels within a defined historical window, it is treated as a sweep. A sweep alone is not enough. The script then waits for a Change in State of Delivery (CISD), which is defined by a shift in candle structure that shows follow-through in the opposite direction. A tolerance filter measures how far price traveled beyond the level relative to the reaction that followed. If the reaction is strong enough and happens within a limited number of bars, the sweep is validated as a swing failure. In short: the swing defines the reference, the sweep shows intent, and the CISD confirms acceptance or rejection.
🟠FEATURES
- Sweep detection with a maximum lookback to avoid outdated levels
- CISD confirmation using candle structure and price expansion
- Alert conditions for bullish and bearish swing failures
🟠USAGE
- Setup: Add the script to your chart. It works on any market and timeframe. Lower timeframes highlight intraday liquidity runs, while higher timeframes show structural failures. Start with the default inputs before adjusting.
- Read the chart: A bullish swing failure occurs when price sweeps a prior low, then reverses and confirms with a bullish CISD. A bearish swing failure is the opposite, sweeping a prior high and confirming with a bearish CISD. Dashed lines mark the swept swing. Solid lines mark the CISD level. Bars are colored while the SFP state is active.
- Settings that matter: Increasing Pivot Detection Length finds more significant swings but fewer signals. Reducing Max Pivot Point Edge limits how far back sweeps are allowed, keeping signals more current. The Patience setting controls how many bars are allowed for confirmation after a sweep. The Trend Noise Filter raises or lowers how strong the reaction must be to qualify as a valid failure.
Notes de version
ThumbnailScript open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
🚨Get premium (50% OFF DISCOUNT EXPIRES SOON): algoalpha.io
🛜Get FREE signals: discord.gg/xCmqTVRexz
💡Tutorials: youtube.com/@AlgoAlpha
🛜Get FREE signals: discord.gg/xCmqTVRexz
💡Tutorials: youtube.com/@AlgoAlpha
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
🚨Get premium (50% OFF DISCOUNT EXPIRES SOON): algoalpha.io
🛜Get FREE signals: discord.gg/xCmqTVRexz
💡Tutorials: youtube.com/@AlgoAlpha
🛜Get FREE signals: discord.gg/xCmqTVRexz
💡Tutorials: youtube.com/@AlgoAlpha
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.