init
This commit is contained in:
@@ -4,21 +4,16 @@ from stock.analysis.MovingAverage import MovingAverage
|
||||
class Common:
|
||||
|
||||
# 상향
|
||||
def checkUpward(self, type, data):
|
||||
check = True
|
||||
if type is not None:
|
||||
for i in range(len(data)-1):
|
||||
# 만약 이전이 이후보다 크다면, 상승이 아님
|
||||
if data[i][type] > data[i+1][type]:
|
||||
check = False
|
||||
break
|
||||
else:
|
||||
for i in range(len(data)-1):
|
||||
# 만약 이전이 이후보다 크다면, 상승이 아님
|
||||
if data[i] > data[i+1]:
|
||||
check = False
|
||||
break
|
||||
return check
|
||||
def checkUpward(self, data, idx):
|
||||
up, down = 0, 0
|
||||
for i in range(idx, idx-11, -1):
|
||||
if data[i-1] < data[i]:
|
||||
up += 1
|
||||
else:
|
||||
down += 1
|
||||
if up > down:
|
||||
return True
|
||||
return False
|
||||
|
||||
# 하향
|
||||
def checkDownward(self, type, data):
|
||||
|
||||
Reference in New Issue
Block a user