This commit is contained in:
dsyoon
2021-07-13 20:00:24 +09:00
parent 02ffb74849
commit ffdd8dea70
5 changed files with 37 additions and 33204 deletions

View File

@@ -62,12 +62,15 @@ class Analyzer:
cursor.execute('SELECT * FROM fnguide WHERE rowid=?', (rowid,))
result = cursor.fetchone()
while result != None:
if result[2] == "227950":
print (1)
data = json.loads(result[2])
self.fnguide[result[0]] = True
if (year1 in data and year2 in data and year3 in data):
if (data[year1]['영업이익'] < 0 and data[year2]['영업이익'] < 0 and data[year3]['영업이익'] < 0):
# 3년 연속 영업이익이 적자이면 매수하지 않는다.
if (data[year1]['영업이익'] < 0 or data[year2]['영업이익'] < 0 or data[year3]['영업이익'] < 0):
# and 3년 연속 영업이익이 적자이면 매수하지 않는다.
# or: 3년 중 1번이라도 영업이익이 적자이면 매수하지 않는다.
self.fnguide[result[0]] = False
if (data[year1]['영업이익'] < -100):
# 전년 영억적자가 100억 이상이면 매수하지 않는다.
@@ -345,6 +348,12 @@ class Analyzer:
status += eveningstar_status
"""
# Potential Energy
potential_energy_status = self.common.checkPotentialEnergy(STOCK, i)
# 365일 중 가장 찾은 금액과 가장 높았던 금액 중 현재가의 위치 계산
if potential_energy_status != "":
status += potential_energy_status
return status, buy_price
# 그래프 출력

View File

@@ -512,11 +512,32 @@ class Common:
어제는 정배열이 아니었는데, 오늘은 정배열인 경우
"""
if len(stock) > 2:
if (not (stock[i-1]["avg120"] < stock[i-1]["avg60"] < stock[i-1]["avg20"] < stock[i-1]["avg5"]) and
(stock[i]["avg120"] < stock[i]["avg60"] < stock[i]["avg20"] < stock[i]["avg5"])):
if not (stock[i - 1]["avg120"] < stock[i - 1]["avg60"] < stock[i - 1]["avg20"] < stock[i - 1]["avg5"]) and (stock[i]["avg120"] < stock[i]["avg60"] < stock[i]["avg20"] < stock[i]["avg5"]):
return "arrange_"
return ""
def checkPotentialEnergy(self, stock, i):
# 365일 중 가장 찾은 금액과 가장 높았던 금액 중 현재가의 위치 계산
top = stock[i]['close']
bottom = stock[i]['close']
price = stock[i]['close']
if len(stock) > 365:
for i in range(2, 365):
if top < stock[-i]["close"]:
top = stock[-i]["close"]
if stock[-i]["close"] < bottom:
bottom = stock[-i]["close"]
if top - bottom > 0:
energy = (price - bottom) / (top - bottom)
if energy < 0.5:
return "e(" + str(round(energy, 2)) + ")_"
return ""
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)