Simple exercise on how to fetch stock data from Yahoo! Finance using Python, R  or Julia. 

With Python

With this little bit of code we are going to fetch the data from the last 10 days of Nvidia, its symbol is NVDA (today, when writing this page, is 29 of February and the US stock market isn´t open yet).

Note: You will need to install datetime and yfinance packages first. 

financialPython
  • Python: Van Rossum, G., & Drake, F. L. (2009). Python 3 reference manual. CreateSpace.
  • yfinance: Naumov, A. (2018). yfinance: Download stock market data from Yahoo! Finance’s API. Journal of Open Source Software, 3(25), 768. https://doi.org/10.21105/joss.00768
  • datetime: Python Software Foundation. (n.d.). datetime — Basic date and time types. Retrieved from https://docs.python.org/3/library/datetime.html

with R

On this chunck of code we are going to fetch the data from the last 10 days of Supermicro Computers Inc, its symbol is SMCI (today, when writing this page, is 29 of February, and the US market isn´t open yet).

Note: You will need to install the quantmod library first. 

importing.knit