Tradingview by default shows volume numbers as (K) Thousands and (M) Millions. How do I add this to a custom script I created?
For example, if I see Net Volume as 1740654.0000 on a bar, I would prefer it shows as 1.74M instead.
Tradingview by default shows volume numbers as (K) Thousands and (M) Millions. How do I add this to a custom script I created?
For example, if I see Net Volume as 1740654.0000 on a bar, I would prefer it shows as 1.74M instead.
study
's precision
with value 0 will help:
https://www.tradingview.com/study-script-reference/#fun_study
//@version=3
study("My Script", precision=0)
plot(volume)
In Pine Script v4 I was able to format the numbers in that way using the format
argument of the study
function.
From the documentation:
format (const string) type of formatting study values on the price axis. Possible values are:
format.inherit
,format.price
,format.volume
. Default isformat.inherit
.
//@version=4
study("My indicator", format=format.volume)