OPEN-SOURCE SCRIPT
تم تحديثه 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.
ملاحظات الأخبار
Thumbnailنص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
🚨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
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
🚨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
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.