OPEN-SOURCE SCRIPT

OutsiderEdge - Intrabar X-Ray

1 325
⚠ This script uses request.footprint() and request.security_lower_tf(), which require a TradingView Premium plan or higher. The script will not load on Free or Plus plans.


Overview — What is X-Ray?

X-Ray is an open-source overlay indicator that dissects every candle into its sub-candle components, footprint data, effort-vs-result dynamics, and trap detection — all in one tool. Instead of guessing what happened inside a bar, X-Ray shows you.

It combines lower-timeframe candle decomposition with native footprint volume profiling, then layers on analytical modules that classify each bar's auction quality and warn for potential traps. Think of it as a bar-by-bar microscope that turns a single candle into a full story.


🔹 FEATURES

  1. Tooltip Sub-Candle Viewer

    Hover over any bar to see its internal structure: all lower-timeframe candles rendered as text-based charts inside the tooltip, with OHLC values, volume, bull/bear ratio, and summary statistics. Choose between a Colored or Black/White theme.
  2. X-Ray Candle Coloring

    Recolors your chart candles based on the bull/bear ratio of the sub-candles inside each bar. A bar that closed green but was internally 80% bearish sub-candles will show up differently than a uniformly bullish bar — exposing hidden weakness or strength at a glance.
  3. Mini-Chart

    Draws a real candlestick mini-chart to the right of the current bar, showing all lower-timeframe candles as actual visual candles with wicks and bodies. Gives you an instant intra-bar picture without switching timeframes.
  4. Native Footprint Dashboard

    A full volume footprint table rendered in the top-right corner using TradingView's native
    Pine Script®
    request.footprint()
    data. Displays buy and sell volume per price row, POC highlight, Value Area boundaries (VAH/VAL), delta, total volume, imbalance markers, and heatmap-style cell coloring — all without leaving your chart.
  5. Effort vs Result Analysis

    Classifies each bar by comparing volume effort against price result:
    • High Effort / Low Result — big volume, small body. Possible absorption or exhaustion.
    • Low Effort / High Result — small volume, large body. Vacuum/low-liquidity move.
    • Efficient Auction — delta-aligned, strong body, healthy volume. Clean price discovery.
    • Inefficient Move — delta opposed to direction with notable volume. Divergence warning.
  6. Trap Detector

    Scans each bar for structural trap patterns using delta, wick ratios, and body proportions:
    • Long Trap Risk — positive delta but bearish close with dominant upper wick.
    • Short Trap Risk — negative delta but bullish close with dominant lower wick.
    • Breakout Failed — wide range, tiny body, wicks dominate. Likely a fake move.
    • Continuation Likely — aligned delta, strong body, minimal wicks. Trend integrity intact.
  7. Tutor Mode

    An educational panel (bottom-right) that walks through each bar step by step: aggression direction, price reaction, imbalance stacking, POC location, volume context, and a final conclusion. Designed to help traders learn how to read order flow by seeing the reasoning broken down in real time.



🔹 HOW TO USE

  1. Add X-Ray to your chart. Make sure your TradingView plan supports
    Pine Script®
    request.footprint()
    (Premium or higher).
  2. Hover over any bar — the tooltip reveals the full sub-candle breakdown.
  3. Check the candle coloring for quick internal sentiment at a glance.
  4. Open the footprint dashboard (top-right) for row-by-row buy/sell volume, POC, and imbalance markers.
  5. Look at the chart markers for Effort vs Result classifications and Trap signals.
  6. Enable Tutor Mode to see a step-by-step explanation of the current bar's auction dynamics.



🔹 SETTINGS SUMMARY

  • ① Tooltip: Bar width, number of candles, theme (Colored / B&W), marker style, OHLC/volume/summary toggles.
  • ② X-Ray: Enable candle coloring, bull/bear/neutral colors.
  • ③ Mini-Chart: Enable, offset, candle width, colors.
  • ④ Footprint Dashboard: Enable, ticks per row, Value Area %, imbalance threshold, max rows, colors, totals, imbalance markers.
  • ⑤ Data: Lower timeframe selection (Auto or manual), LTF calculation bars.
  • ⑥ Effort vs Result: Enable, volume/body MA lengths, classification colors.
  • ⑦ Trap Detector: Enable, trap type colors.
  • ⑧ Tutor Mode: Enable, panel colors.



🔹 LOWER TIMEFRAME AUTO-DETECTION

When set to "Auto", X-Ray selects an appropriate sub-timeframe based on your chart:

  • Daily chart → 1h sub-candles
  • 4h chart → 30m sub-candles
  • 1h chart → 15m sub-candles
  • 30m chart → 5m sub-candles
  • 15m chart → 3m sub-candles
  • 5m and below → 1m sub-candles


You can override this with a fixed timeframe in the Data settings.


🔹 GOOD PRACTICES

  • Use the tooltip and mini-chart to understand what happened inside a bar before making decisions based on its outer shape.
  • Effort vs Result works best when combined with context — a "High Effort / Low Result" bar at a key support level tells a very different story than one in the middle of a range.
  • Trap signals are most useful near structure (S/R, swing highs/lows, session opens). A trap in the middle of nowhere carries less weight.
  • Tutor Mode is great for learning but adds visual clutter — consider disabling it once you're comfortable reading the other modules independently.
  • The footprint dashboard shows the last bar only. Scroll through bars to compare footprints over time.



🔹 LIMITATIONS / DISCLAIMER

  • Requires TradingView Premium, Expert, or Ultimate plan for full functionality (
    Pine Script®
    request.footprint()
    and
    Pine Script®
    request.security_lower_tf()
    ).
  • Footprint data availability depends on the exchange and instrument — not all symbols provide tick-level volume.
  • Sub-candle data is limited by the
    Pine Script®
    calc_bars_count
    parameter (default 300). Very high values may slow chart loading.
  • The Trap Detector and Effort vs Result modules use heuristic thresholds — they are probability tools, not certainties.


Trading involves substantial risk. This tool is for educational purposes only and is not financial advice. Past performance does not guarantee future results. You are solely responsible for your trading decisions and risk management.



Release Notes

v1.0 — Open-source release with: sub-candle tooltip viewer, X-Ray candle coloring, mini-chart, native footprint dashboard, Effort vs Result classification, Trap Detector, and Tutor Mode.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.