This commit is contained in:
dsyoon
2024-01-25 11:45:33 +09:00
parent b99378a1e1
commit 0d04221bdb

View File

@@ -577,37 +577,37 @@ class Common:
rise_rate = param['bull'][0] / (param['bull'][0]+param['bear'][0]+param['bull'][0]) rise_rate = param['bull'][0] / (param['bull'][0]+param['bear'][0]+param['bull'][0])
if ( if (
(stock['macd'][-2] < stock['macd'][-1] and stock['rsi'][-1] < 80) or (stock['macd'][1] < stock['macd'][0] and stock['rsi'][0] < 80) or
(stock['rsi'][-2] < stock['rsi'][-1] and np.min(stock['rsi'][-3:]) < 35) or (stock['rsi'][1] < stock['rsi'][0] and np.min(stock['rsi'][:3]) < 35) or
(stock['rsi'][-1:] < 33) or (stock['rsi'][0] < 35) or
0.7 <= rise_rate 0.7 <= rise_rate
): ):
# avg300 상승 # avg300 상승
if stock['avg300'][i - 1] < stock['avg300'][i]: if stock['avg300'][1] < stock['avg300'][0]:
# avg5 < trend # avg5 < trend
if stock['avg5'][i] < stock['trend'][i]: if stock['avg5'][0] < stock['trend'][0]:
# avg5 이전 3개 봉 위 # avg5 이전 3개 봉 위
if np.max(stock['avg5'][i - 3:i]) < stock['avg5'][i]: if np.max(stock['avg5'][:3]) < stock['avg5'][i]:
buy_type = "trend" buy_type = "trend"
check = True check = True
# 상승 추세일 때 # 상승 추세일 때
if (stock['macd'][-2] < stock['macd'][-1] and stock['macds'][-1] < stock['macd'][-1] or if (stock['macd'][1] < stock['macd'][0] and stock['macds'][0] < stock['macd'][0] or
stock['rsi'][-2] < stock['rsi'][-1]): stock['rsi'][1] < stock['rsi'][0]):
# rsi가 50을 상향 돌파할 때 # rsi가 50을 상향 돌파할 때
if 0.9 <= rise_rate and np.max(stock['rsi'][i - 5:i]) < 50 and 50 < stock['rsi'][i]: if 0.9 <= rise_rate and np.max(stock['rsi'][:5]) < 50 and 50 < stock['rsi'][i]:
buy_type = "rsi" buy_type = "rsi"
check = True check = True
# golden & 거래량 # golden & 거래량
if stock['avg120'][i] < stock['avg60'][i] < stock['avg20'][i] < stock['avg5'][i]: if stock['avg120'][0] < stock['avg60'][0] < stock['avg20'][0] < stock['avg5'][0]:
buy_type = "golden" buy_type = "golden"
check = True check = True
# rsi가 30보다 작은 후에 상승일 때 # rsi가 30보다 작은 후에 상승일 때
if np.min(stock['rsi'][i - 5:i]) < 30: if np.min(stock['rsi'][:5]) < 30:
if stock['rsi'][i - 1] < stock['rsi'][i]: if stock['rsi'][1] < stock['rsi'][0]:
buy_type = "rsi" buy_type = "rsi"
check = True check = True