This commit is contained in:
dsyoon
2023-10-19 20:48:50 +09:00
parent e85176b115
commit be4cd51e41
2 changed files with 2 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ if __name__ == "__main__":
PROJECT_HOME = os.getcwd() PROJECT_HOME = os.getcwd()
RESOURCE_PATH = os.path.join(PROJECT_HOME, "resources") RESOURCE_PATH = os.path.join(PROJECT_HOME, "resources")
start_date = "20231017" start_date = "20231018"
# KODEX 인버스 * 2 # KODEX 인버스 * 2
stocks = [ stocks = [
{"stock_code": "252670", "stock_name": "KODEX 200선물인버스2X", "start_date": datetime.strptime(start_date, '%Y%m%d'), "end_date": datetime.today()}, {"stock_code": "252670", "stock_name": "KODEX 200선물인버스2X", "start_date": datetime.strptime(start_date, '%Y%m%d'), "end_date": datetime.today()},

View File

@@ -492,6 +492,7 @@ class HTS:
self.cursor.execute('DELETE FROM hts WHERE CODE=? and ymd=? and hms=?', (stock_code, ymd, hms,)) self.cursor.execute('DELETE FROM hts WHERE CODE=? and ymd=? and hms=?', (stock_code, ymd, hms,))
self.cursor.execute("INSERT INTO hts (CODE, NAME, ymd, hms, close, open, high, low, volume) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", (stock_code, stock_name, ymd, hms, close, open, high, low, volume)) self.cursor.execute("INSERT INTO hts (CODE, NAME, ymd, hms, close, open, high, low, volume) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", (stock_code, stock_name, ymd, hms, close, open, high, low, volume))
time.sleep(0.5)
self.conn.commit() self.conn.commit()
return return