To find the relative strength index:
Get the historical values for the last 14 days.
Calculate price change between subsequent day prices. Let's say the price on March 5th minus the price on March 4th.
Separate the positive price change from the negative ones.
Average positive price changes. Do the same for the negative ones.
Calculate relative strength (RS) by dividing the average of positive price changes by the average of negative price changes.
Obtain RSI by subtracting 100/(1 + RS) from 100.
Read more