OPEN-SOURCE SCRIPT
Zaktualizowano Daily Swing Probability Ladder with Provisional Reversal

Full TradingView Description:
Daily Swing Probability Ladder with Provisional Reversal is a structure-based swing analysis indicator designed primarily for daily charts. It combines confirmed swing pivot detection, volatility-adjusted support and resistance zones, historical swing statistics and a real-time provisional reversal engine.
The goal of the script is to answer a practical trading question:
Where is price statistically likely to move next based on prior completed swings from similar structural conditions?
Unlike static Fibonacci levels or fixed-percentage targets, this indicator builds a probability ladder from the instrument’s own historical swing behavior. Each displayed level shows a projected price and the empirical hit rate associated with that level.
Example output:
$7.02 | 89.7%
$6.72 | 75.9%
$6.43 | 58.6%
$6.18 | 51.7%
These are not theoretical probabilities. They are empirical hit rates derived from the selected rolling sample of prior completed swings.
Core Components
1. Confirmed Pivot Structure
The script uses confirmed swing highs and swing lows to establish the underlying market structure. Once a pivot is confirmed, the script records the completed swing magnitude and duration.
Confirmed pivot zones are used to create structural support and resistance areas.
2. Probability Ladder
The probability ladder projects forward price levels using the historical distribution of prior same-direction swings.
When the current structural direction is upward, the script references prior low-to-high swings. When the current structural direction is downward, it references prior high-to-low swings.
Each ladder level includes:
Projected price
Historical hit rate
Reached or pending status
Current move percentile
Current active swing state
3. Provisional Reversal Engine
Confirmed pivots are reliable, but they are naturally delayed. To make the indicator more useful in real time, the script includes a provisional reversal mode.
This allows the forecast to flip before a formal pivot confirms when price shows early reversal behavior such as:
Consecutive bullish or bearish candles
Close beyond a recent high or low
Minimum reversal magnitude based on Average True Range (ATR) or percentage movement
Optional Exponential Moving Average (EMA) filter
This helps the indicator respond when a pullback has likely ended and a new swing attempt is developing.
4. Volatility-Adjusted Zones
Support and resistance zones are built from confirmed pivots and scaled using ATR. This allows zones to expand or contract based on the instrument’s volatility profile.
High-volatility names can use wider zones. Broad-market exchange-traded funds (ETFs) can usually use tighter zones.
5. Summary Table
The table displays the current forecast state, regime, sample size, anchor price, active move, current percentile, next level and probability ladder in a dark-mode optimized format.
Table Fields
Forecast: Current directional forecast, such as Swing High, Swing Low, Provisional Swing High or Provisional Swing Low.
Regime: Trend context based on the 50-day and 200-day simple moving averages.
Sample: Number of historical completed swings used for the current probability calculation.
Anchor: The price from which the active swing projection is measured.
Active Move: Current percentage move from the active anchor.
Current Percentile: Where the current move ranks versus prior completed swings.
Hit Rate: Historical percentage of prior swings that reached or exceeded the current move.
Next Level: The next pending probability level.
Provisional: Shows whether the script is using confirmed structure or live provisional reversal logic.
Suggested Use
This indicator is best used as a structural and probabilistic swing analysis tool, not as a standalone buy or sell signal.
Higher-quality setups usually occur when the probability ladder aligns with:
Broader trend regime
Support or resistance zones
Volume confirmation
Relative strength
Moving average structure
Market index direction
Suggested Settings
For broad ETFs such as SPY, QQQ and IWM:
Confirmed Pivot Length: 6 to 8
ATR Length: 50
Zone Width: 0.50 to 0.75 ATR
Reversal Count: 2 candles
Reversal ATR Trigger: 0.50
Reversal Percent Trigger: 1.0% to 2.0%
For high-beta stocks:
Confirmed Pivot Length: 8 to 12
ATR Length: 50
Zone Width: 0.75 to 1.00 ATR
Reversal Count: 2 candles
Reversal ATR Trigger: 0.50 to 0.75
Reversal Percent Trigger: 2.0% to 4.0%
Important Notes
Confirmed pivot zones do not appear until the required confirmation bars have passed. This is intentional and helps preserve structural integrity.
Provisional reversal mode is more responsive, but it is a live condition. It can change as price action develops, especially before the current candle closes.
The probability levels are based on historical swing behavior. They do not guarantee that future price will reach any projected level.
This script is intended for technical analysis, trade planning and market structure assessment. It should be used with disciplined risk management and independent confirmation.
Daily Swing Probability Ladder with Provisional Reversal is a structure-based swing analysis indicator designed primarily for daily charts. It combines confirmed swing pivot detection, volatility-adjusted support and resistance zones, historical swing statistics and a real-time provisional reversal engine.
The goal of the script is to answer a practical trading question:
Where is price statistically likely to move next based on prior completed swings from similar structural conditions?
Unlike static Fibonacci levels or fixed-percentage targets, this indicator builds a probability ladder from the instrument’s own historical swing behavior. Each displayed level shows a projected price and the empirical hit rate associated with that level.
Example output:
$7.02 | 89.7%
$6.72 | 75.9%
$6.43 | 58.6%
$6.18 | 51.7%
These are not theoretical probabilities. They are empirical hit rates derived from the selected rolling sample of prior completed swings.
Core Components
1. Confirmed Pivot Structure
The script uses confirmed swing highs and swing lows to establish the underlying market structure. Once a pivot is confirmed, the script records the completed swing magnitude and duration.
Confirmed pivot zones are used to create structural support and resistance areas.
2. Probability Ladder
The probability ladder projects forward price levels using the historical distribution of prior same-direction swings.
When the current structural direction is upward, the script references prior low-to-high swings. When the current structural direction is downward, it references prior high-to-low swings.
Each ladder level includes:
Projected price
Historical hit rate
Reached or pending status
Current move percentile
Current active swing state
3. Provisional Reversal Engine
Confirmed pivots are reliable, but they are naturally delayed. To make the indicator more useful in real time, the script includes a provisional reversal mode.
This allows the forecast to flip before a formal pivot confirms when price shows early reversal behavior such as:
Consecutive bullish or bearish candles
Close beyond a recent high or low
Minimum reversal magnitude based on Average True Range (ATR) or percentage movement
Optional Exponential Moving Average (EMA) filter
This helps the indicator respond when a pullback has likely ended and a new swing attempt is developing.
4. Volatility-Adjusted Zones
Support and resistance zones are built from confirmed pivots and scaled using ATR. This allows zones to expand or contract based on the instrument’s volatility profile.
High-volatility names can use wider zones. Broad-market exchange-traded funds (ETFs) can usually use tighter zones.
5. Summary Table
The table displays the current forecast state, regime, sample size, anchor price, active move, current percentile, next level and probability ladder in a dark-mode optimized format.
Table Fields
Forecast: Current directional forecast, such as Swing High, Swing Low, Provisional Swing High or Provisional Swing Low.
Regime: Trend context based on the 50-day and 200-day simple moving averages.
Sample: Number of historical completed swings used for the current probability calculation.
Anchor: The price from which the active swing projection is measured.
Active Move: Current percentage move from the active anchor.
Current Percentile: Where the current move ranks versus prior completed swings.
Hit Rate: Historical percentage of prior swings that reached or exceeded the current move.
Next Level: The next pending probability level.
Provisional: Shows whether the script is using confirmed structure or live provisional reversal logic.
Suggested Use
This indicator is best used as a structural and probabilistic swing analysis tool, not as a standalone buy or sell signal.
Higher-quality setups usually occur when the probability ladder aligns with:
Broader trend regime
Support or resistance zones
Volume confirmation
Relative strength
Moving average structure
Market index direction
Suggested Settings
For broad ETFs such as SPY, QQQ and IWM:
Confirmed Pivot Length: 6 to 8
ATR Length: 50
Zone Width: 0.50 to 0.75 ATR
Reversal Count: 2 candles
Reversal ATR Trigger: 0.50
Reversal Percent Trigger: 1.0% to 2.0%
For high-beta stocks:
Confirmed Pivot Length: 8 to 12
ATR Length: 50
Zone Width: 0.75 to 1.00 ATR
Reversal Count: 2 candles
Reversal ATR Trigger: 0.50 to 0.75
Reversal Percent Trigger: 2.0% to 4.0%
Important Notes
Confirmed pivot zones do not appear until the required confirmation bars have passed. This is intentional and helps preserve structural integrity.
Provisional reversal mode is more responsive, but it is a live condition. It can change as price action develops, especially before the current candle closes.
The probability levels are based on historical swing behavior. They do not guarantee that future price will reach any projected level.
This script is intended for technical analysis, trade planning and market structure assessment. It should be used with disciplined risk management and independent confirmation.
Informacje o Wersji
Update SummaryThis update improves the Daily Swing Probability Ladder by adding a volume-confirmation layer, cleaner real-time reversal logic and stronger signal-quality context. The script now combines confirmed swing structure, empirical probability levels, provisional reversal detection and volume participation scoring to make the forecast more useful on daily charts.
Key Changes
Added a Volume Confirmation Layer designed to evaluate whether the current move has meaningful participation behind it. The script now calculates Relative Volume (RVOL), volume thrust versus the selected volume average, On-Balance Volume (OBV) trend and directional candle confirmation.
Added a Volume Score from 0 to 4. The score helps classify whether the active forecast is weak, confirming or strong from a volume perspective. This score is displayed in the summary table and can optionally be shown directly in the ladder labels.
Added an optional setting to require volume confirmation before triggering a provisional reversal. This allows users to make the reversal engine more selective by requiring a minimum volume score before the script flips from a structural swing-low forecast to a provisional swing-high forecast, or vice versa.
Improved the Provisional Reversal Engine. The script can now react before a fully confirmed pivot prints by using consecutive candle direction, short-term breakout behavior, minimum reversal movement, optional Exponential Moving Average (EMA) filtering and optional volume confirmation.
Updated the probability ladder so each level continues to show a projected price, historical hit rate and reached or pending status. The ladder remains based on empirical historical swing behavior rather than fixed theoretical targets.
Improved the dark-mode summary table. The table now includes forecast direction, regime, sample size, active move, current percentile, hit rate, next level, provisional mode status, RVOL, volume score and OBV-based volume bias.
Added alert conditions for bullish and bearish provisional reversals. Alerts are tied to the same structure and volume settings used by the script.
Purpose of the Update
The goal of this update is to make the script more responsive while still preserving the integrity of confirmed swing structure. Confirmed pivots remain the foundation for structural support and resistance, while the provisional reversal engine helps the indicator respond faster when price action begins to reverse before a formal pivot is confirmed.
The added volume layer is intended to improve signal quality. It does not replace the probability ladder. Instead, it helps determine whether the current forecast is supported by participation, accumulation or distribution pressure.
Important Notes
The probability levels are based on prior completed swing behavior for the selected ticker and timeframe. They are not guaranteed price targets.
The volume score is a confirmation tool, not a standalone buy or sell signal.
Provisional reversals can change as price action develops. Confirmed pivots remain slower but more structurally reliable.
This indicator is intended for daily swing analysis, trade planning and market structure review. It should be used with risk management and independent confirmation.
Informacje o Wersji
Publication Update SummaryThis update improves the model’s ability to distinguish between a valid continuation swing and a developing recovery move. The prior version could remain locked into a provisional downswing or upswing until the original anchor level was fully invalidated, even when price action had already started to reverse. The revised version adds a more adaptive recovery detection layer so the indicator can respond earlier when market structure shifts.
Key Updates
Added score-based recovery flip logic
The model now evaluates recovery conditions using a weighted score instead of relying only on strict consecutive candle rules. This allows the script to identify a developing recovery move before price fully breaks the original swing anchor.
Improved provisional swing behavior
The indicator no longer stays locked into a stale provisional swing as rigidly. If price begins to recover with enough confirmation, the model can flip from a provisional downswing into a recovery upswing, or from a provisional upswing into a recovery downswing.
Separated extreme move from live move
The table now distinguishes between the maximum move reached during the active swing and the current live move from the anchor. This makes the output clearer when price has already bounced from a prior low or pulled back from a prior high.
Added recovery score inputs
New inputs allow users to control how sensitive the recovery flip should be. The recovery score considers rebound magnitude, Exponential Moving Average (EMA) reclaim or loss, directional close momentum, range momentum, breakout behavior and optional volume confirmation.
Improved trend-change recognition
The model now evaluates higher closes, lower closes, higher-high / higher-low behavior and lower-high / lower-low behavior. This is more structurally useful than relying only on green or red candles.
Added recovery mode labeling
The summary table now identifies whether the model is operating in Structural, Provisional, or Recovery mode. This makes it easier to understand whether the displayed probability ladder is based on the original confirmed swing, a provisional reversal, or a developing recovery move.
Enhanced volume context
Volume remains optional, but the recovery engine can now include Relative Volume (RVOL), On-Balance Volume (OBV), thrust volume and candle-direction volume confirmation as part of the score. This gives users the choice between faster signals or more conservative volume-confirmed flips.
Why These Updates Were Made
The main objective was to reduce stale directional projections. In the prior version, a provisional swing could remain active even after multiple days of opposing price movement because the script required a full anchor invalidation before changing direction. That created misleading outputs in situations where price had clearly started to recover but had not yet fully broken the prior swing high or low.
The revised version makes the model more adaptive. It still respects the original swing structure, but it now recognizes that recoveries often begin before full structural confirmation appears. This improves the practical usefulness of the probability ladder by aligning the displayed forecast more closely with current price behavior.
Publication Note:
This version adds a score-based recovery flip engine designed to prevent stale provisional swing projections. The model now separates extreme swing movement from live movement, adds Recovery Mode labeling and evaluates multiple recovery conditions including Average True Range (ATR) or percent rebound, EMA reclaim or loss, directional close momentum, range expansion, short-term breakout behavior and optional volume confirmation. The result is a more adaptive probability ladder that can shift from a provisional swing-low or swing-high forecast into a recovery forecast when current price action supports a directional change.
Informacje o Wersji
Publishing SummaryThis update improves the Daily Swing Probability Ladder by adding a continuation framework for situations where price has already reached all standard probability targets. In prior versions, once every base ladder level was hit, the model stopped producing a forward-looking price expectation and displayed “Reached All.” This version now continues updating projected movement through a dedicated Continuation Extension Engine.
Key Updates
Added Continuation Extension Mode that activates automatically after all base probability levels have been reached.
Added historical tail-probability levels using lower hit-rate targets, including 15%, 10%, 5% and 2% extension levels.
Added Average True Range (ATR) rolling continuation levels so the model can continue projecting probable price movement even when price exceeds the historical sample range.
Added a new setting to choose the extension method:
Historical Tail Then ATR Roll
Historical Tail Only
ATR Roll Only
Updated the summary table to separate the original Base Ladder from the new Extension Ladder, making it easier to distinguish normal swing targets from extended-move projections.
Updated the “Next Level” logic so the model now shows whether the next projected level comes from the base ladder or the extension ladder.
Added optional chart controls to show or hide extension levels and to hide already-reached base levels once extension mode is active.
Added a new alert condition for when Continuation Extension Mode becomes active.
Practical Improvement
The indicator now handles strong momentum moves more effectively. Instead of becoming static after all standard targets are hit, it continues adapting to live price action and provides updated extension levels based on historical swing distribution and current volatility. This makes the model more useful for high-momentum breakouts, trend extensions and stretched swing conditions where price continues moving beyond the original probability ladder.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.