init
This commit is contained in:
@@ -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()},
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user