init
This commit is contained in:
@@ -175,31 +175,31 @@ class Analyzer:
|
|||||||
#if STOCHASTIC[i]['slow_k'] < 40:
|
#if STOCHASTIC[i]['slow_k'] < 40:
|
||||||
status += temp_status
|
status += temp_status
|
||||||
|
|
||||||
# 20
|
# 20일선 돌파
|
||||||
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '20')
|
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '20')
|
||||||
if temp_status != "":
|
if temp_status != "":
|
||||||
#if STOCHASTIC[i]['slow_k'] < 40:
|
#if STOCHASTIC[i]['slow_k'] < 40:
|
||||||
status += temp_status
|
status += temp_status
|
||||||
|
|
||||||
# 60
|
# 60일선 돌파
|
||||||
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '60')
|
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '60')
|
||||||
if temp_status != "":
|
if temp_status != "":
|
||||||
#if STOCHASTIC[i]['slow_k'] < 40:
|
#if STOCHASTIC[i]['slow_k'] < 40:
|
||||||
status += temp_status
|
status += temp_status
|
||||||
|
|
||||||
# 120
|
# 120일선 돌파
|
||||||
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '120')
|
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '120')
|
||||||
if temp_status != "":
|
if temp_status != "":
|
||||||
#if STOCHASTIC[i]['slow_k'] < 40:
|
#if STOCHASTIC[i]['slow_k'] < 40:
|
||||||
status += temp_status
|
status += temp_status
|
||||||
|
|
||||||
# 240
|
# 240일선 돌파
|
||||||
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '240')
|
temp_status = self.common.check_Dolpa_Jiji(STOCK, i, '240')
|
||||||
if temp_status != "":
|
if temp_status != "":
|
||||||
#if STOCHASTIC[i]['slow_k'] < 40:
|
#if STOCHASTIC[i]['slow_k'] < 40:
|
||||||
status += temp_status
|
status += temp_status
|
||||||
|
|
||||||
# 270일 최고가 돌파
|
# 270일선 돌파
|
||||||
temp_status = self.common.check_highest_270(STOCK, i)
|
temp_status = self.common.check_highest_270(STOCK, i)
|
||||||
if temp_status != "":
|
if temp_status != "":
|
||||||
# if STOCHASTIC[i]['slow_k'] < 40:
|
# if STOCHASTIC[i]['slow_k'] < 40:
|
||||||
@@ -228,9 +228,14 @@ class Analyzer:
|
|||||||
status += all_upper_cross_status
|
status += all_upper_cross_status
|
||||||
|
|
||||||
# 1주일 동안 몇 10% 이상 오른 종목
|
# 1주일 동안 몇 10% 이상 오른 종목
|
||||||
w1Rate = self.common.check_W1Rate(STOCK, i)
|
W1Rise = self.common.check_W1Rise(STOCK, i, 0.1)
|
||||||
if w1Rate != "":
|
if W1Rise != "":
|
||||||
status += w1Rate
|
status += W1Rise
|
||||||
|
|
||||||
|
# 1일 동안 몇 10% 이상 내리 종목
|
||||||
|
W1Fall = self.common.check_D1Fall(STOCK, i, -0.1)
|
||||||
|
if W1Fall != "":
|
||||||
|
status += W1Fall
|
||||||
|
|
||||||
# GOLDENCROSS#1은 바로 매수하지 않고, 이 시점 이후로 5일선이 20일선을 하방으로 뚫었다가 다시 20일선을 상방으로 뚫는 순간 매수를 시도한다.
|
# GOLDENCROSS#1은 바로 매수하지 않고, 이 시점 이후로 5일선이 20일선을 하방으로 뚫었다가 다시 20일선을 상방으로 뚫는 순간 매수를 시도한다.
|
||||||
# GOLDENCROSS#2은 바로 매수 가능
|
# GOLDENCROSS#2은 바로 매수 가능
|
||||||
|
|||||||
@@ -347,9 +347,18 @@ class Common:
|
|||||||
return "arrange_"
|
return "arrange_"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def check_W1Rate(self, stock, i):
|
def check_W1Rise(self, stock, i, limit):
|
||||||
if len(stock) > 5:
|
if len(stock) > 5:
|
||||||
rate = round((stock[i]["close"] - stock[i-4]["close"]) / stock[i-4]["close"],2)
|
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 "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 ""
|
return ""
|
||||||
Reference in New Issue
Block a user