This commit is contained in:
dsyoon
2023-04-16 10:52:13 +09:00
parent c37e26673c
commit cd207e2068
2 changed files with 20 additions and 24 deletions

View File

@@ -540,11 +540,11 @@ class AnalyzerSqlite:
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
# daily_낙폭과대 (60% 이상 하락)
check = self.common.check_excessive_drop(stock_daily)
check, log = self.common.check_excessive_drop(stock_daily)
if check:
dir_name = "daily_낙폭과대"
final_status_count += 1
log = str(top)
log = log + "_" + str(top)
self.writeFile(dir_name, CODE, NAME, top, stock_daily, log)
# daily_EV하단_내려옴

View File

@@ -499,40 +499,36 @@ class Common:
# 52주 200일 기준 평균 + 50% 보다 높은 거래량의 경우
def check_volume(self, stock):
c_index = 200
if len(stock['volume']) < c_index:
c_index = len(stock['volume'])
max_volume = max(stock['volume'][1:c_index])
max_volume = max(stock['volume'][1:c_index+1])
if max_volume < stock['volume'][0]:
log = "{:.2f}".format((stock['volume'][0] - max_volume)/max_volume)
return True, log
sum_volume = sum(stock['volume'][1:c_index + 1])
avg_volume = sum_volume / c_index
if (avg_volume + avg_volume*0.75) < stock['volume'][0]:
log = "{:.2f}".format(max_volume/stock['volume'][0])
return True, log
return False, ""
# 이격도 체크
def check_disparity(self, stock):
if (98 < stock['disparity_avg5'][0] < 102 and 98 < stock['disparity_avg10'][0] < 102 and 98 < stock['disparity_avg20'][0] < 102 and 98 < stock['disparity_avg60'][0] < 102 and 98 < stock['disparity_avg120'][0] < 102):
if stock['close'][1] < stock['avg5'][1] and stock['avg5'][0] < stock['close'][0]:
if stock['stochastic_slow_k'][0] < 20:
if stock['stochastic_slow_k'][1] < stock['stochastic_slow_d'][1] and stock['stochastic_slow_d'][0] < stock['stochastic_slow_k'][0]:
return True
if (99 < stock['disparity_avg5'][0] < 101 and 98.7 < stock['disparity_avg10'][0] < 101.3 and
98.5 < stock['disparity_avg20'][0] < 101.5 and 98.3 < stock['disparity_avg60'][0] < 101.7 and
98 < stock['disparity_avg120'][0] < 102):
return True
return False
# 낙폭 과대 체크
def check_excessive_drop(self, stock):
c_index = 52 * 5
if len(stock['close']) < c_index:
c_index = len(stock['close'])
for idx in range(1, c_index):
if stock['close'][idx - 1] < int(stock['close'][idx] / 3):
c_index = idx
location = (max(stock['close'][1:c_index]) - stock['close'][0]) / max(
stock['close'][1:c_index])
if location > 0.6:
if stock['stochastic_slow_k'][0] is not None and stock['stochastic_slow_k'][1] is not None and stock['stochastic_slow_d'][1] is not None and stock['stochastic_slow_d'][0] is not None and stock['stochastic_slow_k'][0] is not None:
if stock['stochastic_slow_k'][0] < 20 and (stock['stochastic_slow_k'][1] < stock['stochastic_slow_d'][1] and stock['stochastic_slow_d'][0] < stock['stochastic_slow_k'][0]):
return True
return False
c_index = 200
if len(stock['close']) > c_index:
max_value = max(stock['close'][1:c_index+1])
if stock['close'][0] < max_value * 0.6:
return True, "{:.2f}".format(stock['close'][0]/max_value)
return False, ""
def check_under_EV_Low(self, stock):
if stock['envelope_lower'][0] is not None and stock['envelope_lower'][1] is not None: