Time Offset
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MrJulius

//@version=5

indicator("TimeOffset", overlay=true, scale=scale.left)

sym = input.symbol("NASDAQ:AAPL",  "Compare to ticker")
lag = input.int(0,              "Shift number of bars")
src = input.source(close,          "Plot source")

sym_src = request.security(sym, timeframe.period, src)

plot(sym_src, "Lagged", color.yellow, offset=lag)
