Relative Strength comparison to SPX
// Relative Strength to index as used by Leaf_West //On Leaf's weekly and monthly R/S charts, he uses a 13EMA of the R/S (brown dash line) //and an 8SMA of the 13EMA (pink solid line). //For daily or 130-minute time periods, R/S charts are slightly different - //the moving averages of the R/S line include a 20EMA (brown dash line), a 50EMA (blue dash line) //and an 8SMA of the20EMA (pink solid line). //The momentum indicator is also slightly different from the weekly/monthly charts â //here he uses a 12 period calculation (vs 8 period for the weekly/monthly charts). study(shorttitle = " Relative Strength", title="Relative strength to SPX", overlay=false) sym = input(title="Symbol", type=symbol, defval="SPY") src = input(title="Source", type=source, defval=close) s = security("sym", "1", src) s3= close/s*100 plot(s3, color=black,title=" rel chart strength")