OPEN-SOURCE SCRIPT
Cumulative Rejection Heatmap [MarkitTick]

💡 This advanced visual analytics tool is designed to track, aggregate, and display price rejection zones over a rolling historical window. By focusing entirely on market wicks—the footprints of supply and demand absorption—this script constructs a dynamic heatmap that highlights where price has repeatedly struggled to close. Instead of simply looking at volume or closing prices, it isolates the exact microscopic levels where buyers and sellers have historically stepped in to reverse the momentum, providing a crystal-clear map of underlying market mechanics.
● ✨ Originality and Utility
Traditional technical analysis often relies on closing prices or volume-at-price concepts like the Volume Profile. While valuable, these standard tools can sometimes obscure the specific price extremes where true order absorption occurs. This tool takes an entirely original approach by creating a "Rejection Profile."
It systematically scans every single bar within a defined historical window, mathematically measures the length of the upper and lower wicks, and compares them against the total range of the bar. When a wick meets a stringent, user-defined threshold, it is classified as a valid rejection. Over time, these individual rejection events are accumulated into specific price bins, forming a dense, visual heatmap.
The utility here is unparalleled for traders who rely on price action and liquidity concepts. By rendering a visual concentration of wicks, the chart immediately reveals hidden support and resistance walls that might not be evident through standard line-drawing techniques. It removes subjectivity from the process, mathematically proving where the market is consistently refusing to allow price to travel.
● 🔬 Methodology and Concepts

The core engine of this script relies on a rolling matrix computation combined with strict volatility filtering. The methodology can be broken down into several distinct logical phases:
● 🎨 Visual Guide

The script overlays multiple layers of visual intelligence directly onto the main price chart, designed to be quickly readable without cluttering the workspace.
• The Rejection Heatmap
Projected forward from current price action, a series of horizontal boxes forms the heatmap. The vertical height of each box represents a specific price bin, while the color intensity indicates the density of rejections within that bin. Colors transition dynamically using a custom gradient. Areas with little to no rejection remain dark and transparent, while areas of extreme rejection light up in high-contrast neon tones. Each box contains a subtle text label displaying the exact number of rejection hits and its percentage relative to the most rejected level.
• Support and Resistance (S/R) Lines
The script automatically identifies the top bins with the absolute highest concentration of historical rejections. It projects dashed horizontal lines across the chart at the exact center of these bins. These lines act as major, mathematically validated support and resistance levels, highlighted in a distinct, user-defined border color.
• Directional Triangles
When an immediate price rejection occurs on the live chart, a small geometric shape is printed to alert the user:
• The Analytics Dashboard
A sleek, customizable table is anchored to a corner of the chart, providing a heads-up display of the current market state. It displays the active asset, the rolling window size, the current ATR, and the exact price level of the highest rejection density. Furthermore, it features a text-based ASCII progress bar showing the peak density relative to historical maximums, and a Bull/Bear Bias metric that calculates the exact ratio of upward versus downward rejections over the entire window.
● 📖 How to Use

Traders can integrate this visual framework into a variety of market approaches, primarily focusing on mean reversion, breakout confirmation, and precise risk management.
● ⚙️ Inputs and Settings
The script is highly customizable, allowing the user to tailor the mathematical sensitivity and visual output to their specific asset and timeframe.
• Heatmap Configuration
• Dashboard and Visuals
• Alerts Configuration
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
At its academic core, this tool is heavily rooted in Auction Market Theory and the statistical discretization of continuous price variables. Auction Market Theory posits that financial markets exist solely to facilitate trade between buyers and sellers, constantly probing upward and downward to find areas of liquidity (fair value). When price extends too far and encounters a massive wall of limit orders, aggressive market orders are absorbed, and price is rapidly driven back in the opposite direction. On a candlestick chart, this aggressive absorption is permanently recorded as a wick.
By systematically isolating wicks, this script is effectively reconstructing the historical limit order book imbalance. It moves away from the continuous nature of time-series data and utilizes statistical binning—a process of dividing a continuous numerical range into discrete, non-overlapping intervals (bins). This is mathematically analogous to constructing a multidimensional probability density histogram.
The underlying matrix acts as a Markovian state tracker, where the probability of future price rejection at a specific interval is inferred from the historical density of prior absorptions within that exact same interval. The application of the Average True Range (ATR) as a high-pass volatility filter ensures that the statistical sample is robust, eliminating low-amplitude noise and focusing the mathematical weight strictly on statistically significant standard deviation expansions.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
● ✨ Originality and Utility
Traditional technical analysis often relies on closing prices or volume-at-price concepts like the Volume Profile. While valuable, these standard tools can sometimes obscure the specific price extremes where true order absorption occurs. This tool takes an entirely original approach by creating a "Rejection Profile."
It systematically scans every single bar within a defined historical window, mathematically measures the length of the upper and lower wicks, and compares them against the total range of the bar. When a wick meets a stringent, user-defined threshold, it is classified as a valid rejection. Over time, these individual rejection events are accumulated into specific price bins, forming a dense, visual heatmap.
The utility here is unparalleled for traders who rely on price action and liquidity concepts. By rendering a visual concentration of wicks, the chart immediately reveals hidden support and resistance walls that might not be evident through standard line-drawing techniques. It removes subjectivity from the process, mathematically proving where the market is consistently refusing to allow price to travel.
● 🔬 Methodology and Concepts
The core engine of this script relies on a rolling matrix computation combined with strict volatility filtering. The methodology can be broken down into several distinct logical phases:
- Volatility Filtering: Before any rejection is considered, the script measures the current bar's true range against a fraction of the Average True Range (ATR). If the bar's range is too small, it is deemed market noise or chop, and is entirely ignored. This prevents tight, low-volatility consolidation from falsely inflating the rejection heatmap.
- Wick Ratio Calculation: For valid bars, the script calculates the exact length of the upper wick (High minus the maximum of Open/Close) and the lower wick (minimum of Open/Close minus Low). This value is divided by the total bar range. If this ratio exceeds the minimum wick ratio threshold, a rejection event is triggered.
- Price Discretization (Binning): The script continuously tracks the highest high and lowest low of the entire lookback window. It divides this total vertical price space into a user-defined number of equal-sized bins.
- Rolling Matrix Accumulation: Using an advanced matrix data structure, the script logs each rejection event into its corresponding price bin. As the lookback window rolls forward in time, the oldest data is systematically overwritten by the newest data. This ensures the heatmap is constantly adapting to current market conditions without retaining stale historical data that is no longer relevant.
● 🎨 Visual Guide
The script overlays multiple layers of visual intelligence directly onto the main price chart, designed to be quickly readable without cluttering the workspace.
• The Rejection Heatmap
Projected forward from current price action, a series of horizontal boxes forms the heatmap. The vertical height of each box represents a specific price bin, while the color intensity indicates the density of rejections within that bin. Colors transition dynamically using a custom gradient. Areas with little to no rejection remain dark and transparent, while areas of extreme rejection light up in high-contrast neon tones. Each box contains a subtle text label displaying the exact number of rejection hits and its percentage relative to the most rejected level.
• Support and Resistance (S/R) Lines
The script automatically identifies the top bins with the absolute highest concentration of historical rejections. It projects dashed horizontal lines across the chart at the exact center of these bins. These lines act as major, mathematically validated support and resistance levels, highlighted in a distinct, user-defined border color.
• Directional Triangles
When an immediate price rejection occurs on the live chart, a small geometric shape is printed to alert the user:
- A downward-pointing triangle above the bar indicates a significant upper wick rejection, signaling sudden selling pressure or supply absorption.
- An upward-pointing triangle below the bar indicates a significant lower wick rejection, signaling sudden buying pressure or demand absorption.
• The Analytics Dashboard
A sleek, customizable table is anchored to a corner of the chart, providing a heads-up display of the current market state. It displays the active asset, the rolling window size, the current ATR, and the exact price level of the highest rejection density. Furthermore, it features a text-based ASCII progress bar showing the peak density relative to historical maximums, and a Bull/Bear Bias metric that calculates the exact ratio of upward versus downward rejections over the entire window.
● 📖 How to Use
Traders can integrate this visual framework into a variety of market approaches, primarily focusing on mean reversion, breakout confirmation, and precise risk management.
- Identifying Liquidity Pools: The brightest zones on the heatmap represent areas where limit orders have historically absorbed market orders. Traders can use these glowing zones as highly probable target areas for taking profits, as price tends to gravitate toward and stall at heavy liquidity.
- Validating Breakouts: If price breaks cleanly through a bright red, high-density rejection zone and closes beyond it, it indicates a significant shift in market structure. A zone that previously acted as a ceiling (supply) may now act as a floor (demand) upon a retest.
- Stop Loss Placement: The automated S/R lines and high-density bins provide logical areas for stop-loss placement. Placing a stop just outside a heavy rejection bin ensures that the trade is only invalidated if the market successfully chews through a known area of heavy opposition.
- Real-Time Execution: The live directional triangles can be used as immediate trigger signals when they align with the broader heatmap context. For example, an upward-pointing triangle printing exactly as price dips into a historically dense lower rejection bin provides a high-probability entry for a long position.
● ⚙️ Inputs and Settings
The script is highly customizable, allowing the user to tailor the mathematical sensitivity and visual output to their specific asset and timeframe.
• Heatmap Configuration
- Window: The rolling lookback period. A larger window encompasses more macro price action, while a shorter window reacts faster to recent volatility.
- Bins: Determines the vertical resolution. More bins create thinner, more granular price slices; fewer bins create wider, more generalized zones.
- Min Wick Ratio: The strictness of the rejection criteria. A higher value (e.g., 0.60) requires the wick to make up at least 60% of the entire bar, filtering out weak signals.
- Min Range (xATR): Filters out low-volatility bars to prevent tight consolidation from skewing the data.
- Heatmap Width %: Controls how far the visual heatmap projects into the future on the right side of the chart.
• Dashboard and Visuals
- Dashboard Pos: Anchors the analytics table to any corner of the chart to prevent obstruction of price action.
- Top S/R Levels: Determines how many distinct dashed support/resistance lines are drawn based on the highest-ranking bins.
- Use Neon Gradient: Toggles the dynamic color shading of the heatmap boxes.
• Alerts Configuration
- Action Long / Action Short: Custom JSON string inputs that allow the user to format specific payloads for automated trading platforms or webhooks when a live rejection triangle prints.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
At its academic core, this tool is heavily rooted in Auction Market Theory and the statistical discretization of continuous price variables. Auction Market Theory posits that financial markets exist solely to facilitate trade between buyers and sellers, constantly probing upward and downward to find areas of liquidity (fair value). When price extends too far and encounters a massive wall of limit orders, aggressive market orders are absorbed, and price is rapidly driven back in the opposite direction. On a candlestick chart, this aggressive absorption is permanently recorded as a wick.
By systematically isolating wicks, this script is effectively reconstructing the historical limit order book imbalance. It moves away from the continuous nature of time-series data and utilizes statistical binning—a process of dividing a continuous numerical range into discrete, non-overlapping intervals (bins). This is mathematically analogous to constructing a multidimensional probability density histogram.
The underlying matrix acts as a Markovian state tracker, where the probability of future price rejection at a specific interval is inferred from the historical density of prior absorptions within that exact same interval. The application of the Average True Range (ATR) as a high-pass volatility filter ensures that the statistical sample is robust, eliminating low-amplitude noise and focusing the mathematical weight strictly on statistically significant standard deviation expansions.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
💡 Proprietary indicators. Original research. Built by analysts who trade.
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
💡 Proprietary indicators. Original research. Built by analysts who trade.
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。