TradingView
colejustice
Oct 14, 2021 12:21 AM

Volume Profile Heatmap 

SPDR S&P 500 ETF TRUSTArca

描述

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.

版本注释

  • 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.

版本注释

  • Added an input to allow "sharpening" the gradient by emphasizing bright zones and de-emphasizing dim zones. Thanks @RNavega!

版本注释

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.

版本注释

Figured out the "real" Visible Range; indicator now cares about where your rightmost bar is when doing calculations and drawing the heatmap.

版本注释

  • Cleaned up settings menu and added a "number of rows" input for the Visible Range setting.
评论
UnknownUnicorn18174399
What a great asset programmers like yourself are to this platform. Thank you.
adi1334
what is the volume indicator below pls?
RNavega
@adi1334, It's just the built-in "Volume" indicator.
RNavega
Thanks a lot for this variant! I changed line #88 from this...

mult = array.get(sumVol, j) / array.max(sumVol)

To this...

mult = math.pow(array.get(sumVol, j) / array.max(sumVol), input.float(2.0, minval=0.1, title="Gradient Exponent", tooltip="Higher values make the gradient sharper"))

...this new Gradient Exponent float setting helps make the gradient sharper (as in some cases it's very subtle, difficult to interpret). The higher you set it the sharper it is, like 5.0, 10.0 etc.
colejustice
@RNavega, Thanks for the suggestion, I've implemented it in the newest update!
haze_the_great
If I disable "visible range", the indicator does not draw anything. I want the heatmap to be static regardless of where i am zooming on the chart.
RNavega
@colejustice what a cool update, thanks a lot for your work.
raychartss
Awesome! been looking for a good one in a long time Thank you!
crypteisfuture
Thank you for your work!
Like, subscribe
haze_the_great
For me, the zones don't match with other volume profiles (such as VRVP). Not sure why it is under-measuring the highest volume area in the PLTR chart for example, which should be 8.10ish, but this indicator thinks it's 25.50ish (which is the 2nd highest volume zone). I have the lookback set to 1000, and the 8.10 zone is established more recently, so it shouldn't be a lookback issue.
更多