Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- # 티커 조회
- tickers_kospi = stock.get_index_ticker_list()
- tickers_kosdaq = stock.get_index_ticker_list(market="kosdaq")
- tickers = tickers_kospi + tickers_kosdaq
- # OHLCV 다운로드
- for ticker in tickers :
- df = stock.get_index_ohlcv_by_date("19800101", "20200831", ticker)
- df.to_excel(f'kospi_{ticker}.xlsx')
- time.sleep(1) # 1초 대기
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement