LonesomeTheBlue

Volume [Educational]

Hello All,

This is an educational work and it's developed to show how to write scripts that will work like built-in volume indicator.

We have new features in Pine Script™ Language, such chart.bg_color, chart.fg_color, chart.left_visible_bar_time, chart.right_visible_bar_time and many more. Many Thanks to Tradingview and Pine Team for such great additions!
You can find more information about these new functions here.

How the script works?
- At the first step it calculates how many visible bar on the chart by using chart.right_visible_bar_time and chart.left_visible_bar_time functions.
- Calculates the zero line for the volume
- Finds maximum volume on visible area and normalize all volume values
- Draws volume bars
- Shows volume info as indicator value. in this step it uses chart.fg_color and plotarrow() commands to show the values in optimum color.

In order to place the indicator at the bottom of the chart, Please set Bottom Margin = 0 as shown in the following screenshot:

You can change the volume bar colors optionally.

An Example screenshot with different volume bar colors:


Enjoy!

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?