TradingView
modhelius
15 Th06 2018 13:57

Relative Strength 

Apple Inc.NASDAQ

Mô tả

Relative strength is a ratio between two assets, most often a stock and a market average (index). This implementation uses the method described here and the second method described here to calculate its value: "To calculate the relative strength of a particular stock, divide the percentage change over some time period by the percentage change of a particular index over the same time period". This indicator oscillates around zero. If the value is greater than zero, the investment has been relatively strong during the selected period; if the value is less than zero, the investment has been relatively weak. The period and the comparative symbol can be set in the settings for the indicator (the defaults are 50 and SPX), there you can also find an option to turn on a moving average.

Phát hành các Ghi chú

Update to Pine Script Version 4 and add resolution to study.

Phát hành các Ghi chú

Update: Convert to Pine Script version 5
Bình luận
Madcaptains
Good day. Thank you for that script. Is it possible to tweak it so that the comparative value isn’t flatten on a zero line like it is right now?
modhelius
@Madcaptains, Thank you! I do not really understand what you mean with "flatten on a zero", can you elaborate a bit further?
hemant1233
@modhelius, Sir you have made a very good indicator and the concept you use it outstanding. I just want to know how to calculate this in excel. Please help.
Madcaptains
@modhelius, pls disregard that question. I still use your indicator on a daily basis and love it. By the way, is it possible with pinescript to have the todays value written at the end of the RS line. I mean, if the RS is at 0.5 today, to see 0.5 written to the right of the RS line.
dsouzajoyal
@modhelius,
Probably if u add indicator straight horizontal line that defaults to 0 (based on user inputs in the settings). That would help to easy compare, how stock has done wrt the index.
DEEP2711
SIR WHAT IS THE FUNCTION OF THE MOVING AVERAGE PERIOD IN RELATIVE STRENGTH AND WHAT IS THE IDEAL PERIOD FOR RELATIVE STRENGTH IN DAILY TIME FRAME?
modhelius
@DEEP2711, The function of the moving average is to smooth out the curve, can be handy for volatile instruments. Regarding the ideal period, please refer to my answer to merababa100.
Chandan18
@modhelius, Good Morning brother..i m from INDIA....i used your this indicator and find it good. Here in this indicator we compare a stock versus index.

but there are multiple relative strong stocks.. and i want to compare all the relative strong among themselves. to find which stocks is most strongest.... just like we use currency meter in forex. WE COMPARE ALL CURRENCY AMONG THEMSELVES... TO KNOW WHICH IS STRONGEST.

CAN U WRITE A CODE WHERE I SELECT MULTIPLE STOCKS AND COMPARE THERE RELATIVE STRENGTH...IN SINGLE WINDOW. TO DO INTRADAY AND POSITIONAL TRADE.
merababa100
You said the default period is 50..what is the significance of 50? which is the other best period?
modhelius
@merababa100, There is no significance, it is just a default value. It is up to the user of the indicator to decide what is the best period for the his or her individual usage. This is just a tool, how people use it is not up to me to decide ;) The "best" period will most certainly differ between different instruments and different time frames, the only thing that probably can answer this is thorough back testing of your strategy based on this indicator.
Thêm nữa