diff --git a/stock/analysis/Common.py b/stock/analysis/Common.py index 737fa31..3824567 100644 --- a/stock/analysis/Common.py +++ b/stock/analysis/Common.py @@ -730,6 +730,7 @@ class Common: check_buy = False + # 체크 1 min_open_close_1 = min(stock_daily['open'].iloc[-2], stock_daily['close'].iloc[-2]) min_open_close = min(stock_daily['open'].iloc[-1], stock_daily['close'].iloc[-1]) @@ -737,4 +738,18 @@ class Common: stock_daily['leadingSpan1'].iloc[-1] < stock_daily['leadingSpan2'].iloc[-1] < min_open_close): check_buy = True + # 체크 2 + for c in range(1, 3): + min_open_close_1 = stock_daily['close'].iloc[-(c+1)] + min_open_close = stock_daily['close'].iloc[-c] + + if ( + # 선행1 (상승) < 종가 혹은 시가 < 선행2 (하락) 였는데, 오늘은 선행1 (상승) < 선행2 (하락) < 종가 혹은 시가 + (min_open_close_1 <= max(stock_daily['leadingSpan1'].iloc[-(c+1)], stock_daily['leadingSpan2'].iloc[-(c+1)])) and + (max(stock_daily['leadingSpan1'].iloc[-c], stock_daily['leadingSpan2'].iloc[-c]) < min_open_close) + ): + check_buy = True + break + + return check_buy