Create README.md

sc

Update README.md

Added the stock.py which will perform the stock visualization, as well as the README.md along with the screenshot files.
This commit is contained in:
William Wang 2023-05-06 22:31:02 -04:00
parent 5c6431d000
commit 05bd8134f2
4 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# Stock Visualizer
## About
A stock visualizer, that uses the Yahoo Finance library to create a customizable graph for the user to see.
It will ask the user for input, specifically for the stock symbol, and the start and end dates in the form (YYYY-MM-DD).
Then, it will output a graph with those specifications.
### Input Queried from User
![](assets/input.png)
### Output Graph Generated
![](assets/output.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -0,0 +1,19 @@
import pandas as pd
import yfinance as yf
import matplotlib.pyplot as plt
ticker = input('Stock Symbol: ')
start_date = input('Start Date (YYYY-MM-DD): ')
end_date = input('End Date (YYYY-MM-DD): ')
stock = yf.Ticker(ticker)
df = stock.history(start=start_date, end=end_date)
plt.figure(figsize=(14, 8))
plt.plot(df['Close'])
plt.title(f'{ticker} Stock Price')
plt.xlabel('Date')
plt.ylabel('Price (USD)')
plt.grid()
plt.show()