This commit is contained in:
dsyoon
2023-08-26 10:43:18 +09:00
parent 6f1e496725
commit 09c089c9d6
2 changed files with 73 additions and 35 deletions

View File

@@ -442,22 +442,24 @@ class AnalyzerSqlite:
self.makeDir("monthly_env_하단_rsi_50")
self.makeDir("monthly_env_상단_volume")
self.makeDir("monthly_mv_5_20")
self.makeDir("monthly_mv_20_60")
self.makeDir("monthly_BB하단_내려옴")
self.makeDir("monthly_5월선_돌파")
self.makeDir("monthly_5월선_20월선_돌파")
self.makeDir("monthly_20월선_60월선_돌파")
#self.makeDir("weekly_env_상단_volume")
#self.makeDir("weekly_mv_5_20")
#self.makeDir("weekly_mv_20_60")
self.makeDir("weekly_이격도")
self.makeDir("weekly_BB하단_내려옴")
self.makeDir("weekly_5주선_돌파")
self.makeDir("weekly_5주선_20주선_돌파")
self.makeDir("weekly_20주선_60주선_돌파")
#self.makeDir("daily_env_상단_volume")
self.makeDir("daily_이전에_없던_거래량")
self.makeDir("daily_이격도")
self.makeDir("daily_5일선_돌파")
self.makeDir("daily_5일선_20일선_돌파")
self.makeDir("daily_20일선_60일선_돌파")
#self.makeDir("daily_OBV")
#self.makeDir("daily_EV하단_내려옴")
#self.makeDir("daily_BB하단_내려옴")
@@ -524,20 +526,6 @@ class AnalyzerSqlite:
log = "RSI_" + "{:.2f}".format(stock_monthly['rsi'][0])
self.writeFile(dir_name, CODE, NAME, top, stock_monthly, log)
# 5개월 20개월 선
check = self.common.check_mv_5_20(stock_monthly)
if check:
dir_name = "monthly_mv_5_20"
log = "RSI_" + "{:.2f}".format(stock_monthly['rsi'][0])
self.writeFile(dir_name, CODE, NAME, top, stock_monthly, log)
# 20개월 60개월 선
check = self.common.check_mv_20_60(stock_monthly)
if check:
dir_name = "monthly_mv_20_60"
log = "RSI_" + "{:.2f}".format(stock_monthly['rsi'][0])
self.writeFile(dir_name, CODE, NAME, top, stock_monthly, log)
# 볼린저 밴드 하단 아래
check = self.common.check_under_BB_Low(stock_monthly)
if check:
@@ -545,11 +533,25 @@ class AnalyzerSqlite:
log = "BB_" + str(top)
self.writeFile(dir_name, CODE, NAME, top, stock_monthly, log)
# weekly_5선_돌파
check = self.common.check_5_moving_line(stock_monthly, 'monthly')
# monthly_5선_돌파
check = self.common.check_5_moving_line(stock_monthly)
if check:
dir_name = "monthly_5월선_돌파"
log = "5월선돌파_"
log = dir_name+"_"
self.writeFile(dir_name, CODE, NAME, top, stock_monthly, log)
# 5개월 20개월 선
check = self.common.check_5__20_moving_line(stock_monthly)
if check:
dir_name = "monthly_5월선_20월선_돌파"
log = dir_name+"_"
self.writeFile(dir_name, CODE, NAME, top, stock_monthly, log)
# 20개월 60개월 선
check = self.common.check_20__60_moving_line(stock_monthly)
if check:
dir_name = "monthly_20월선_60월선_돌파"
log = dir_name+"_"
self.writeFile(dir_name, CODE, NAME, top, stock_monthly, log)
@@ -596,12 +598,25 @@ class AnalyzerSqlite:
self.writeFile(dir_name, CODE, NAME, top, stock_weekly, log)
# weekly_5주선_돌파
check = self.common.check_5_moving_line(stock_weekly, 'wekkly')
check = self.common.check_5_moving_line(stock_weekly)
if check:
dir_name = "weekly_5주선_돌파"
log = "5주선돌파_"
log = dir_name+"_"
self.writeFile(dir_name, CODE, NAME, top, stock_weekly, log)
# 5주 20주 선 돌파
check = self.common.check_5__20_moving_line(stock_weekly)
if check:
dir_name = "weekly_5주선_20주선_돌파"
log = dir_name+"_"
self.writeFile(dir_name, CODE, NAME, top, stock_weekly, log)
# 20주 60주 선 돌파
check = self.common.check_20__60_moving_line(stock_weekly)
if check:
dir_name = "weekly_20주선_60주선_돌파"
log = dir_name+"_"
self.writeFile(dir_name, CODE, NAME, top, stock_weekly, log)
@@ -630,12 +645,26 @@ class AnalyzerSqlite:
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
# daily_5일선_돌파
check = self.common.check_5_moving_line(stock_daily, 'daily')
check = self.common.check_5_moving_line(stock_daily)
if check:
dir_name = "daily_5일선_돌파"
log = "5일선돌파_"
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
# 5일 20일 선 돌파
check = self.common.check_5__20_moving_line(stock_daily)
if check:
dir_name = "daily_5일선_20일선_돌파"
log = dir_name + "_"
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
# 20일 60일 선 돌파
check = self.common.check_20__60_moving_line(stock_daily)
if check:
dir_name = "daily_20일선_60일선_돌파"
log = dir_name + "_"
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
"""
# daily_OBV
obv = self.common.check_obv(stock_daily)

View File

@@ -525,15 +525,6 @@ class Common:
return True
return False
def check_mv_5_20(self, stock):
if stock['avg5'][1] < stock['avg20'][1] and stock['avg20'][0] < stock['avg5'][0]:
return True
return False
def check_mv_20_60(self, stock):
if stock['avg20'][1] < stock['avg60'][1] and stock['avg60'][0] < stock['avg20'][0]:
return True
return False
# 거래량 체크
# 52주 200일 기준 평균 + 50% 보다 높은 거래량의 경우
@@ -564,8 +555,8 @@ class Common:
return False
# daily_5일선_돌파
def check_5_moving_line(self, stock, type="daily"):
# 종가가 5일선_돌파
def check_5_moving_line(self, stock):
if (stock['close'][1] < stock['avg5'][1] and stock['avg5'][0] < stock['close'][0]):
if stock['volume'][1] < stock['volume'][0]:
if stock['open'][0] < stock['close'][0]:
@@ -573,6 +564,24 @@ class Common:
return False
# 5일선이 20일선_돌파
def check_5__20_moving_line(self, stock):
if (stock['avg5'][1] < stock['avg20'][1] and stock['avg20'][0] < stock['avg5'][0]):
if stock['volume'][1] < stock['volume'][0]:
if stock['open'][0] < stock['close'][0]:
return True
return False
# 20일선이 60일선_돌파
def check_20__60_moving_line(self, stock):
if (stock['avg20'][1] < stock['avg60'][1] and stock['avg60'][0] < stock['avg20'][0]):
if stock['volume'][1] < stock['volume'][0]:
if stock['open'][0] < stock['close'][0]:
return True
return False
# 낙폭 과대 체크
def check_excessive_drop(self, stock):
c_index = 200