This commit is contained in:
dsyoon
2023-10-09 13:31:15 +09:00
parent 9da290b220
commit aac47b5307
3 changed files with 117 additions and 517 deletions

View File

@@ -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):