简体   繁体   中英

Plot a custom volume over candles in tradingview

In Tradingview - I would like to plot a volume overlay over the candles - but the code below does not scale the volume bars in their own y-axis scale.

Therefore, the volume bars only show and the candles do not.

//@version=3
study("Candles", overlay=false) 

plotcandle(open*2,high*2,low*2,close*2, title="Candles", color = close>=open ? green : red, wickcolor=black)

plot(series=volume*2, style=columns, color = close>=open ? green : red, transp=80)

Thanks

The script could be assigned only to 1 single y axis. In pinescript version4 you can control it with scale argument of the study function.

In your example the difference in values won't let you visualize candles + volume bars correctly, you have to create two separate scripts as in the example below.

//@version=4
study("Volume on the left scale", overlay=false, scale = scale.left) 

plot(series=volume*2, style=plot.style_columns, color = close>=open ? color.green : color.red, transp=80)

//@version=4
study("Candles on the right scale", overlay=false) 

plotcandle(open*2,high*2,low*2,close*2, title="Candles", color = close>=open ? color.green : color.red, wickcolor=color.black)

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM