This commit is contained in:
dsyoon
2021-04-27 14:30:31 +09:00
parent bcac177c61
commit 494145a58c
2 changed files with 24 additions and 10 deletions

View File

@@ -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 ""