TradingView
LonesomeTheBlue
16 jul 2021 21:16

Volume Profile / Fixed Range 

Bitcoin / TetherUSBinance

Beskrivning

Hello All,

This script calculates and shows Volume Profile for the fixed range. Recently we have box.new() feature in Pine Language and it's used in this script as an example. Thanks to Pine Team and Tradingview!..

Sell/Buy volumes are calculated approximately!.

Options:
"Number of Bars" : Number of the bars that volume profile will be calculated/shown
"Row Size" : Number of the Rows
"Value Area Volume %" : the percent for Value Area
and there are other options for coloring and POC line style



Enjoy!

Versionsinformation

maximum number of boxes increased to 200

Versionsinformation

options organized

Versionsinformation

- Ppgraded to Pine v5
- "Show POC Label" option added (users request)
Kommentarer
dgtrd
Masterpiece!!!
LonesomeTheBlue
@dgtrd, Thank you dude!
mohdhairisahid
@LonesomeTheBlue,

How i can adjust the bar from left to right side
mascij
@mohdhairisahid, I have the same problem, did you resolve it?
jackib
@mascij did this get figured out? Same problem
PriceActionTrader1
@mohdhairisahid, It is placed on the starting bar for profile computation.
jkeichhorn
@PriceActionTrader1, yes but theres got to be a way around change it. gets in the way of my chart.
Talorthain
@mohdhairisahid, Change the section to this

// Draw VP rows
var vol_bars = array.new_box(cnum * 2, na)
for x = 0 to cnum - 1 by 1
box.delete(array.get(vol_bars, x))
box.delete(array.get(vol_bars, x + cnum))
array.set(vol_bars, x, box.new(bar_index + 10,
array.get(levels, x + 1) - dist,
bar_index + 10 + math.round(array.get(volumes, x)),
array.get(levels, x) + dist,
border_width=0,
bgcolor=x >= down and x <= up ? vup_color : up_color))
array.set(vol_bars, x + cnum, box.new(bar_index + 10 + math.round(array.get(volumes, x)),
array.get(levels, x + 1) - dist,
bar_index + 10 + math.round(array.get(volumes, x)) + math.round(array.get(volumes, x + cnum)),
array.get(levels, x) + dist,
border_width=0,
bgcolor=x >= down and x <= up ? vdown_color : down_color))

It moves it to 10 points beyond the last candle. Not perfect but should do what you want.
kyriedwaneP
@mohdhairisahid, this problem are solve?
PineCoders
Mer