<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: theoryforce.com</title>
    <description>The latest articles on DEV Community by theoryforce.com (@theoryforcestudio).</description>
    <link>https://dev.to/theoryforcestudio</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F702307%2Fd89cff15-db2e-42e1-b35b-4402a0c03794.png</url>
      <title>DEV Community: theoryforce.com</title>
      <link>https://dev.to/theoryforcestudio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theoryforcestudio"/>
    <language>en</language>
    <item>
      <title>Pine script recipes for RSI-based indicators</title>
      <dc:creator>theoryforce.com</dc:creator>
      <pubDate>Thu, 09 Sep 2021 12:56:07 +0000</pubDate>
      <link>https://dev.to/theoryforcestudio/pine-script-recipes-for-rsi-based-indicators-1le1</link>
      <guid>https://dev.to/theoryforcestudio/pine-script-recipes-for-rsi-based-indicators-1le1</guid>
      <description>&lt;p&gt;RSI indicators are group of technical tools that market traders use to gauge momentum of a market.&lt;/p&gt;

&lt;p&gt;The group of RSI-based indicators includes the default RSI, which is the short for relative strength index, as well as various transformations of it. Most popular one would be the stochastic RSI, the easiest to use but lesser known would be the Inverse Fisher RSI.&lt;/p&gt;

&lt;p&gt;This is the basic RSI indicator source code in pine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//@version=4
study(title="Relative Strength Index", shorttitle="RSI", format=format.price, precision=2, resolution="")
len = input(14, minval=1, title="Length")
src = input(close, "Source", type = input.source)
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, "RSI", color=#7E57C2)
band1 = hline(70, "Upper Band", color=#787B86)
bandm = hline(50, "Middle Band", color=color.new(#787B86, 50))
band0 = hline(30, "Lower Band", color=#787B86)
fill(band1, band0, color=color.rgb(126, 87, 194, 90), title="Background")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Translation from pine into English:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Call it Relative Strength Index.&lt;/li&gt;
&lt;li&gt;Take 14 past candles for the length.&lt;/li&gt;
&lt;li&gt;Retrieve their values at Close all over your length.
up and down: Compare every two consecutive Closes and find out if the price went up or down between them.&lt;/li&gt;
&lt;li&gt;If the price went up, set the down value to 0. If the price went down, set to up value to 0.&lt;/li&gt;
&lt;li&gt;Still on the same line: Get the weighted moving average of both up and down over your length.&lt;/li&gt;
&lt;li&gt;Scale the ratio of averaged up vs down to fit between values of 0 and 100 to make it into a relative index.&lt;/li&gt;
&lt;li&gt;Color it pretty!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Source: &lt;a href="https://coinpub.org/spreadsheets/technical-analysis-rsi-indicators-inverse-fisher/"&gt;https://coinpub.org/spreadsheets/technical-analysis-rsi-indicators-inverse-fisher/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>pine</category>
      <category>sideprojects</category>
    </item>
  </channel>
</rss>
