vitvlkv

Comparative Relative Strength

547 2 124
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.
Remove from Favorite Scripts Add to Favorite Scripts
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)
Thank you. This is very useful indeed. Please can I request ability to and more than one (at least 2) moving averages.
Also, is there a way to have this price ratio displayed as the main chart? And then use the ratio data to input into other indicators such as the standard RSI. Thanks.
Reply
Thanks, hard to find one that does this without finding a million RSI indicators.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out