[Antipanicos] Year-over-Year YoY Change
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © antipanicos

// ABOUT THE SCRIPT
// Year-over-year growth compares a company's recent financial performance
// with its numbers for the same month one year earlier. This is considered more informative
// than a month-to-month comparison, which often reflects seasonal trends.

//@version=5
indicator("[Antipanicos] Year-over-Year YoY Change", shorttitle = "YOY_AP")

source = input.source(close, "Source")
col_yoy = color.gray
yoy_change = math.log(source[0]) - math.log(source[12])

plot(yoy_change, color=col_yoy)