diff --git a/stockpredictor/analysis/Analyzer.py b/stockpredictor/analysis/Analyzer.py index 0766e7c..f42043d 100644 --- a/stockpredictor/analysis/Analyzer.py +++ b/stockpredictor/analysis/Analyzer.py @@ -175,31 +175,31 @@ class Analyzer: #if STOCHASTIC[i]['slow_k'] < 40: status += temp_status - # 20 + # 20일선 돌파 temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '20') if temp_status != "": #if STOCHASTIC[i]['slow_k'] < 40: status += temp_status - # 60 + # 60일선 돌파 temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '60') if temp_status != "": #if STOCHASTIC[i]['slow_k'] < 40: status += temp_status - # 120 + # 120일선 돌파 temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '120') if temp_status != "": #if STOCHASTIC[i]['slow_k'] < 40: status += temp_status - # 240 + # 240일선 돌파 temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '240') if temp_status != "": #if STOCHASTIC[i]['slow_k'] < 40: status += temp_status - # 270일 최고가 돌파 + # 270일선 돌파 temp_status = self.common.check_highest_270(STOCK, i) if temp_status != "": # if STOCHASTIC[i]['slow_k'] < 40: @@ -228,9 +228,14 @@ class Analyzer: status += all_upper_cross_status # 1주일 동안 몇 10% 이상 오른 종목 - w1Rate = self.common.check_W1Rate(STOCK, i) - if w1Rate != "": - status += w1Rate + W1Rise = self.common.check_W1Rise(STOCK, i, 0.1) + if W1Rise != "": + status += W1Rise + + # 1일 동안 몇 10% 이상 내리 종목 + W1Fall = self.common.check_D1Fall(STOCK, i, -0.1) + if W1Fall != "": + status += W1Fall # GOLDENCROSS#1은 바로 매수하지 않고, 이 시점 이후로 5일선이 20일선을 하방으로 뚫었다가 다시 20일선을 상방으로 뚫는 순간 매수를 시도한다. # GOLDENCROSS#2은 바로 매수 가능 diff --git a/stockpredictor/analysis/Common.py b/stockpredictor/analysis/Common.py index ba919ca..05d9dd9 100644 --- a/stockpredictor/analysis/Common.py +++ b/stockpredictor/analysis/Common.py @@ -347,9 +347,18 @@ class Common: return "arrange_" return "" - def check_W1Rate(self, stock, i): + def check_W1Rise(self, stock, i, limit): if len(stock) > 5: rate = round((stock[i]["close"] - stock[i-4]["close"]) / stock[i-4]["close"],2) - if rate >= 0.05: + if rate >= limit: return "1w("+str(rate)+")_" + return "" + + def check_D1Fall(self, stock, i, limit): + if len(stock) > 2: + # 1000, 900, (900 - 1000) / 900 = -0.111 + # 1000, 800, (800 - 1000) / 800 = -0.25 + rate = round((stock[i]["close"] - stock[i-1]["close"]) / stock[i-1]["close"], 2) + if rate <= limit: + return "1d("+str(rate)+")_" return "" \ No newline at end of file