init
This commit is contained in:
@@ -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 ""
|
||||
Reference in New Issue
Block a user