The Comparative Relative Strength indicator is calculated by dividing one security's price by a second security's price (the "base" security). The result of this division is the ratio, or relationship, between the two securities.
study("Comparative Relative Strength") a = input("GOOG", type=symbol) b = input("AAPL", type=symbol) as = security(a, period, close) bs = security(b, period, close) plot(as/bs, title="CRS")