This commit is contained in:
dsyoon
2023-02-20 09:35:47 +09:00
parent 7e0c28e695
commit 34dc901c1a
2 changed files with 4 additions and 4 deletions

View File

@@ -131,11 +131,11 @@ class HTS_etf (HTS):
slow_k_week, slow_k_month = -1, -1
self.cursor_stock.execute('select stochastic_slow_k, max(ymd) from stock_analysis_weekly where code=? group by 1 order by ymd desc', (stock_code, ))
items = self.cursor_stock.fetchone()
if len(items)>0:
if items is not None and len(items)>0:
slow_k_week = items[0]
self.cursor_stock.execute('select stochastic_slow_k, max(ymd) from stock_analysis_monthly where code=? group by 1 order by ymd desc', (stock_code, ))
items = self.cursor_stock.fetchone()
if len(items)>0:
if items is not None and len(items)>0:
slow_k_month = items[0]
return slow_k_week, slow_k_month

View File

@@ -119,11 +119,11 @@ class HTS_Stocks (HTS):
slow_k_week, slow_k_month = -1, -1
self.cursor_stock.execute('select stochastic_slow_k, max(ymd) from stock_analysis_weekly where code=? group by 1 order by ymd desc', (stock_code, ))
items = self.cursor_stock.fetchone()
if len(items)>0:
if items is not None and len(items)>0:
slow_k_week = items[0]
self.cursor_stock.execute('select stochastic_slow_k, max(ymd) from stock_analysis_monthly where code=? group by 1 order by ymd desc', (stock_code, ))
items = self.cursor_stock.fetchone()
if len(items)>0:
if items is not None and len(items)>0:
slow_k_month = items[0]
return slow_k_week, slow_k_month