How do I calculate RSI index? Are there any inbuilt functions to get the current and historical RSI 14?

Are there any inbuilt functions to get the current and historical RSI 14?

I wanted to get a paper trading bot which rely on RSI 14 index. Please let me know if existing functions in API which can help. Can use external free python libraries.

Hi @jatinhpatel! Welcome to the forum! Thank you for using our services.

To calculate the RSI, you can follow these steps:

  1. Get the historical values for the last 14 days.
  2. Calculate price change between subsequent day prices.
  3. Separate the positive price change from the negative ones.
  4. Average positive price changes.
  5. Calculate relative strength (RS) by dividing the average of positive price changes by the average of negative price changes.
  6. Obtain RSI by subtracting 100/ (1 + RS) from 100.

As for your question about Coinbase Advanced Trade API, it does not provide an inbuilt function to calculate the RSI. You would need to fetch the historical data using the API and then calculate the RSI using the method described above.

We hope this answers your question. Do let us know in case you have any more questions or concerns.