OPEN-SOURCE SCRIPT

Unicode Heatmap Candles

1 596
Unicode Heatmap Candles

■Overview: Analytical Paradigm & Value Proposition
This indicator introduces a fundamentally new approach to micro-structural market analysis within TradingView. Transcending the visual limitations of standard OHLC (Open, High, Low, Close) candles, it leverages Pine Script v6's dynamic array processing to completely reconstruct price bars into high-resolution liquidity heatmaps. Engineered specifically for active traders and quantitative analysts, it visualizes the true order flow and volume concentrations (Point of Control) hidden beneath superficial price action in real-time.

תמונת-בזק

1. Concept & Analytical Edge
Standard candlestick charts display static geometrical shapes, which inherit a critical flaw: they completely obscure internal transaction dynamics. A long wick or a large body tells you where the price moved, but not where the actual capital was deployed. In institutional quantitative analysis, a candlestick is not a solid bar, but a vertical aggregation of micro-transactions.

By utilizing Unicode block characters with sub-tick precision, this indicator maps the exact distribution of executed lower-timeframe (LTF) volume across price tiers within each individual candle—without relying on external footprint tables. It separates "empty price movements" from "solid liquidity zones.

2. Core Mechanics & Mathematical Logic

A. Dynamic Volatility Slicing (ATR Adaptive)
To maintain consistent visual resolution across varying market conditions (from low-volatility Asian sessions to high-impact news events), the price tier step is dynamically derived from the Average True Range (ATR).

Calculate dynamic price step based on 14-period ATR

Pine Script®


Why this calculation? Fixing the tier size by a static tick value causes resolution breakdown during volatility spikes. By dividing the 14-period ATR by 30 and rounding to the nearest minimum tick, this mathematical normalization guarantees that each candle is systematically divided into approximately 20 to 30 micro-tiers, outputting a consistent heatmap resolution regardless of the timeframe or asset class.

B. Geometry Detection: Real Body vs. Wick
The script evaluates the exact numerical center of each vertical price tier to identify whether it structurally belongs to the candle body or the wick, rendering distinct Unicode glyphs to preserve the traditional candlestick silhouette.

תמונת-בזק

Determine Body vs Wick geometry

Pine Script®


  • Candle Body: Stacks wide block glyphs (███) to represent the high-density range between Open and Close.
  • Candle Wick: Stacks slender vertical glyphs (┃) to trace extreme price rejections up to the High/Low limits.


3. Scope of Capability & Technical Boundaries
To maintain institutional-grade transparency, the operational boundaries and strict design choices of this tool are detailed below. This is a specialized hyper-local lens, not a historical charting tool.

  • Intra-Candle Heatmap [ YES ] : Maps LTF volume directly inside the candle shape.
  • Real-Time POC Tracking [ YES ] : Visualizes highest volume nodes via color saturation.
  • Multi-Asset Support [ YES ] : Works flawlessly across Equities, Crypto, Forex, and Futures.
  • Full Historical Backtesting [ NO ] : Restricted by the Pine Script 500-label buffer limit.
  • High-ATR Max Display [ ~5-8 Bars ] : Optimized strictly for real-time, active execution setups.


System Constraint & Design Architecture: Pine Script v6 enforces a hard maximum of 500 label objects (max_labels_count=500). Because each high-resolution candle consumes 20 to 40 individual labels to render the micro-tiers, the simultaneous display limit is mathematically capped around the most recent 5 to 8 bars in high-ATR environments. Older bars are systematically garbage-collected. This is an intentional architectural choice: 100% of the maximum allowed computing and drawing resources are allocated to maximizing the resolution of the current market structure.

Important Note on Higher Timeframes (Daily/Weekly/Monthly): TradingView Data Limits
You may notice that when applied to high timeframes like the Monthly chart, older candles render as gray (Zero Volume). This is not a bug. TradingView imposes a strict limit of 100,000 historical bars for lower-timeframe (request.security_lower_tf) data requests. If your LTF is set to 1-minute, 100,000 bars cover only about 70 days. Therefore, older macro candles cannot retrieve micro-volume data.

תמונת-בזק

Remember: This indicator is a "Microscope" built for active intraday/swing execution. It is fundamentally designed for micro-structure analysis, not macro-historical profiling.

Anti-Crash Fail-Safe (For Non-Premium Users)
TradingView strictly limits access to seconds-based timeframes (e.g., 1S, 15S) to Premium plan subscribers. To prevent runtime crashes for Essential/Plus users, this script features a built-in safety toggle: "Premium Plan (Allow Seconds TF)".

If this box is unchecked (default), any attempt to input a seconds-based LTF will be automatically intercepted and safely downgraded to a 1-minute (1m) resolution, ensuring uninterrupted operation for all user tiers.

4. How to Use
  1. Add the indicator to your chart.
  2. Open Chart Settings (Gear Icon) -> Symbol -> Uncheck Body, Wick, and Borders (hide standard candles).
  3. Observe the internal liquidity distribution:

  • Red / Orange Nodes: Point of Control (POC) and high-liquidity concentration zones.
  • Blue / Muted Nodes: Low volume nodes (slippage zones, price vacuums, or liquidity voids).


Disclaimer
This script and its description are published solely for the purpose of learning, researching, and providing technical analysis methodologies. The developer assumes no responsibility for any direct, indirect, incidental, or consequential losses or damages (including trading losses or loss of profits) arising from the use of this tool. Trading in financial markets involves substantial risk. Please conduct thorough verification and implement appropriate risk management at your own risk before using this in a live trading environment.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.