This commit is contained in:
dsyoon
2022-10-16 12:24:35 +09:00
parent cea0531216
commit 2b84429637
2 changed files with 10 additions and 13 deletions

View File

@@ -291,17 +291,16 @@ class StockCrawler:
us_sotck_data = {}
for ticker in special_stocks:
cursor.execute('SELECT * FROM ' + tableName + ' WHERE CODE=?', (ticker,))
cursor.execute('SELECT ymd FROM ' + tableName + ' WHERE CODE=? order by ymd desc', (ticker,))
result = cursor.fetchone()
if result == None:
#start_day = pd.to_datetime('2017-01-01')
start_day = pd.to_datetime(self.START_DATE.replace(".", "-"))
end_day = pd.to_datetime(datetime.today().strftime('%Y-%m-%d'))
if result is not None:
start_day = result[0].replace(".", "-")
end_day = datetime.today().strftime('%Y-%m-%d')
else:
#start = (datetime.today() - timedelta(days=300)).strftime('%Y-%m-%d')
start_day = pd.to_datetime(self.START_DATE.replace(".", "-"))
end_day = pd.to_datetime(datetime.today().strftime('%Y-%m-%d'))
#start_day = pd.to_datetime('2017-01-01')
start_day = self.START_DATE.replace(".", "-")
end_day = datetime.today().strftime('%Y-%m-%d')
data = None
while True: