{"id":2307,"date":"2010-02-11T21:57:11","date_gmt":"2010-02-11T16:27:11","guid":{"rendered":"http:\/\/www.niftylivecharts.com\/blog\/?p=2307"},"modified":"2010-02-11T21:57:11","modified_gmt":"2010-02-11T16:27:11","slug":"how-to-calculate-relative-strength-index","status":"publish","type":"post","link":"https:\/\/www.niftylivecharts.com\/blog\/how-to-calculate-relative-strength-index\/","title":{"rendered":"How to Calculate Relative Strength Index?"},"content":{"rendered":"<p><span style=\"text-decoration: underline;\"><strong>Calculation of RSI<\/strong><\/span><\/p>\n<p>A\u00a0technical momentum indicator that compares the magnitude of recent gains to recent losses in an attempt to determine overbought and oversold conditions of an asset. It is calculated using the following formula:<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"150\" align=\"center\">\n<tbody>\n<tr>\n<td rowspan=\"3\" width=\"103\"><strong>RSI<\/strong> = 100 &#8211;<\/td>\n<td width=\"63\">100<\/td>\n<\/tr>\n<tr>\n<td width=\"60\">______<\/td>\n<\/tr>\n<tr>\n<td width=\"60\">1 + RS<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"448\" align=\"center\">\n<tbody>\n<tr>\n<td><strong>RS<\/strong> = Average of x days&#8217; up closes \/ Average of x days&#8217; down closes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As you can see from the chart below, the RSI ranges from 0 to 100. An asset is deemed to be overbought once the RSI approaches the 70 level, meaning that it may be getting overvalued and is a good candidate for a pullback. Likewise, if the RSI approaches 30, it is an indication that the asset may be getting oversold and therefore likely to become\u00a0undervalued.<\/p>\n<p>For each trading period an upward change (U) or downward change (D) is calculated. <em>Up<\/em> periods are characterized by the close being higher than the previous close,<\/p>\n<dl>\n<dd><em>U<\/em> = <em>c<\/em><em>l<\/em><em>o<\/em><em>s<\/em><em>e<\/em><sub><em>n<\/em><em>o<\/em><em>w<\/em><\/sub> \u2212 <em>c<\/em><em>l<\/em><em>o<\/em><em>s<\/em><em>e<\/em><sub><em>p<\/em><em>r<\/em><em>e<\/em><em>v<\/em><em>i<\/em><em>o<\/em><em>u<\/em><em>s<\/em><\/sub><\/dd>\n<dd><em>D<\/em> = 0<\/dd>\n<\/dl>\n<p>Conversely, a down period is characterized by the close being lower than the previous period&#8217;s (note that D is nonetheless a positive number),<\/p>\n<dl>\n<dd><em>U<\/em> = 0<\/dd>\n<dd><em>D<\/em> = <em>c<\/em><em>l<\/em><em>o<\/em><em>s<\/em><em>e<\/em><sub><em>p<\/em><em>r<\/em><em>e<\/em><em>v<\/em><em>i<\/em><em>o<\/em><em>u<\/em><em>s<\/em><\/sub> \u2212 <em>c<\/em><em>l<\/em><em>o<\/em><em>s<\/em><em>e<\/em><sub><em>n<\/em><em>o<\/em><em>w<\/em><\/sub><\/dd>\n<\/dl>\n<p>If the last close is the same as the previous, both U and D are zero. An average for U is calculated with an exponential moving average using a given N-period smoothing factor, and likewise for D. The ratio of those averages is the <em>Relative Strength<\/em>,<\/p>\n<dl>\n<dd><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/math\/2\/0\/6\/206954953516f2c520c586391a2cbc2f.png\" alt=\"RS = { EMA[N] \\; of \\; U \\over EMA[N] \\; of \\; D }\" \/><\/dd>\n<\/dl>\n<p>This is converted to a Relative Strength Index between 0 and 100,<\/p>\n<dl>\n<dd><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/math\/8\/e\/7\/8e78cf41faf5a652d0d515ba7922e645.png\" alt=\" RSI = 100 - 100 \\times { 1 \\over 1 + RS } \" \/><\/dd>\n<\/dl>\n<p>This can be rewritten as follows to emphasize the way RSI expresses the up as a proportion of the total up and down (averages in each case),<\/p>\n<dl>\n<dd><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/math\/8\/1\/5\/8153b94a437a2d27a0b2338e6ed33916.png\" alt=\" RSI = 100 \\times { EMA[N]\\;of\\;U \\over (EMA[N]\\;of\\;U) + (EMA[N]\\;of\\;D) } \" \/><\/dd>\n<\/dl>\n<p>The EMA, in theory, uses an infinite amount of past data. It is necessary either to go back far enough, or alternately at the start of data begin with a simple average of N periods instead,<\/p>\n<dl>\n<dd><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/math\/d\/1\/2\/d1208add701f7b0826ecfe013977fdd6.png\" alt=\"AvgU_{initial} = { U_1 + U_2 + \\cdots + U_N \\over N }\" \/><\/dd>\n<\/dl>\n<p>and then continue from there with the usual EMA formula,<\/p>\n<dl>\n<dd><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/math\/f\/d\/a\/fda5a48552ec7b845a61702b5e926b5c.png\" alt=\"AvgU_{today} = \\alpha \\times U_{today} + (1-\\alpha) \\times AvgU_{yesterday}\" \/><\/dd>\n<\/dl>\n<p>The calculation of D is similar.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Calculation of RSI A\u00a0technical momentum indicator that compares the magnitude of recent gains to recent losses in an attempt to determine overbought and oversold conditions of an asset. It is calculated using the following formula: RSI = 100 &#8211; 100 ______ 1 + RS RS = Average of x days&#8217; up closes \/ Average of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[1],"tags":[6281,6279,2245,6278,6280,918],"class_list":{"0":"post-2307","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-general","7":"tag-calculating-rsi","8":"tag-concept-of-rsi","9":"tag-relative-strength-index","10":"tag-rsi","11":"tag-rsi-in-stock-market","12":"tag-stock-market","13":"entry"},"_links":{"self":[{"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/posts\/2307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/comments?post=2307"}],"version-history":[{"count":0,"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/posts\/2307\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/media?parent=2307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/categories?post=2307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.niftylivecharts.com\/blog\/wp-json\/wp\/v2\/tags?post=2307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}