Sentinel Cascade [JOAT]Sentinel Cascade
Sentinel Cascade is a three-stage adaptive Supertrend overlay. Where a classic Supertrend uses one fixed-ATR band, this script chains three Supertrend stages on top of each other and modulates each stage's width with a different regime signal. Bands tighten when the market is trending cleanly and widen when volatility expands or behavior turns mean-reverting.
What makes it different
A standard Supertrend gives one binary direction state. Sentinel Cascade gives three nested direction states that act like a confluence stack. Alignment of all three is the highest-conviction read.
The ATR feeding the Supertrend is smoothed through a Kaufman Efficiency Ratio. Trend-efficient periods get a faster ATR response. Choppy periods get a slower response.
Stage 2's width scales with a volume Z-score. High-volume bars widen the band so transient noise is less likely to flip the stage.
Stage 3's width scales with a lightweight two-point Hurst estimator (R/S over short and long windows). Trending Hurst above 0.5 widens. Mean-reverting Hurst below 0.5 tightens.
A Sentinel pulse fires only when Stage 3 flips AND Stage 2 confirms the new direction within three bars. A coincidence filter for higher-quality regime shifts.
How it works
Compute a basis price as the midpoint of the recent highest high and lowest low.
Compute a KAMA-smoothed ATR from the basis.
Build Stage 1 as a Supertrend on the basis using the KAMA-ATR and the Stage 1 factor.
Build Stage 2 as a Supertrend on Stage 1's output, with its factor multiplied by a clamped volume-Z modulator.
Build Stage 3 as a Supertrend on Stage 2's output, with its factor multiplied by a clamped Hurst modulator.
Track the Sentinel pulse, the ATR-percentile regime (squeeze / normal / expansion), and a running count of intraday Stage 3 flips.
Reading the chart
Three stacked trend lines. Stage 1 thickest, Stage 3 thinnest. Colors flip between bull and bear on direction changes.
A gradient ribbon between Stage 1 (or Stage 2 by user choice) and Stage 3 brightens when the stack is spread, fades when it converges.
An optional iridescent candle recolor scales tint with distance from Stage 3.
A horizontal sight-line projects Stage 3's current level back into history so past respect or rejection at that level is visible.
Persistent flip markers record each Stage 3 flip and retroactively append an OK or FAIL tag after a user-defined persistence window.
A right-edge state block summarizes alignment of all three stages plus the ATR squeeze and expansion read.
Signals
Stage 3 bull / bear shift (any flip)
Cascade alignment (all three stages agree)
Stage 2 retest / bounce inside an active trend
ATR squeeze and expansion entry (percentile-based)
All signals are gated on barstate.isconfirmed or barstate.ishistory. No future-bar referencing. No lookahead_on.
Inputs
Cascade : range basis length, ATR period, KAMA efficiency length, Stage 1 / 2 / 3 factors.
Regime : volume-Z lookback, Hurst short / long windows.
Visual : bullish color, bearish color, toggles for ribbon, sentinel pulse, iridescent candles, bounce markers, ribbon anchor.
On-chart : stage value labels, flip timeline labels, squeeze background tint, Stage 3 cloud, sight-line, state block, daily flip counter.
Dashboard : position, size, watermark row.
How traders use this
Trend continuation : take in the direction of Stage 3 when price retests Stage 2 from the trending side.
High-conviction entries : wait for cascade alignment (all three stages agree) before sizing up.
Mean-reversion fades : when Hurst is clearly below 0.5 and a Stage 3 flip prints near recent extremes, the new trend is statistically less likely to persist.
Volatility context : ATR percentile regime tells you whether the move is happening in a compressed, normal, or extended volatility environment. Sizing should account for that.
Limitations
The two-point Hurst estimator is a fast approximation, not the full rescaled-range statistic. It is monotonically meaningful but is not a precise persistence coefficient.
Like every Supertrend variant, this is a trend-following construct. It is best on instruments with clear directional regimes and worst in extended choppy ranges.
Pivots and percentile-based regime classifications need warm-up bars before their values stabilize.
Past behavior is not a guarantee of future behavior. No indicator can remove market uncertainty.
Compatibility
Pine Script v6, single-file open-source indicator. Works on any symbol and any timeframe. Uses no request.security calls. Non-repainting beyond the normal Supertrend right-bar reactivity inherent to band ratchet logic.
Defaults
Mint bullish color, red bearish color, top-right medium dashboard, all on-chart visualizations on. Open the inputs panel to tune for your instrument or to declutter for screenshots.
Indicator

Compression Shift Index [JOAT]Compression Shift Index
Introduction
Compression Shift Index is an open-source Pine Script v6 indicator designed to detect transitions between compression and displacement. It measures whether price is storing energy in a tight state, whether that energy is beginning to release directionally, and whether the release is supported by enough pressure and travel efficiency to matter.
The problem this indicator solves is timing. Traders often recognize trend after the move is already mature, or they chase weak momentum bursts that never become true displacement. Compression Shift Index is built to distinguish between quiet compression, directional pressure, and confirmed shift conditions so the user can see whether price is merely active or whether a real state change is underway.
The script lives in its own pane, but it also projects tactical shift ranges onto the main chart. That means it can work as both a state engine and a visual execution aid. The pane handles classification and scoring. The overlay range preserves the high, low, and midpoint of the most recent active shift so price can be read against the trigger zone directly on the chart.
Rather than relying on one oscillator reading, the script blends moving-average spread, RSI of momentum, ATR expansion, path efficiency, and compression mathematics. The result is not a conventional trend tool. It is a state-transition tool built to show when stored pressure is becoming directional opportunity.
Core Concepts
1. Compression Score
Compression is measured by comparing the recent price range to ATR-normalized movement over a configurable window. As the range contracts relative to expected volatility, the compression score rises.
float compressionRatio = safeDiv(ta.highest(high, compressionLength) - ta.lowest(low, compressionLength), ta.atr(compressionLength) * compressionLength) * 100.0
float compressionScore = clamp(100.0 - compressionRatio, 0, 100)
This means the script is not labeling compression by candle size alone. It evaluates the market relative to its own volatility conditions.
2. Displacement Score
Displacement is measured through moving-average spread magnitude, RSI-based pressure away from neutrality, and fast-versus-slow ATR expansion. A high displacement score means price is no longer just compressed. It is pushing with enough directional force to deserve attention.
3. Pressure Confirmation
Directional pressure requires more than a large reading. Bullish pressure needs positive spread and price acceptance above the fast EMA. Bearish pressure requires the opposite. This creates a separation between raw movement and directional pressure that is actually aligned with the current path of price.
4. Shift Range Memory
When a confirmed bull or bear shift occurs, the script stores the initiating bar’s high and low, then extends that range for a configurable number of bars. As new bars arrive, the active range updates its upper and lower boundaries.
This transforms the shift from a momentary signal into a tactical map. The trader can judge whether price is holding inside the shift range, stretching away from it, or failing back through the structure.
5. Quality And Travel Efficiency
Not every shift is equal. The script measures path efficiency by comparing net travel to the cumulative path traveled across the efficiency window. That helps distinguish efficient directional release from noisy back-and-fill movement.
When displacement, pressure, and efficiency all align, the quality score rises. This is especially useful for separating impulsive continuation from unstable burst behavior.
Features
Compression and displacement state engine: Differentiates quiet conditions from directional release
Bull and bear shift detection: Confirms directional shifts only after displacement and pressure criteria align
Tactical overlay range: Projects the active shift high, low, and midpoint onto the main chart
Ribbon bias display: Adds a visual ribbon showing directional pressure inside the pane
Travel efficiency scoring: Measures whether displacement is clean or noisy
State backdrop and candle tinting: Tints both pane and chart context according to the current state
Detailed dashboard: Publishes compression, displacement, ATR ratio, heat, range, stretch, velocity, efficiency, quality, and persistence
Confirmed-bar alerts: Includes compression, bull shift, bear shift, pressure, release, fade, and quality-state alerts
Data-window exports: Makes many internal scores accessible without adding extra plots to the pane
Range-aging logic: Tracks how long the active shift has been in effect
Visual Elements
Pane state curves: The net shift, compression, and displacement lines provide a layered read of current state
Ribbon bias fill: The pane ribbon helps show whether directional pressure is leaning bullish or bearish before full shift confirmation
Overlay shift range: The active high, low, and midpoint are projected onto the price chart for tactical context
Backdrop and candle tinting: The indicator colors both pane and chart state to make transitions easier to identify at a glance
Dashboard diagnostics: The top-right panel summarizes metrics that would otherwise require several separate indicators
Best Practices
Wait for displacement to dominate compression before assuming a move has truly released
Use high-quality shifts as higher-priority context than low-efficiency state changes
Read the active shift range as a tactical map, not as a guarantee that price will respect every boundary
If pressure improves but displacement remains weak, treat the move as developing rather than already established
Use the state engine to filter your existing entries instead of trying to trade every alert in isolation
Input Parameters
Signal Engine:
Fast MA Length: Sets the fast trend reference
Slow MA Length: Sets the slow trend reference
Compression Window: Defines the state lookback for range contraction
RSI Length: Sets the smoothing period for momentum pressure evaluation
Momentum Length: Defines the raw momentum lookback
Thresholds:
Compression Threshold: Determines how compressed the market must be to count as compressed
Displacement Threshold: Determines how forceful the move must be to count as a shift
Shift Hold Bars: Controls how long the active shift range remains alive
Efficiency Length: Sets the path-efficiency lookback
Show Trigger Range: Toggles the projected overlay range on the chart
Visual Language:
Bull and bear color pairs
Neutral color and panel background
Show Dashboard toggle
Show State Backdrop toggle
Show State Ribbon toggle
How to Use This Indicator
Step 1: Identify The Current State
Start with the dashboard and pane. If compression is dominant, the market is still storing energy. If bull or bear pressure is present, directional force is building. If a bull or bear shift is confirmed, the state transition has already occurred.
Step 2: Compare Compression To Displacement
The most useful read is not the absolute number alone, but the relationship between compression and displacement. When compression is high and displacement is still low, the market is coiled. When displacement overtakes compression, the release phase is gaining control.
Step 3: Use The Active Shift Range
Once a shift is active, watch the projected upper, lower, and midpoint lines on the main chart. These define the tactical zone created by the displacement event. Price behavior around that range often provides better context than the signal bar alone.
Step 4: Check Quality And Efficiency
A high-quality state means the release is not only directional but also relatively efficient. If quality is weak, treat the shift more cautiously because the move may be noisy or unstable.
Step 5: Use It As A State Filter
Compression Shift Index is most effective as a state filter for your own process. It can help you avoid forcing breakout logic during compression and avoid fading a move that is still in active displacement.
Indicator Limitations
Compression does not guarantee that a strong displacement event will follow immediately
A shift can fail quickly if the broader market context does not support follow-through
Travel efficiency can lag during early release phases because noisy price action is still being absorbed into the lookback
The active shift range is a tactical reference zone, not an automatic support or resistance guarantee
Originality Statement
Compression Shift Index is original in the way it turns compression, displacement, pressure, efficiency, and range memory into one unified transition model. It is not simply an oscillator blend for cosmetic effect:
It frames compression and release as a state transition rather than a single threshold cross
It preserves the originating shift range on the main chart, which links pane analysis to execution context
It includes efficiency and velocity metrics that help separate orderly displacement from noisy expansion
It uses a dashboard that summarizes the full state stack rather than forcing the user to infer everything from one line
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Compression and displacement readings describe market state, not guaranteed future direction. Markets can remain compressed longer than expected or reverse immediately after a shift appears. Always use independent judgment and proper risk management.
-Made with passion by jackofalltrades
Indicator

Trendshift [CHE]Trendshift — First-Shift Regime Turns with Premium/Discount Context
Summary
Trendshift highlights the first confirmed directional structure shift in price and overlays a premium or discount context based on the most recent structural range. It identifies the major swing levels, detects a regime transition when price closes beyond these levels with optional ATR-based conviction, and marks only the first shift per direction to reduce repetition and noise. The indicator then establishes a premium or discount band around the break and tints the background when price operates in either region. This produces a clean regime-aware view that emphasizes only the earliest actionable turn while maintaining contextual bias information.
Motivation: Why this design?
Conventional swing-based structure tools often fire repeated signals after each minor break, especially in volatile environments. This leads to cluttered charts and little informational value. Trendshift focuses on the core trading need: isolating the first confirmed change in directional structure and providing a premium or discount context after the break. By limiting signals to the initial flip and suppressing further markers until direction reverses again, the script reduces noise and highlights only the structural event that materially matters. The band logic further addresses the challenge of distinguishing contextual extremes and avoiding trades taken too late after a shift.
What’s different vs. standard approaches?
Baseline reference: Most structure indicators repeatedly plot every new break of a swing high or swing low.
Differences:
Only the first confirmed bullish or bearish shift is plotted until the opposite direction occurs.
ATR-filtered breakout validation to reduce false breaks during volatility spikes.
A reduced premium and discount band derived from the breakout candle and prior swing structure.
Tinted background for contextual positioning rather than explicit entry signals.
Practical effect:
Fewer but more meaningful shift markers.
Clear visual context of where price operates relative to the structural band.
Cleaner regime transitions and less chart clutter.
How it works (technical)
The indicator continuously evaluates major swing highs and lows using a symmetric window length. When a swing is confirmed, the script stores its price and bar index. A structure shift occurs when price closes beyond the most recent major swing in the opposite direction. Optional ATR filtering requires the breakout distance to exceed an ATR-scaled threshold.
Upon a confirmed shift, the script sets a regime state that remains active until a new shift or an optional timeout. It also establishes a structural band anchored between the breakout candle extremum and the prior opposite swing. The band informs the premium and discount boundaries, each representing a quarter subdivision.
Only the first shift event per direction generates a visual triangle marker. The band is validated by comparing its height to ATR to avoid extremely narrow structures. Background tinting activates whenever price resides within the premium or discount zones. Persistent variables maintain previous structural states and prevent re-triggering until direction reverses.
Parameter Guide
Swing length (default 5): Controls the number of bars used on each side of a swing. Smaller values are more reactive; larger values reduce noise.
Use ATR filter (default true): Requires breakout strength beyond the swing to exceed an ATR-scaled threshold. Disabling increases signal frequency.
ATR length (default 14): Controls volatility estimation for breakout filtering and band validation.
Break ATR multiplier (default 1.0): Higher values require stronger breakouts, reducing false shifts.
Enable framework (default true): Activates the premium and discount context logic.
Persist band on timeout (default true): Retains the current band after a regime timeout.
Min band size ATR mult (default 0.5): Rejects extremely small bands and prevents unrealistic tinting.
Regime timeout bars (default 500): Resets the regime after extended inactivity.
Invert colors (default false): Swaps premium and discount tint color assignments.
Show zone tint (default true): Toggles background shading.
Show shift markers (default true): Enables or disables the first-shift triangles.
Reading & Interpretation
A green or red tint signals that price is operating in the discount or premium region of the most recent structural band. These regions are derived from the breakout event and the prior swing. A green triangle below a bar indicates the first bullish structure shift after a bearish regime. A red triangle above a bar indicates the first bearish shift after a bullish regime. No further markers appear until direction reverses. When tint is active, price location within the band offers simple contextual bias without providing explicit entries.
Practical Workflows & Combinations
Trend following: Treat the first bullish marker as the earliest confirmation of a potential up-regime and the first bearish marker for a potential down-regime. Use price location relative to the premium and discount zones as context for continuation or mean-reversion setups.
Structure-based execution: Combine with simple swing highs and lows to refine entry points within discount after a bullish shift or within premium after a bearish shift.
Higher-timeframe overlays: Apply the indicator on higher timeframes to define macro structure, then trade on lower timeframes using the band as a contextual anchor.
Risk management: When price stays in premium during a bearish regime or in discount during a bullish regime, consider protective actions or position management adjustments.
Behavior, Constraints & Performance
The script uses only confirmed swing points and closed-bar conditions, so repainting from future bars does not occur except the inherent delay of pivot confirmation. No higher-timeframe security calls are used, avoiding HTF repaint paths.
Performance impact is minimal because the script uses no loops or arrays and relies on persistent variables. The maximum bars back setting is five-thousand, required for swing lookback. Known limitations include quiet behavior during long consolidations, occasional delayed recognition of shifts due to swing confirmation, and limited effectiveness during large market gaps where extremum logic may be distorted.
Sensible Defaults & Quick Tunin g
Increase the swing length for smoother trend shifts and fewer signals.
Decrease the swing length for more sensitivity.
Raise the ATR breakout multiplier to reduce noise in volatile markets.
Lower the band size requirement to make premium and discount zones more active on slower markets.
Extend the regime timeout for slow-moving assets.
What this indicator is—and isn’t
This tool is a structural regime-shift detector with contextual premium and discount shading. It is not a complete trading system and does not include entries, exits, or risk models. It does not predict future price movement. It should be combined with broader structure analysis, liquidity considerations, and risk management practices.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino Indicator
