This commit is contained in:
dsyoon
2023-01-23 18:09:37 +09:00
parent bed9210511
commit 5714f336f5

View File

@@ -462,7 +462,7 @@ class AnalyzerSqlite:
# 종목 상태 체크 분석
# MACD가 -300 이하에서 macd가 macds 위로 올라온 경우
if len(stock_monthly['close']) > 1:
if stock_monthly['macd'][0] is not None:
if stock_monthly['macd'][1] is not None and stock_monthly['macds'][1] is not None and stock_monthly['macd'][0] is not None and stock_monthly['macds'][0] is not None:
if stock_monthly['macd'][0] <= -300:
if stock_monthly['macd'][1] < stock_monthly['macds'][1] and stock_monthly['macds'][0] < stock_monthly['macds'][0]:
dir_code = "1"
@@ -473,7 +473,7 @@ class AnalyzerSqlite:
# RSI가 20 이하인 경우, rsi가 rsis위로 올라온 경우
if len(stock_monthly['close']) > 1:
if stock_monthly['rsi'][0] is not None and stock_monthly['rsi'][1] is not None:
if stock_monthly['rsi'][0] is not None and stock_monthly['rsi'][1] is not None and stock_monthly['rsis'][0] is not None and stock_monthly['rsis'][1] is not None:
if stock_monthly['rsi'][0] <= 20:
if stock_monthly['rsi'][1] < stock_monthly['rsis'][1] and stock_monthly['rsis'][0] < stock_monthly['rsi'][0]:
dir_code = "2"
@@ -496,7 +496,7 @@ class AnalyzerSqlite:
# 2) daily
if len(stock_daily['volume']) > 5:
# MSCD -500 이하인 경우
if stock_daily['macd'][1] is not None and stock_daily['macds'][1] is not None:
if stock_daily['macd'][1] is not None and stock_daily['macds'][1] is not None and stock_daily['macd'][0] is not None and stock_daily['macds'][0] is not None:
if stock_daily['macd'][0] <= -1000:
if stock_daily['macd'][1] < stock_daily['macds'][1] and stock_daily['macds'][0] < stock_daily['macds'][0]:
dir_code = "11"