OPEN-SOURCE SCRIPT

Volume Profile Heatmap

Updated
A variation of a Volume Profile based on code originally by LuxAlgo. (tradingview.com/script/5MggSfGG-Volume-Profile-LUX/) The traditional bar chart is replaced with full-width bars that are brighter for high volume price levels.

Like a traditional VP, its purpose is to visualize how volume corresponds to specific price levels, allowing you to get a quick idea of where the most activity is occurring, and where it hasn't been. This information may provide clues as to where price action may return, areas of support and resistance , and regions where price may move quickly. The basic concepts behind any Volume Profile (or Price by Volume Chart) should apply here as well. (investopedia article)

Inputs are set up such that you can customize the lookback period, number of rows, and width of rows for most major timeframes individually. Timeframes between those available will use the next lower timeframe settings (e.g., 2m chart will use the 1m settings.)

This indicator is experimental and is likely to receive further updates.
Release Notes
  • Increased max number of rows to 500 (I realized what I was missing, silly mistake).


NOTE: A "visible range" version (i.e., show the profile only for currently visible bars) is currently impossible due to PineScript not supporting any way to know what the leftmost bar is on a given chart. TV's built-in Visible Range VP uses some form of magic us Sorcerer's apprentices don't have access to.
Release Notes
  • Added an input to allow "sharpening" the gradient by emphasizing bright zones and de-emphasizing dim zones. Thanks @RNavega!
Release Notes
THE VISIBLE RANGE (kinda) UPDATE
Thanks to TV's new tools for determining the visibility of bars, we can now start accessing the arcane sorcery that allows us to refine data visualization to only those bars that we can see. Or as it is most commonly known as, the "Visible Range".

A new toggle has been added to the settings menu to replace the defined lookback periods with the currently visible bars instead. Unfortunately I haven't quite nailed down why their API doesn't seem to work for accessing the right-most bar index so for now we're limited to a "visible range" in the context of the current (most recent) bar, hence the "kinda" in the title. But still, I'm very excited about this update and I hope to further expand this tool in the near future as I continue to play around with these new features.
Release Notes
Figured out the "real" Visible Range; indicator now cares about where your rightmost bar is when doing calculations and drawing the heatmap.
Release Notes
  • Cleaned up settings menu and added a "number of rows" input for the Visible Range setting.
heatmapVolume ProfileVolumevpaVSA

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Thanks for using my indicators; I hope they make you money! Check out the website link for more, and thanks for your support!
Also on:

Disclaimer