Academic Article Series: Economics and Finance 101:

Technical Analysis Indicators: Customisable Relative Strength Indices (and Moving Averages & Volatilities)

Author

    Jonathan Legrand
    Developer Advocate

In this article, we build a data-frame to output an instrument's Daily (i) Close Prices, (ii) ln (logarithme naturel / natural logarithm) Return, (iii) Close Price's 10, 30 and 60 Day Moving Averages, (iv) Close Price's ln Return 10, 30 and 60 Day Moving Average, (v) Annualised Standard Deviation (i.e.: volatility) of the 10, 30 and 60 Day Rolling Window (Natural Log) Returns (based on CLOSE prices), and (vi) Relative Strength Index (RSI).

When it comes to the RSI data, a great article to read about its implementation can be found here (thank you Umer and Jason!). You may want to read into the installation of the TA-Lib library used to compute RSI data here. You may also want to read into how the way TA-lib calculates RSI; as per its GitHub documentation, it uses a Wilder Smoothing method to compute Moving Averages. Others may use different such methods (e.g.: Exponential Moving Average or Simple Moving Average). More information on Refinitiv Workspace's Chart App RSI can be found here and here. Previous RSI Python functions do not provide great amounts of customisation; in this article, we will create a Python function that does just that.

 

Webinar Video

This Webinar was broadcasted live on Twitch where I code live every Tuesday at 4pm GMT.

Using this Site

You may scale up or down the math figures at your convenience as per the below.

 

display response

Define a Python Function

  MSFT.O Close MSFT.O's ln Return MSFT.O's 1d Close MSFT.O's Close 10D MA MSFT.O's ln Return' 10D MA MSFT.O's Ann. S.D. of 10D Roll. of ln Returns MSFT.O's Close 30D MA MSFT.O's ln Return' 30D MA MSFT.O's Ann. S.D. of 30D Roll. of ln Returns MSFT.O's Close 60D MA MSFT.O's ln Return' 60D MA MSFT.O's Ann. S.D. of 60D Roll. of ln Returns MSFT.O's RSI14
30/03/2020 160.23 0.067977 10.53 146.431 0.016823 0.996665 158.844 -0.004855 1.170754 164.625167 -0.000041 0.847859 52.673834
31/03/2020 157.71 -0.015852 -2.52 147.545 0.007325 0.919086 157.86 -0.005719 1.170091 164.61 -0.000096 0.848196 51.337963
01/04/2020 152.11 -0.036154 -5.6 148.716 0.008011 0.904883 156.687667 -0.006933 1.174572 164.494667 -0.000741 0.852745 48.400379
02/04/2020 155.26 0.020497 3.15 149.971 0.008429 0.906763 155.715667 -0.005737 1.177938 164.456 -0.000247 0.854052 50.129028
03/04/2020 153.83 -0.009253 -1.43 151.619 0.011332 0.862599 154.890333 -0.004975 1.174237 164.351667 -0.000665 0.853384 49.321227
... ... ... ... ... ... ... ... ... ... ... ... ... ...
23/07/2021 289.67 0.012261 3.53 281.613 0.004134 0.178585 272.2775 0.003958 0.161648 260.488917 0.002153 0.206477 75.427556
26/07/2021 289.05 -0.002143 -0.62 282.786 0.004143 0.178457 273.316167 0.003802 0.162964 261.097917 0.002252 0.205188 73.90081
27/07/2021 286.54 -0.008722 -2.51 283.342 0.001959 0.182599 274.2045 0.003254 0.167933 261.670583 0.002129 0.20677 67.908078
28/07/2021 286.22 -0.001117 -0.32 283.713 0.001305 0.181845 275.133167 0.003414 0.165493 262.24325 0.002131 0.206756 67.16034
29/07/2021 286.5 0.000978 0.28 284.26 0.001928 0.176626 276.103833 0.003573 0.163726 262.888417 0.002419 0.20163 67.497578
  • Login
  • Please Login
Contact Us MyRefinitiv