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

//@version=5
indicator("Keats_Indicator",overlay=true)
len1=input(50,"First average")
len2=input(150,"First average")
len3=input(200,"First average")
a1 = ta.sma(close, len1)
a2 = ta.sma(close, len2)
a3 = ta.sma(close, len3)
a4=ta.sma(close,200)[22]
a5= ta.lowest(close,365)
a6=ta.highest(close,365)
a7=ta.sma(volume,50)
three_month_rs  = 0.4*(close/close[13])
six_month_rs    = 0.2*(close/(close[26]*2))
nine_month_rs   = 0.2*(close/(close[39]*3))
twelve_month_rs = 0.2*(close/(close[52]*4))
rs = (three_month_rs + six_month_rs + nine_month_rs + twelve_month_rs) * 100
plotshape(close>a2 and close>a3 and a2>a3 and a3>a3[22] and a1>a2 and a1>a3 and close>a1 and close>(1.25*a5) and close>(0.75*a6) and  rs> 70?low:na,style=shape.triangleup,location=location.belowbar,text="Buy",size=size.small)