title: RSI (using TTR) results differs between proprietary system and bank
body: <p><strong>Question:</strong> </p>
  
  <p>How come there is difference in calculated RSI, between my system and bank, even if using the same settings ? The source data (OHLC) is the same for both systems. I have intentionally left out "maType" since the default is "MA".</p>
  
  <p><strong>Observations so far:</strong></p>
  
  <p>Reading this link: <a href="https://quant.stackexchange.com/questions/30134/r-rsi-calculation-ttr-package">https://quant.stackexchange.com/questions/30134/r-rsi-calculation-ttr-package</a></p>
  
  <p>it seem that the standard TTR RSI uses the Wilder EMA.
  I assume this could be a reason why the RSI result are being different.</p>
  
  <p><strong>Current state of troubleshooting:</strong></p>
  
  <p>Made some tests of adding wilder = FALSE which gives RSI values close to the banks values, but not exact. I also notice that the RSI result differs whether you add emaType or leave it out, which seems to be a bug since leaving it out should use emaType="EMA".</p>
  
  <p><strong>The scenario:</strong></p>
  
  <p>Using R R6 to create object-oriented classes and TTR to create the RSI indicator result:</p>
  
  <pre><code>    create_indicator_result_data = function() {
  
          self$rsi_result_column &lt;- round(
              RSI(
                  price = decisions$mktdata_decision_map$Close,
                  n     = 14
              ), digits = 2
          )
      },
  </code></pre>
  
  <p>The result in proprietary system (using "ask price").</p>
  
  <p>OHLC data (downloaded from banks API) + "RSI result":</p>
  
  <pre><code>Date / Time / Open / High / Low / Close / RSI_result
  2019-07-16 13:12:00 1623.37 1623.50 1623.25 1623.50
  2019-07-16 13:14:00 1623.37 1623.75 1623.37 1623.75
  2019-07-16 13:15:00 1623.62 1623.75 1623.50 1623.50
  2019-07-16 13:16:00 1623.62 1623.75 1623.50 1623.75
  2019-07-16 13:17:00 1623.87 1624.00 1623.50 1623.50
  2019-07-16 13:18:00 1623.62 1623.75 1623.50 1623.75
  2019-07-16 13:19:00 1623.62 1623.75 1623.50 1623.75
  2019-07-16 13:20:00 1624.00 1624.25 1624.00 1624.25
  2019-07-16 13:21:00 1624.12 1624.25 1624.00 1624.00
  2019-07-16 13:22:00 1624.12 1624.50 1624.12 1624.50
  2019-07-16 13:23:00 1624.75 1625.00 1624.75 1624.75
  2019-07-16 13:24:00 1624.87 1625.00 1624.75 1624.75
  2019-07-16 13:25:00 1625.00 1625.25 1625.00 1625.00
  2019-07-16 13:26:00 1625.12 1625.75 1625.00 1625.50
  2019-07-16 13:27:00 1625.62 1625.75 1625.50 1625.50 78.57
  2019-07-16 13:28:00 1625.62 1625.75 1625.62 1625.75 80.10
  2019-07-16 13:29:00 1625.50 1627.00 1625.50 1626.75 84.78
  2019-07-16 13:30:00 1627.25 1627.75 1626.75 1627.75 87.86
  2019-07-16 13:31:00 1627.87 1628.75 1627.50 1628.37 89.30
  2019-07-16 13:31:00 1627.87 1628.75 1627.50 1628.25 87.14
  </code></pre>
  
  <p>Result on the bank graphics:
  bank uses also period = 14
  and "ask-price".</p>
  
  <pre><code>Date / Time / RSI result
      2019-07-16 13:27:00 73.96
      2019-07-16 13:28:00 76.01
      2019-07-16 13:29:00 82.09
      2019-07-16 13:30:00 85.93
      2019-07-16 13:31:00 86.30
  </code></pre>