From 007e060bd9e302d10197b962bfabd04e4a3e4bc0 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Tue, 10 Oct 2023 21:04:34 +0900 Subject: [PATCH] init --- HTS_Downloader.py | 2 +- hts/HTS.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HTS_Downloader.py b/HTS_Downloader.py index 0237828..ac928b3 100644 --- a/HTS_Downloader.py +++ b/HTS_Downloader.py @@ -76,7 +76,7 @@ if __name__ == "__main__": while True: print("insert...", stock["stock_code"], stock["stock_name"], this_day.strftime('%Y%m%d')) - hts.insertStockData(stocks, this_day) + hts.insertStockData(stock, this_day) this_day = this_day + timedelta(days=1) if this_day > stock["end_date"]: break diff --git a/hts/HTS.py b/hts/HTS.py index 9e8fce9..653fab0 100644 --- a/hts/HTS.py +++ b/hts/HTS.py @@ -463,7 +463,7 @@ class HTS: return data - def insertStockData(self, stock_code, this_day): + def insertStockData(self, stock, this_day): # 테이블 생성 self.cursor.execute("CREATE TABLE IF NOT EXISTS hts (CODE text, NAME text, ymd text, hms text, close REAL, open REAL, high REAL, low REAL, volume REAL, label INTEGER DEFAULT 0)") @@ -472,7 +472,7 @@ class HTS: create_key = "CREATE INDEX IF NOT EXISTS hts_idx on hts(CODE, ymd, hms) " self.cursor.execute(create_key) - items = self.getStockInfo(stock_code, this_day.strftime('%Y%m%d')) + items = self.getStockInfo(stock["stock_code"], this_day.strftime('%Y%m%d')) for item in items: ymd = item[0]