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

//@version=5

indicator("REPLAY" , overlay=false)  // you can change the overlay to "true" and use the indicator by hiding the main chart
TIME = input.time(defval = timestamp('22 Nov 2021') , confirm=true)
RP = time < TIME
OPEN = RP ? open : na
HIGH = RP ? high : na
LOW = RP ? low : na
CLOSE = RP ? close : na
COLOR = close>open ? color.green : close<open ? color.red : color.black
plotcandle(OPEN, HIGH , LOW , CLOSE , color=COLOR , wickcolor = COLOR , bordercolor = COLOR)

////////////////////////////////////////////////////////////////
// Moving Average indicator has been added to this indicator, for example
// You can also add your desired indicators to the REPLAY in the same way

show_MA = input.bool(false , "Show Moving Average" , tooltip="this is an example and you can add your desired indicator")
len = input.int(55, minval=1, title="MA Length")
MA = ta.sma(close, len)
out =RP and show_MA ? MA : na
plot(out)