This commit is contained in:
dsyoon
2022-09-09 16:40:51 +09:00
parent 6aea0bb643
commit c6c999bbce

View File

@@ -234,23 +234,25 @@ class AnalyzerSqlite:
self.makeDir("daily_3일선_10일선_상향돌파")
self.makeDir("daily_3일선_10일선_하향돌파")
self.makeDir("weekly_4주선_48주선_상향돌파")
self.makeDir("weekly_종가_12주선_상향돌파")
self.makeDir("weekly_rsi_20이하")
self.makeDir("weekly_rsi_rsis_위로_올라옴")
self.makeDir("weekly_BB하단_내려옴")
self.makeDir("monthly_6월선_36월선_상향돌파")
self.makeDir("monthly_종가_12월선_상향돌파")
self.makeDir("monthly_rsi_30이하")
self.makeDir("monthly_rsi_rsis_위로_올라옴")
self.makeDir("monthly_BB하단_내려옴")
self.makeDir("weekly_4주선_48주선_상향돌파")
self.makeDir("weekly_종가_12주선_상향돌파")
self.makeDir("weekly_rsi_20이하")
self.makeDir("weekly_rsi_rsis_위로_올라옴")
self.makeDir("weekly_BB하단_내려옴")
self.makeDir("daily_rsi_10이하")
self.makeDir("daily_이전에_없던_거래량")
self.makeDir("daily_BB하단_내려옴")
self.makeDir("daily_종가_60일선_상향돌파")
self.makeDir("daily_weekly_monthly_rsi_10_20_30이하")
return
def writeFile(self, type, CODE, NAME, top, stock, state, final_status_count=-1):
@@ -414,6 +416,63 @@ class AnalyzerSqlite:
# 종목 상태 체크 분석
# [Monthly]
# 20주선이 40주 선을 상향 돌파함
if len(stock_monthly['close']) > 40:
if (stock_monthly['avg6'][1] is not None and stock_monthly['avg36'][1] is not None and
stock_monthly['avg6'][0] is not None and stock_monthly['avg36'][0] is not None):
if stock_monthly['avg6'][1] <= stock_monthly['avg36'][1] and stock_monthly['avg6'][0] > stock_monthly['avg36'][0]:
type = "monthly_6월선_36월선_상향돌파"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
# 종가가 20주선을 상향 돌파함
if len(stock_monthly['close']) > 2:
if stock_monthly['close'][1] is not None and stock_monthly['avg12'][1] is not None and stock_monthly['close'][0] is not None and stock_monthly['avg12'][0] is not None:
if stock_monthly['close'][1] <= stock_monthly['avg12'][1] and stock_monthly['close'][0] > stock_monthly['avg12'][0]:
type = "monthly_종가_12월선_상향돌파"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
# RSI가 32 이하인 경우 (30이 이하로 떨어지는 것 미리 확인)
if len(stock_monthly['close']) > 1:
if stock_monthly['rsi'][0] is not None:
if stock_monthly['rsi'][0] <= 30:
type = "monthly_rsi_30이하"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
# rsi가 rsis 아래에서 위로 올라올 때
if len(stock_monthly['close']) > 60:
if stock_monthly['rsi'][0] is not None and stock_monthly['rsis'][0] is not None and stock_monthly['rsi'][1] is not None and stock_monthly['rsis'][1] is not None:
if stock_monthly['rsi'][0] < 40:
if stock_monthly['rsi'][0] > stock_monthly['rsis'][0] and stock_monthly['rsi'][1] <= stock_monthly['rsis'][1]:
type = "monthly_rsi_rsis_위로_올라옴"
#final_status += " " + type
#final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_monthly, status)
if len(stock_monthly['volume']) > 5:
# BB 하단에 부딪힘
for c_index in range(1, 5):
if stock_monthly['bolingerband_lower'][c_index+1] is None:
break
if stock_monthly['close'][c_index] <= (stock_monthly['bolingerband_lower'][c_index+1]):
type = "monthly_BB하단_내려옴"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_monthly, status)
break
# [Weekly]
# 정배열 체크
temp_status = self.common.check_RightArrange(stock_weekly)
@@ -471,58 +530,6 @@ class AnalyzerSqlite:
# [Monthly]
# 20주선이 40주 선을 상향 돌파함
if len(stock_monthly['close']) > 40:
if (stock_monthly['avg6'][1] is not None and stock_monthly['avg36'][1] is not None and
stock_monthly['avg6'][0] is not None and stock_monthly['avg36'][0] is not None):
if stock_monthly['avg6'][1] <= stock_monthly['avg36'][1] and stock_monthly['avg6'][0] > stock_monthly['avg36'][0]:
type = "monthly_6월선_36월선_상향돌파"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
# 종가가 20주선을 상향 돌파함
if len(stock_monthly['close']) > 2:
if stock_monthly['close'][1] is not None and stock_monthly['avg12'][1] is not None and stock_monthly['close'][0] is not None and stock_monthly['avg12'][0] is not None:
if stock_monthly['close'][1] <= stock_monthly['avg12'][1] and stock_monthly['close'][0] > stock_monthly['avg12'][0]:
type = "monthly_종가_12월선_상향돌파"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
# RSI가 32 이하인 경우 (30이 이하로 떨어지는 것 미리 확인)
if len(stock_monthly['close']) > 1:
if stock_monthly['rsi'][0] is not None:
if stock_monthly['rsi'][0] <= 30:
type = "monthly_rsi_30이하"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
# rsi가 rsis 아래에서 위로 올라올 때
if len(stock_monthly['close']) > 60:
if stock_monthly['rsi'][0] is not None and stock_monthly['rsis'][0] is not None and stock_monthly['rsi'][1] is not None and stock_monthly['rsis'][1] is not None:
if stock_monthly['rsi'][0] < 40:
if stock_monthly['rsi'][0] > stock_monthly['rsis'][0] and stock_monthly['rsi'][1] <= stock_monthly['rsis'][1]:
type = "monthly_rsi_rsis_위로_올라옴"
#final_status += " " + type
#final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_monthly, status)
if len(stock_monthly['volume']) > 5:
# BB 하단에 부딪힘
for c_index in range(1, 5):
if stock_monthly['bolingerband_lower'][c_index+1] is None:
break
if stock_monthly['close'][c_index] <= (stock_monthly['bolingerband_lower'][c_index+1]):
type = "monthly_BB하단_내려옴"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_monthly, status)
break
# 3) daily
if len(stock_daily['volume']) > 5:
@@ -586,6 +593,15 @@ class AnalyzerSqlite:
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
# daily_weekly_monthly_rsi_10_20_30이하
if len(stock_monthly['close']) > 1:
if stock_monthly['rsi'][0] is not None and stock_weekly['rsi'][0] is not None and stock_daily['rsi'][0] is not None:
if stock_monthly['rsi'][0] <= 30 and stock_weekly['rsi'][0] <= 20 and stock_daily['rsi'][0] <= 10:
type = "daily_weekly_monthly_rsi_10_20_30이하"
final_status += " " + type
final_status_count += 1
self.writeFile(type, CODE, NAME, top, stock_weekly, status)
if final_status_count > 0:
type = "final"
self.writeFile(type, CODE, NAME, top, stock_daily, final_status, final_status_count)