This commit is contained in:
dsyoon
2024-02-13 23:04:01 +09:00
parent 82004d37ae
commit a7063df1d7
2 changed files with 44 additions and 30 deletions

View File

@@ -488,8 +488,8 @@ class Common:
return False
def check_env_lower_rsi(self, stock):
if stock['close'][1] < stock['envelope_lower'][1] and stock['envelope_lower'][0] < stock['close'][0]:
if stock['rsi'][0] < 50:
if stock['close'][-2] < stock['envelope_lower'][-2] and stock['envelope_lower'][-1] < stock['close'][-1]:
if stock['rsi'][-1] < 50:
return True
return False
@@ -521,9 +521,9 @@ class Common:
def check_volume(self, stock):
c_index = 200
max_volume = max(stock['volume'][1:c_index+1])
if 0 < max_volume*2 < stock['volume'][0] and stock['close'][1] < stock['close'][0]:
log = "{:.2f}".format(stock['volume'][0]/max_volume)
max_volume = max(stock['volume'][-c_index:-1])
if 0 < max_volume*2 < stock['volume'][-1] and stock['close'][-2] < stock['close'][-1]:
log = "{:.2f}".format(stock['volume'][-1]/max_volume)
return True, log
return False, ""
@@ -570,28 +570,23 @@ class Common:
if len(stock['trend']) < 10:
return check
if np.average(stock['trend'][1:21]) < stock['trend'][0] and np.average(stock['trend_k'][1:21]) < stock['trend_k'][0]:
# 1일 트렌드가 시그널 위로 상승 돌파 할 때
if stock['trend_k'][1] <= stock['trend_s'][1] and stock['trend_s'][0] < stock['trend_k'][0]:
# 1일 트렌드가 7일 트렌드보다 작을 때 (상승 초/중기 매수를 위해서)
if stock['trend_k'][0] < stock['trend'][0]:
# 상승을 체크하기 위해서 선행 스팬 활용
check = True
i = len(stock['ymd']) - 1
check = False
for c in range(5):
# 추세가 상승 중일 때 매수의 관점 (소추세가 하락해 있을 때 매수의 기회)
# macd가 0 이하에서 macd 매수 체크 (macd가 macds를 상승 돌파)
if stock['macd'][1] < stock['macds'][1] and stock['macds'][0] < stock['macd'][0] and stock['macd'][0] < np.min(stock['macd'][1:]) * 0.5:
if stock['avg120'][0] < stock['trend_k'][0]:
# slow_k가 50이하에서 상승 중이고 slow_d를 상승 돌파 할 때
check = True
if np.average(stock['avg60'][i - c - 3:i - c]) < stock['avg60'][i - c]:
if stock['avg60'][i - c] < stock['avg20'][i - c]:
if stock['slow_d'][i - c] < stock['slow_k'][i - c] and stock['slow_k'][i - c - 1] < stock['slow_k'][i - c] and stock['slow_k'][i - c] < 50:
if stock['close'][i - c] < stock['last_middle'][i - c] - (stock['last_middle'][i - c] - stock['last_min'][i - c]) * 0.5:
check = True
# slow_k가 10이하에서 상승 중이고 slow_d를 상승 돌파 할
if stock['slow_k'][0] is not None and stock['slow_k'][1] is not None:
if stock['slow_k'][1] < stock['slow_d'][1] and stock['slow_d'][0] < stock['slow_k'][0] and stock['slow_k'][0] < 10:
if stock['avg120'][0] < stock['trend_k'][0]:
# 거래량은 6시간 중 가장 많은 것보다 1.5배 이상 많고, 종가는 3시간 중에서 가장 높을
if np.max(stock['volume'][i - c - 120:i - c - 2]) * 1.5 < stock['volume'][i - c] and np.max(stock['close'][i - c - 20: i - c]) < stock['close'][i - c]:
if stock['open'][i - c - 1] < stock['close'][i - c - 1] and stock['close'][i - c - 1] - stock['open'][i - c - 1] < stock['close'][i - c] - stock['open'][i - c]:
# 양봉이고 몸통이 3/4 이상일 때
if stock['open'][i - c] < stock['close'][i - c] and stock['high'][i - c] - stock['close'][i - c] < (stock['close'][i - c] - stock['open'][i - c]) * 0.25:
check = True
return check
@@ -612,9 +607,9 @@ class Common:
return False
def check_under_BB_Low(self, stock):
if stock['lower'][0] is not None and stock['lower'][1] is not None:
if stock['lower'][-1] is not None and stock['lower'][-2] is not None:
# bb 하단에 부딪힘
if stock['close'][0] < stock['lower'][0]:
if stock['close'][-1] < stock['lower'][-1]:
return True
return False