Could someone convert this TradingView indicator?

A

Art

Member
Hi Community,

I want to test a new strategy with a script from Tradingview, but I'm not a coder. Please could someone convert this indicator?

study("Comparative Relative Strength", shorttitle="CRS")
a = tickerid
b = input("SPX500", type=symbol)
as = security(a, period, close)
bs = security(b, period, close)
plot(as/bs, title="CRS", color=gray)
len = input(10)
plot(sma(as/bs, len), color=navy)

Thanks!
 
BenTen

BenTen

Administrative
Staff
VIP
Are you trying to compare two different tickers? There is a built-in indicator in ToS called Comparison. You can use that.
 
A

Art

Member
Hi @BenTen , I'm trying to do the following:
Add SPX as a comparison to the Comparative relative strength indicator above and then chart any stock. The main thing of interest isn't the RS value, but when the stock's RS starts to rise(outperform) versus the SPX

I tried the same thing with Thinkorswim's RSI and your mentioned Comparison indicator, but I don't know if the outcome is the same.
 
Last edited:

Similar threads

Top