OPEN-SOURCE SCRIPT
Actualizado

Phantom Chart

679
Phantom Chart — Overlay Any Chart Style While Keeping Real Prices

Phantom Chart draws an alternative chart visualization on top of your existing chart — without changing the real prices your other indicators depend on. Most indicators and drawing tools read the chart's Open, High, Low, and Close, so switching your base chart to Heikin Ashi or another modified style quietly feeds them altered values instead of real ones.

Phantom Chart solves this: keep your base chart on Bars or standard Candles so everything else still reads true prices, then let Phantom Chart render whatever view you actually want to look at on top — Heikin Ashi, a clean line, an area, a baseline, a histogram, and more. You get the visual you read best, and your stops, targets, Fib tools, and other indicators all keep working off real prices.

Available Chart Styles
  • Candles
  • Bars
  • Heikin Ashi
  • Line
  • Step Line
  • Area
  • Baseline
  • Line with Markers
  • Columns
  • Histogram


Heikin Ashi Enhancements
HA is the headline use, so it gets dedicated tools:
  • Double Smooth — runs the Heikin Ashi calculation a second time for an even cleaner trend read with almost no noise. Flips are rarer but more reliable.
  • Strong Candles — highlights candles with no lower wick (strong bullish) or no upper wick (strong bearish), the candles that mark the heart of a trending move.
  • Flip Markers — a triangle whenever the candle color changes direction, so you never miss a turn.
  • Streak Counter — a live count of consecutive same-direction candles for gauging trend strength at a glance.


Candle Patterns (Candles / Bars)
  • Inside Bars — marks compression bars sitting fully inside the prior bar's range, which often precede an expansion.
  • Engulfing — marks bars whose body fully engulfs the previous bar in the opposite direction. Bull engulfing below the bar, bear engulfing above.


Baseline Tools
  • Crossover Markers — triangles at each cross of the baseline reference, the core baseline signal.
  • Fill To Baseline — shades green above the baseline, red below, so price position is obvious instantly.


Coloring Modes
  • Direction — each bar colored by close versus its own open.
  • Momentum — each bar colored by close versus the previous close, regardless of the bar's own direction.
  • Trend — colored by whether price is above or below its moving average, with an optional trend line.
  • Single Color — one color everywhere.


More Controls
  • Multi-Timeframe — render any higher timeframe on your chart, with an optional setting to show only fully-closed bars.
  • Volume-Weighted Opacity — fades low-volume bars and keeps high-volume bars solid so the heavy bars stand out.
  • Source Smoothing — optional moving average on the line-style sources.
  • Inverse Chart — flip the chart vertically for an objectivity check: would you take this trade if it moved the other way?
  • OHLC Labels — optional last-bar price labels.
  • Fully customizable colors, widths, wick visibility, and label styling throughout. Every enhancement is an independent toggle, off-by-default where it adds clutter.


Recommended Setup
For accurate visuals, keep your base chart on a standard type (Candles or Bars) and use Phantom Chart for the alternative view. If your base chart itself is set to Heikin Ashi or another transformed type, the overlay will reflect those transformed values rather than real prices — a built-in warning label appears when this is detected.

Tip
You can add Phantom Chart more than once to layer multiple views — for example a Heikin Ashi read alongside a clean line of real closes — each instance with its own settings.

This script is open-source under the Mozilla Public License 2.0.
Notas de prensa
New: Candlestick Patterns
  • Added detection for 16 candlestick patterns: Doji, Inside Bar (inside day), Hammer, Hanging Man, Inverted Hammer, Shooting Star, Bullish/Bearish Engulfing, Bullish/Bearish Harami, Morning/Evening Star, Three White Soldiers, Three Black Crows, Piercing Line, and Dark Cloud Cover.
  • Each pattern is individually toggleable and marked with a direction emoji — 🟢 bullish, 🔴 bearish, 🟡 neutral.
  • Detect On source selector: read true OHLC from the base chart (accurate even while viewing the Heikin Ashi overlay) or detect on the displayed candles.
  • Context-dependent pairs (Hammer vs Hanging Man, Inverted Hammer vs Shooting Star) are resolved with a configurable trend-context EMA.


New: Standard Candle Overlay
  • Draws the real standard candles of a detected pattern so the true formation is visible on a Heikin Ashi chart.
  • On Pattern mode redraws the full pattern formation (e.g. all three bars of a Morning Star); All Bars mode overlays real candles everywhere.


New: Divergence Detection
  • Regular and hidden bullish/bearish divergence between price and a selectable oscillator (RSI, MACD, Stochastic, CCI, MFI).
  • Confirmed on pivots with configurable left/right lookback; optional lines connecting the pivots.
  • Runs on real price by default so the signal is independent of the Heikin Ashi overlay.

Notas de prensa
Fixed plotting bug.
Notas de prensa
═══ MAJOR UPDATE — HTF Accuracy, Alerts & More Patterns ═══

Fixes
  • Heikin Ashi is now calculated correctly in Use HTF mode. Previously the HA formula re-applied on every chart bar while the same higher-timeframe bar repeated underneath, so HA opens drifted toward their closes and candle shapes were distorted. The recursion now advances exactly once per higher-timeframe bar (Double Smooth included) — HTF Heikin Ashi will genuinely look different now, because it was wrong before.
  • Streak Counter counts higher-timeframe bars, not chart bars — it used to inflate by roughly one per chart bar inside every HTF bar. It also keeps working with Flip Markers turned off (flip detection was accidentally tied to that toggle).
  • Candlestick patterns are now HTF-safe: multi-bar patterns (engulfing, stars, soldiers, etc.) compare real consecutive higher-timeframe bars instead of an HTF bar against its own repeats, and each detection fires one marker instead of one per chart bar.
  • Symbols without volume data (many indices) no longer lose their bar colors when Volume-Weighted Opacity is on.
  • Faster loading: the higher-timeframe data requests and the trend-EMA request now only run when the mode that uses them is actually selected.


New — Alerts
  • Eleven alert conditions in the Add-alert dropdown: HA Flip Up / Down, Strong HA Candle, Streak Milestone (configurable count), Baseline Cross Up / Down, Bullish / Bearish / Neutral Pattern, and Bullish / Bearish Divergence.
  • Optional All-Events Alert Stream: turn it on and create one alert with Condition set to "Any alert() function call" to receive every enabled signal as a detailed message with the symbol name.


New — Patterns
  • Four additions (off by default): Dragonfly Doji and Gravestone Doji (which replace the plain Doji marker when they fire), Tweezer Top / Bottom, and Marubozu.
  • Confirm on Bar Close toggle: pattern markers wait for the bar to finish, so a marker can never appear and then vanish while the bar is still forming.


New — Overlay Info Tag (on by default)
  • A small bottom-left note naming exactly what the overlay is showing — chart type, higher timeframe, double-smoothing, source smoothing, inversion (e.g. "Heikin Ashi · 1h · 2×"). An overlay that replaces the chart is easy to misread after a settings change or in a screenshot; this keeps it honest at a glance. Positioned away from the corners used by the rest of the suite.

Notas de prensa
═══ HOTFIX — Runtime Error on Load (Too Many Plots) ═══

  • Fixed a runtime error ("The script creates too many plots") introduced by the new alert conditions — TradingView counts alert conditions against the same 64-slot budget as plots, and the script went over.
  • HA Flip markers and Baseline Cross markers are now drawn as lightweight labels instead of plot shapes. They look the same (▲ below the bar, ▼ above) and the flip-marker size setting still applies — this alone freed most of the budget. One small tradeoff: on extremely long charts the oldest markers can fade out, since labels share a 500-object pool with the pattern markers.
  • The "Line with Markers" style now reuses the Line style's plot internally — identical on screen, one less plot slot.
  • No features were removed: all eleven alert conditions, every chart style, and all markers remain.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.