vitvlkv

Comparative Relative Strength

304 1 65
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)
Shuuro
a year ago
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
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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 Billing Sign Out