OPEN-SOURCE SCRIPT
Mystic Pulse V2.0 [CHE]

Mystic Pulse V2.0 [CHE] — Adaptive DI streaks with gradient intensity for clearer trend persistence
Summary
Mystic Pulse V2.0 measures directional persistence by counting how often the positive or negative directional index strengthens and dominates. These counts drive gradient colors for bars, wicks, and helper plots, so intensity reflects local momentum rather than absolute values. A windowed normalization and gamma control adapt the visuals to recent conditions, preventing one regime from overpowering the next. The result is an immediate, at-a-glance read of trend direction and stamina without relying on crossovers alone.
Motivation: Why this design?
Classical DI and ADX signals can flip during choppy phases or feel sluggish in calm regimes. This script focuses on persistence: it increments a positive or negative streak only when the corresponding directional pressure both strengthens compared with the prior bar and dominates the other side. Simple OHLC pre-smoothing reduces micro-noise, and local normalization keeps the scale relevant to the last segment of data, not a distant past.
What’s different vs. standard approaches?
Reference baseline: Traditional DI and ADX lines with crossovers and fixed-scale thresholds.
Architecture differences:
Wilder-style recursive smoothing on true range and directional movement.
Streak counters for positive and negative pressure that advance only on strengthening and dominance.
Windowed normalization and gamma shaping for visual intensity.
Wick coloring via `plotcandle` with forced overlay from a pane indicator.
Practical effect: Bars and wicks grow more vivid during sustained pressure and fade during indecision. The column plots show streak depth directly, which helps filter one-bar flips.
How it works (technical)
1. Pre-smoothing: Open, high, low, and close are averaged over a short simple moving window to dampen micro-ticks.
2. Directional inputs: True range and directional movement are formed from the smoothed prices, then recursively smoothed using a Wilder-style update that carries prior state forward.
3. DI comparison: The script derives positive and negative directional ratios relative to smoothed range. A side advances its streak when it increases compared with the previous bar and exceeds the opposite side. The other streak resets.
4. Trend score and color base: The difference between positive and negative streaks defines the active side.
5. Normalization and gamma: The absolute streak magnitude and each side’s streak are normalized within a rolling window. Gamma parameters reshape intensity so mid-range values are either compressed or emphasized.
6. Rendering:
Two column plots show positive and negative streak counts in the pane with gradient colors.
A square marker at the bottom uses the global gradient as a compact heat cue.
Bar colors on the main chart use either the gradient, neutral trend colors, or no paint depending on toggles.
Wick, border, and candle overlays are colored via `plotcandle` with forced overlay.
7. State handling: Smoothed values and counters persist across bars; initialization uses first available values without lookahead. No higher-timeframe requests are used, so repaint risk is limited to normal live-bar evolution.
Parameter Guide
Show neutral candles (fallback) — Paints main-chart bars in plain up or down colors when gradients are disabled — Default false — Use when you prefer simple up/down coloring.
Show last N shapes — Limits bottom square markers — Default 333 — Reduce if your chart gets cluttered.
ADX smoothing length — Controls the Wilder smoothing window for range and directional movement — Default 9 — Larger values increase stability but respond later.
OHLC SMA length — Pre-smoothing for inputs — Default 1 — Increase slightly on noisy assets to reduce flip risk.
Gradient barcolor — Enables gradient bar paint on the main chart — Default true — Turn off to use wicks only or neutral bars.
Wick coloring — Colors wicks, borders, and bodies via overlay — Default true — Disable if it conflicts with other overlays.
Gradient window — Lookback for local normalization — Default 100 — Shorter windows adapt faster; longer windows provide steadier intensity.
Gradient transparency — Overall transparency for gradient paints — Default 0 — Increase to make gradients subtler.
Gamma bars/shapes — Contrast for bar and shape intensity — Default 0.70 — Lower values brighten mid-tones; higher values compress them.
Gamma plots — Contrast for the column plots — Default 0.80 — Tune separately from bar intensity.
Wick transparency — Transparency for wick coloring — Default 0 — Raise to let price action show through.
Up/Down colors (dark and neon) — Base and accent colors for both directions — Defaults as provided — Adjust to match your chart theme.
Reading & Interpretation
Pane columns: The green column represents the positive streak count; the red column represents the negative streak count. Taller columns signal stronger persistence.
Gradient marker: The bottom square indicates the active side and persistence strength at a glance.
Main-chart bars and wicks: Color direction shows the dominant side; intensity reflects the normalized and gamma-shaped streak magnitude. Faded tones suggest weak or fading pressure.
Practical Workflows & Combinations
Trend following: Enter in the direction of the active side when the corresponding column expands over several bars. Confirm with structure such as higher highs and higher lows or lower highs and lower lows.
Exits and stops: Consider scaling out when intensity fades toward mid-range while structure stalls. Tighten stops after extended streaks or when wicks lose intensity.
Multi-asset/Multi-TF: Use defaults for liquid assets on intraday to swing timeframes. For highly volatile instruments, raise smoothing and the normalization window. For calm markets, lower them to regain sensitivity.
Behavior, Constraints & Performance
Repaint/confirmation: Values update during the live bar and stabilize after bar close. No historical repaint beyond normal live-bar updates.
security()/HTF: Not used; cross-timeframe repaint paths do not apply.
Resources: Declared `max_bars_back` two thousand; no explicit loops or arrays; plot and label limits are generous.
Known limits: Streak counters can remain elevated during slow reversals. Very short normalization windows can cause rapid intensity swings. Gaps or extreme spikes may temporarily distort intensity until the window adapts.
Sensible Defaults & Quick Tuning
Start with: ADX smoothing nine, OHLC SMA one, normalization window one hundred, gradient and wick coloring enabled, gamma around zero point seven to zero point eight.
Too many flips: Increase ADX smoothing and the normalization window; consider a small bump in OHLC SMA.
Too sluggish: Decrease ADX smoothing and the normalization window.
Colors overpower chart: Increase gradient and wick transparency or raise gamma to compress mid-tones.
What this indicator is—and isn’t
This is a visualization and signal layer that represents directional persistence and intensity. It does not issue trade entries or exits on its own and is not predictive. Use it alongside market structure, volume, and risk controls.
Disclaimer
The content, including any code, is for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any instrument. Trading involves substantial risk, including the possible loss of principal. Past performance is not indicative of future results. Always do your own research and consider consulting a qualified professional.
Summary
Mystic Pulse V2.0 measures directional persistence by counting how often the positive or negative directional index strengthens and dominates. These counts drive gradient colors for bars, wicks, and helper plots, so intensity reflects local momentum rather than absolute values. A windowed normalization and gamma control adapt the visuals to recent conditions, preventing one regime from overpowering the next. The result is an immediate, at-a-glance read of trend direction and stamina without relying on crossovers alone.
Motivation: Why this design?
Classical DI and ADX signals can flip during choppy phases or feel sluggish in calm regimes. This script focuses on persistence: it increments a positive or negative streak only when the corresponding directional pressure both strengthens compared with the prior bar and dominates the other side. Simple OHLC pre-smoothing reduces micro-noise, and local normalization keeps the scale relevant to the last segment of data, not a distant past.
What’s different vs. standard approaches?
Reference baseline: Traditional DI and ADX lines with crossovers and fixed-scale thresholds.
Architecture differences:
Wilder-style recursive smoothing on true range and directional movement.
Streak counters for positive and negative pressure that advance only on strengthening and dominance.
Windowed normalization and gamma shaping for visual intensity.
Wick coloring via `plotcandle` with forced overlay from a pane indicator.
Practical effect: Bars and wicks grow more vivid during sustained pressure and fade during indecision. The column plots show streak depth directly, which helps filter one-bar flips.
How it works (technical)
1. Pre-smoothing: Open, high, low, and close are averaged over a short simple moving window to dampen micro-ticks.
2. Directional inputs: True range and directional movement are formed from the smoothed prices, then recursively smoothed using a Wilder-style update that carries prior state forward.
3. DI comparison: The script derives positive and negative directional ratios relative to smoothed range. A side advances its streak when it increases compared with the previous bar and exceeds the opposite side. The other streak resets.
4. Trend score and color base: The difference between positive and negative streaks defines the active side.
5. Normalization and gamma: The absolute streak magnitude and each side’s streak are normalized within a rolling window. Gamma parameters reshape intensity so mid-range values are either compressed or emphasized.
6. Rendering:
Two column plots show positive and negative streak counts in the pane with gradient colors.
A square marker at the bottom uses the global gradient as a compact heat cue.
Bar colors on the main chart use either the gradient, neutral trend colors, or no paint depending on toggles.
Wick, border, and candle overlays are colored via `plotcandle` with forced overlay.
7. State handling: Smoothed values and counters persist across bars; initialization uses first available values without lookahead. No higher-timeframe requests are used, so repaint risk is limited to normal live-bar evolution.
Parameter Guide
Show neutral candles (fallback) — Paints main-chart bars in plain up or down colors when gradients are disabled — Default false — Use when you prefer simple up/down coloring.
Show last N shapes — Limits bottom square markers — Default 333 — Reduce if your chart gets cluttered.
ADX smoothing length — Controls the Wilder smoothing window for range and directional movement — Default 9 — Larger values increase stability but respond later.
OHLC SMA length — Pre-smoothing for inputs — Default 1 — Increase slightly on noisy assets to reduce flip risk.
Gradient barcolor — Enables gradient bar paint on the main chart — Default true — Turn off to use wicks only or neutral bars.
Wick coloring — Colors wicks, borders, and bodies via overlay — Default true — Disable if it conflicts with other overlays.
Gradient window — Lookback for local normalization — Default 100 — Shorter windows adapt faster; longer windows provide steadier intensity.
Gradient transparency — Overall transparency for gradient paints — Default 0 — Increase to make gradients subtler.
Gamma bars/shapes — Contrast for bar and shape intensity — Default 0.70 — Lower values brighten mid-tones; higher values compress them.
Gamma plots — Contrast for the column plots — Default 0.80 — Tune separately from bar intensity.
Wick transparency — Transparency for wick coloring — Default 0 — Raise to let price action show through.
Up/Down colors (dark and neon) — Base and accent colors for both directions — Defaults as provided — Adjust to match your chart theme.
Reading & Interpretation
Pane columns: The green column represents the positive streak count; the red column represents the negative streak count. Taller columns signal stronger persistence.
Gradient marker: The bottom square indicates the active side and persistence strength at a glance.
Main-chart bars and wicks: Color direction shows the dominant side; intensity reflects the normalized and gamma-shaped streak magnitude. Faded tones suggest weak or fading pressure.
Practical Workflows & Combinations
Trend following: Enter in the direction of the active side when the corresponding column expands over several bars. Confirm with structure such as higher highs and higher lows or lower highs and lower lows.
Exits and stops: Consider scaling out when intensity fades toward mid-range while structure stalls. Tighten stops after extended streaks or when wicks lose intensity.
Multi-asset/Multi-TF: Use defaults for liquid assets on intraday to swing timeframes. For highly volatile instruments, raise smoothing and the normalization window. For calm markets, lower them to regain sensitivity.
Behavior, Constraints & Performance
Repaint/confirmation: Values update during the live bar and stabilize after bar close. No historical repaint beyond normal live-bar updates.
security()/HTF: Not used; cross-timeframe repaint paths do not apply.
Resources: Declared `max_bars_back` two thousand; no explicit loops or arrays; plot and label limits are generous.
Known limits: Streak counters can remain elevated during slow reversals. Very short normalization windows can cause rapid intensity swings. Gaps or extreme spikes may temporarily distort intensity until the window adapts.
Sensible Defaults & Quick Tuning
Start with: ADX smoothing nine, OHLC SMA one, normalization window one hundred, gradient and wick coloring enabled, gamma around zero point seven to zero point eight.
Too many flips: Increase ADX smoothing and the normalization window; consider a small bump in OHLC SMA.
Too sluggish: Decrease ADX smoothing and the normalization window.
Colors overpower chart: Increase gradient and wick transparency or raise gamma to compress mid-tones.
What this indicator is—and isn’t
This is a visualization and signal layer that represents directional persistence and intensity. It does not issue trade entries or exits on its own and is not predictive. Use it alongside market structure, volume, and risk controls.
Disclaimer
The content, including any code, is for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any instrument. Trading involves substantial risk, including the possible loss of principal. Past performance is not indicative of future results. Always do your own research and consider consulting a qualified professional.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.