Code in Tradingview

Fran8

Active member
Messages
212
Likes
1
Hi everyone,

Does anyone know how to code in Tradingview?

I used to use ProRealtime but i have move to tradingview that is free and it has all feature and realtime charts.

The only problem is that I knew how to programme in ProReal but not in Tradingview

The indicator that I need is very simple and if someone could help me I would really appreciated:

The Indicatior is:

If Volume is bigger than on the previous bar and bar closes in top half then the indicator shows a blue bar

If Volume is bigger than on the previous bar and bar closes in bottom half then the indicator shows a red bar

The indicator appear as an Histogram

That it

Thanks for the help in advance
 
I think this should do the trick:


//@version=2
study("volume_close")
vol_up = volume > volume[1]
//vol_dn = volume < volume[1]
close_up = close > (high+low)/2
close_dn = close < (high+low)/2
color = vol_up and close_up ? blue : vol_up and close_dn ? red : white
plot(volume, "vol_up_dn", color, 1, style=histogram )
 
Top