Skip to content
Snippets Groups Projects
Commit b168254d authored by Mathïs's avatar Mathïs
Browse files

Add main with basic market plot

parent 85fac0ab
No related branches found
No related tags found
No related merge requests found
main.py 0 → 100644
import yfinance as yf
import matplotlib.pyplot as plt
msft = yf.Ticker("MSFT")
print(msft)
"""
returns
<yfinance.Ticker object at 0x1a1715e898>
"""
# get stock info
print(msft.info)
"""
returns:
{
'quoteType': 'EQUITY',
'quoteSourceName': 'Nasdaq Real Time Price',
'currency': 'USD',
'shortName': 'Microsoft Corporation',
'exchangeTimezoneName': 'America/New_York',
...
'symbol': 'MSFT'
}
"""
# get historical market data, here max is 5 years.
print(msft.history(period="max"))
msft.history(period="max").plot()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment