// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © maruful_bd_yhoo //@version=5 indicator("~Bar Delta") v = volume o = open c = close vbuy = 0.0 vsell = 0.0 if c > o vbuy := v * math.abs(o / c - 1) if c < o vsell := v * math.abs(o / c - 1) delta = vbuy - vsell plot( delta, title="Bar delta", color = vbuy > vsell ? color.rgb(102,205,170) : color.rgb(51,51,51), style = plot.style_columns)