Disclamer : READ THIS BEFORE USING IT !!!
I have take and try to improuve the source code of indicator "intra-bar volume" by backtest-rookies.com
This indicator categorized the volume in lower timeframe, if the candle close up it's a buying volume, if it close down...
Beware that is not easy to work with different TF on tradingview so you have some limitation on the TF with this indicator. Also in TV we can't have a mutable variable in a security fonction.. so my approche is not clean but it works, if someone find better way, please comment or contact me :)
So by default the indicator can work on the following TF : 5m 15m 30m 60m 120m 240m 480m 720m 1D 1W 12M.
But ... this indicator need a lower timeframe and the number of bar to work correctly, in my code i suppose that the market run 24/7, so you need to adapte it or use intraday TF for other market.
To make sure that the indicator work correctly i have juste add circle, if it's green the buying+selling+balance volume is equal to the volume on the last close candle. If it's red theire is a problem.
I hope you enjoy it, feel free to modify the code and comment if you have any sugestion, i have just make it so maybe i will ajust some part of the code.