Erick Tecuatl
To download stock data for a ticker and plot it on candlestick chart. Users are able to input ticker and dates, as well as a choice of RSI(relative strength index) or EMA (exponential moving average) for the ticker. Data is downloaded using the polygon.io API.
pip install pandas_ta
pip intall mplfinance
pandas
datetime
Program features a menu with options to select from. User can type 'exit' or 'restart' to select tickers at any point.

Example of Chart with RSI Indicator:
-
Program has checks to ensure validity of data. User will be prompted if ticker does not exist, dates are out of bounds, or improper date format. API_Connection will check for any null values, although extremely unlikely, but added just in case.
-
Connection class masks API key in link and assigns it as a private value, given that link is ends with key=''.
-
RSI is limited to a period of 14 as this is the most widly used period. EMA is customizable but restricted to anything greater than 5 and less than 200, as extremes will skew and yield improper results. Recommeneded EMA are 12,26,100,200.
IMPORTANT NOTE: Due to plot limitations, an error will occur if rows retreieved are greater than 300 rows, but visualation will still plot. User will be able to zoom in and out of chart.
pandas_ta RSI documentation: (https://github.com/twopirllc/pandas-ta/blob/main/pandas_ta/momentum/rsi.py)
mplfinance plotting documentation: (https://github.com/matplotlib/mplfinance/blob/master/examples/addplot.ipynb)
Key must be stored in .py file named erick_API_key. If you desire to change file name, remember to change import in API_connection.py
Format for key is:
key = 'replace_text_with_key'