title: How does pine script calculate an RSI using 2 series instead of 1 and a period?
body: <p>I have a pine script that I am trying to convert to python.</p>
  
  <p>However, pine script allows RSI to have 2 series as input instead of the traditional series and period.</p>
  
  <p>My question is how this is implemented, I tried the implementation on their documentation but it doesn't count for the second series :</p>
  
  <pre><code>pine_rsi(x, y) =&gt; 
  u = max(x - x[1], 0) // upward change
  d = max(x[1] - x, 0) // downward change
  rs = rma(u, y) / rma(d, y)
  res = 100 - 100 / (1 + rs)
  res
  </code></pre>
  
  <p>Thank you,</p>