From 34dc901c1a39eec4156ab4c7a41a38d6cfcc2965 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Mon, 20 Feb 2023 09:35:47 +0900 Subject: [PATCH] init --- HTS_etf.py | 4 ++-- HTS_stocks.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/HTS_etf.py b/HTS_etf.py index 2f84234..a96ef92 100644 --- a/HTS_etf.py +++ b/HTS_etf.py @@ -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 diff --git a/HTS_stocks.py b/HTS_stocks.py index 581258d..d742d19 100644 --- a/HTS_stocks.py +++ b/HTS_stocks.py @@ -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