SSTO for Efin 
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// The author will not responsible for any loss or damage caused by using this script.

//@version=5
indicator(title='Cloud Stoch. with Tongkaw', shorttitle='CloudSto', format=format.price, precision=2, timeframe='')
groupsto = 'Stoch. Settings'
periodK = input.int(9, title='%K Period', minval=1, group = groupsto)
periodD = input.int(3, title='%D Period', minval=1, group = groupsto)
smoothK = input.int(3, title='Smooth Level', minval=1, group = groupsto)
oblevel = input.int(80, title='Overbought Level', minval=1, group = groupsto)
oslevel = input.int(20, title='Oversold Level', minval=1, group = groupsto)

//Stoch calculation
k = ta.sma(ta.stoch(close, high, low, periodK), smoothK)
d = ta.sma(k, periodD)

//Fill Cloud Sto
pk = plot(k, title='%K', linewidth=1, color=color.new(color.blue, 20))
pd = plot(d, title='%D', linewidth=1, color=color.new(color.red, 20))
fill(pk, pd, color=k>=d ? color.new(color.blue, 20) : color.new(color.red, 20) , title='Stoch. Fill')

//Fill Band
h0 = hline(oblevel, 'Upper Band', color=#606060)
h1 = hline(oslevel, 'Lower Band', color=#606060)
fill(h0, h1, color=color.rgb(153, 21, 255, 90), title='Band Background')

//Tongkaw is alerts for your enjoyment.
alertcondition(ta.crossover(k, oblevel), title='Stoch Overbought', message='OB {{exchange}}:{{ticker}} TF[{{interval}}] Stoch in overbought')
alertcondition(ta.crossunder(k, oslevel), title='Stoch Oversold', message='OS {{exchange}}:{{ticker}} TF[{{interval}}] Stoch in oversold')
alertcondition(ta.cross(k,d), title="K cross D", message='X {{exchange}}:{{ticker}} TF[{{interval}}] %K crossed %D')