Historic VPoCs and pseudo VPVR

ruckard Actualizado   
This study tries to recreate session based historic VPoCs
and VPVR Volume Profile
as they are used by
TradingLatino TradingView user.

It's aimed at BTCUSDT pair and 4h timeframe.

HOW IT WORKS - VPVR Profile Block
It gathers volume from the last chosen Bars
in order to draw the vpvr profile block

Volume that intersects with current level range
being studied is added to its value.

Additionally the current level price is modified
so that it matches the level price where most
of the volume has concentrated

So you get a pretty accurate price for drawn volume
while at the same time the levels are not stuck
to arbitrary level prices.

It calculates a Volume Profile for the
given historic session but then
it only outputs that Volume Profile VPoC.

  • Show VPVR Volume Profile {True}.
  • Show Historic VPoC lines {True}.
  • Show Historic VPoC labels {True}.
  • Extend Historic VPoC lines {True}: If this option is turned off the VPoC lines are only shown during the session duration.
  • Show tick difference from current price {False}: BETA. Feedback is needed because I'm not sure how it should work this setting.
  • VPVR Number of bars {100}: Define the Visible Range in number of bars so that its Volume Profile can be shown.
  • VPVR Profile width (in bars) {15}: VPVR Profile can be make larger or smaller in width thanks to this option.
  • VPVR Profile offset (in bars) {15}: VPVR Profile can be shown more to the left or to the right if the defaults do not suit you.
  • Historic Session Volume Profile timeframe {1D}: Historic VPoC use 1 day as their timeframe reference by default.
  • Number of decimal digits {2}: How many decimal digits are shown in label prices.
  • Number of previous sessions to print VPoC {5}: How many previous sessions VPoCs are to be printed. The maximum for this setting is 20.
  • Historic VPoC lines width (in pixels) {2}.
  • Historic VPoC labels size {small}.
  • History VPoC line offset (in bars) {5}: How far to the right VPoCs lines are to be extended. Note: This setting does not apply when 'Extend Historic VPoC lines' is set to 'False'.

Please be aware that VPoC from the first previous session might not be accurate due to Pine Script limitations.


This is not a VPVR like the official TradingView indicator.
This is a pseudo VPVR and that means it needs some manual input from you.
But, don't worry it's quite easy to do and if you always use the same number
of bars to calculate your VPVR then you might even just set it up once.

In order to show the VPVR (or Volume Profile on the Visible Range):
  • Rescale your chart so that you see all the bars for your Visible Range.
  • Click on the ruler tool.
  • Click on the last bar (far to the right) shown on the screen
  • Drag the ruler to first bar (far to the left) shown on the screen
  • Check what the ruler says
  • E.g. it says: 101 bars
  • Open this study settings
  • Modify: 'VPVR Number of bars ' setting
  • So that its value matches your measured number of bars (101)
  • Press OK to confirm and wait for the indicator to refresh.

If your strategy uses VPoC
to define your resistances
or supports
you can check the VPoCs shown here.

I have only used this identifier in BTCUSDT 4h timeframe.
I'm interested to know what needs to be tweaked
in other securities and timeframes.

This study let's you choose the number of decimals the label will use.

I have reused and adapted some code from
'Poor man's volume profile' study
which it's from TradingView IldarAkhmetgaleev user.

I also wanted to thank him for helping me understanding his study.

I have reused some code from
'MTF Selection Framework - PineCoders FAQ' study
which it's from TradingView PineCoders user.
Notas de prensa:
v20201024 update:
  • Fixed VPoC calculation

Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?