This document contains Python code that fetches stock data using the yfinance library, plots the closing prices of a specified stock, and calculates the 50-day simple moving average (SMA). It includes functions for fetching stock data, plotting the stock prices, and calculating the SMA. An example usage is provided for Apple stock (AAPL) over the year 2023.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views1 page
1111.py
This document contains Python code that fetches stock data using the yfinance library, plots the closing prices of a specified stock, and calculates the 50-day simple moving average (SMA). It includes functions for fetching stock data, plotting the stock prices, and calculating the SMA. An example usage is provided for Apple stock (AAPL) over the year 2023.