This repo shall contain all the content for my senior year at La Salle College Prep.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
highschool-senior/apgov/bk_stocks_hisotory.py

17 lines
352 B

2 years ago
import csv
import yfinance as yf
tickers = ["FB", "NET", "RKLB", "FSLY"]
data = [["ticker", "close"]]
for ticker in tickers:
stock = yf.Ticker(ticker)
close_history = stock.history(period="15d")['Close'].tolist()
data.append([ticker, close_history])
f = open('history.csv', 'w')
writer = csv.writer(f)
writer.writerows(data)
f.close()