OPEN-SOURCE SCRIPT
已更新

Swing Failure Signals [AlgoAlpha]

1 322
🟠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
  1. Sweep detection with a maximum lookback to avoid outdated levels
    快照
  2. CISD confirmation using candle structure and price expansion
    快照
  3. Alert conditions for bullish and bearish swing failures
    快照


🟠USAGE
  1. 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.
  2. 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.
  3. 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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。