Distance from peak
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © harisCodes

//@version=5
indicator("Distance from peak")

var top = float(0)

if (close>top)
    top := close
    
distance = (top-close)/top
    
plot(distance)
