I need to be able to calculate 15/30 minutes slow KD on 5 minute bar close without using Tradingview function "security". This is to prevent "ghost" signal whiling waiting for 15M/30M bar close. Below is how I calculate slow KD on 5M.
smoothK = input(9, minval=1), smoothD = input(3, minval=1)
k5 = sma(stoch(close, high, low, smoothK), 3)
d5 = sma(k, smoothD)