<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate rolling RSI in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501691#M3368</link>
    <description>&lt;P&gt;Very wise choice. Congratulations!&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2018 21:10:22 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-10-04T21:10:22Z</dc:date>
    <item>
      <title>Calculate rolling RSI</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501015#M3365</link>
      <description>&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;I'm trying to calculate rolling RSI (which is a financial indicate), I found this code, it should help me do the calculation. However, I'm very understand what is this piece of code doing. Would you please explain the code line by line, so that I can do the necessary changes to solve my case.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro calRSI();&lt;/P&gt;&lt;P&gt;%do i=16 %to 7570;&lt;/P&gt;&lt;P&gt;data RSI;&lt;/P&gt;&lt;P&gt;set RSI;&lt;/P&gt;&lt;P&gt;lAveGain = lag1(AveGain);&lt;/P&gt;&lt;P&gt;lAveLoss = lag1(AveLoss);&lt;/P&gt;&lt;P&gt;if days = &amp;amp;i then do;&lt;/P&gt;&lt;P&gt;AveGain = (lAveGain*13+gain)/14;&lt;/P&gt;&lt;P&gt;AveLoss = (lAveLoss*13+loss)/14;&lt;/P&gt;&lt;P&gt;RS = AveGain / AveLoss;&lt;/P&gt;&lt;P&gt;RSI = 100-100/(1+RS); end;&lt;/P&gt;&lt;P&gt;%end; %mend;&lt;/P&gt;&lt;P&gt;%calRSI;&lt;/P&gt;&lt;P&gt;data summer.RSIresult;&lt;/P&gt;&lt;P&gt;set RSI;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 02:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501015#M3365</guid>
      <dc:creator>Xinhui</dc:creator>
      <dc:date>2018-10-03T02:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate rolling RSI</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501029#M3366</link>
      <description>&lt;P&gt;This code is overwriting the same dataset 7555 times, each time calculating the RSI for only one value of &lt;STRONG&gt;days&lt;/STRONG&gt;. It looks like a very very inefficient way to do this type of calculation. I would advise you NOT to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tell us instead&amp;nbsp;about your available data and the calculation you want to perform, especially the details of the smoothed moving averages.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 05:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501029#M3366</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-10-03T05:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate rolling RSI</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501688#M3367</link>
      <description>&lt;P&gt;Thank you for helping, I have used "proc expand" code solved the problem. Still thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 21:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501688#M3367</guid>
      <dc:creator>Xinhui</dc:creator>
      <dc:date>2018-10-04T21:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate rolling RSI</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501691#M3368</link>
      <description>&lt;P&gt;Very wise choice. Congratulations!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 21:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Calculate-rolling-RSI/m-p/501691#M3368</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-10-04T21:10:22Z</dc:date>
    </item>
  </channel>
</rss>

