Percent Off All-time High (% Off High)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © xHmmmmm

//@version=5
indicator("% off high")

GetATH(dataSeries = high) =>
    var ATH = dataSeries
    if dataSeries > nz(ATH, -1e10)
        ATH := dataSeries
    ATH
    
plot(close/GetATH()-1)