The strength of a stock relative to the market (SPY) is an import indicator accumulation of a stock by institutionan funds, especially during a market decline. This indicator plot the ratio of a security/SPY and plots a fast (5 period) and slow (21 period) EMA.
study("MarketRS") fast = 5 slow = 21 thisClose = close spyClose = security("SPY","D",close) rsRatio = thisClose/spyClose fastMarketRS = ema(rsRatio, fast) slowMarketRS = ema(rsRatio, slow) plot(fastMarketRS, color=red) plot(slowMarketRS, color=blue)