Auto VPT
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © GioLucaas

//@version=5
indicator("auto VPT", overlay=true)

var p1 = 0.0
var p2 = 0.0

if volume >= (1.5 * volume[1])
    if close >= open
        p1 := (close + (high-low))
    else
        p2 := (close - (high-low))
        
plot(p1, color=color.green, style=plot.style_cross, linewidth=3)
p1 := na

plot(p2, color=color.red, style=plot.style_cross, linewidth=3)
p2 := na

    
