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

//@version=5
indicator("Timed Alert",overlay=true)

i_message=input.string("The closing price is {{close}}","Message",tooltip="Can use certain variables in the message. ex. {{close}} will replace with close price. https://www.tradingview.com/blog/en/introducing-variables-in-alerts-14880/")

i_hour = input.int(9, "Hour",minval=0,maxval=24,step=1,inline="time",tooltip="Set to exchanges time, alert should be created on a timeframe that corresponds to alert time.")
i_minute = input.int(25, "Minute",minval=0,maxval=59,step=1,inline="time",tooltip="Set to exchanges time, alert should be created on a timeframe that corresponds to alert time.")
i_seconds = input.int(0, "Seconds",minval=0,maxval=59,step=1,inline="time",tooltip="Set to exchanges time, alert should be created on a timeframe that corresponds to alert time.")

is_time = i_hour == hour and i_minute == minute and i_seconds == second

plotchar(is_time,"⏰")

i_message := str.replace_all(i_message, "{{ticker}}", str.tostring(syminfo.ticker))
i_message := str.replace_all(i_message, "{{open}}", str.tostring(open))
i_message := str.replace_all(i_message, "{{high}}", str.tostring(high))
i_message := str.replace_all(i_message, "{{low}}", str.tostring(low))
i_message := str.replace_all(i_message, "{{close}}", str.tostring(close))
i_message := str.replace_all(i_message, "{{volume}}", str.tostring(volume))

if is_time
    alert(str.tostring(i_message), alert.freq_once_per_bar)
