Volume Difference Indicator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tathal
// special thanks to oakwhiz for helping convert from another programming language

//@version=4
study("OBV minus PVT")

src = close

float change_src = change(src)
float i_obv = cum(change_src > 0 ? volume : change_src < 0 ? -volume : 0*volume)
float i_pvt = pvt

float result = i_obv - i_pvt

plot(result, "OBV-PVT", color.red)