From 6a97e00e168c4e928cd4567bf4daa5452896f133 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Sat, 24 Jul 2021 02:34:23 +0900 Subject: [PATCH] init --- stockpredictor/analysis/Analyzer.py | 16 +++++----------- stockpredictor/analysis/Common.py | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/stockpredictor/analysis/Analyzer.py b/stockpredictor/analysis/Analyzer.py index 553a07a..452a2c6 100644 --- a/stockpredictor/analysis/Analyzer.py +++ b/stockpredictor/analysis/Analyzer.py @@ -350,12 +350,6 @@ class Analyzer: status += eveningstar_status """ - # Potential Energy - potential_energy_status = self.common.checkPotentialEnergy(STOCK, i) - # 120일 중 가장 낮은 금액과 가장 높았던 금액 중 현재가의 위치 계산 - if potential_energy_status != "": - status += potential_energy_status - return status, buy_price # 그래프 출력 @@ -412,23 +406,23 @@ class Analyzer: bolingerband_score = round(((STOCK[last_index]['close']-BOLINGERBAND[last_index]['lower'])/(BOLINGERBAND[last_index]['upper']-BOLINGERBAND[last_index]['lower'])), 2) - if stochastic_score < 50 and bolingerband_score < 0.5: + if stochastic_score < 40 and bolingerband_score < 0.4: # 종목 상태 체크 분석 state, buy_price = self.analyzeFinalScore(last_index, STOCK, STOCHASTIC) if state != "": fig = self.draw(stock) - title = "%s (%s), %s, buy_price (%d), stochastic(%.3f), bolingerband(%.3f) 차트" % (item_name, item_code, state, buy_price, stochastic_score, bolingerband_score) + title = "%s (%s), %s, buy_price (%d), stochastic(%.1f), bolingerband(%.1f) 차트" % (item_name, item_code, state, buy_price, stochastic_score, bolingerband_score) fig['layout'].update(title=title) - fileName = "%s/%s__b(%.3f)__s(%.3f)__%s_%s.html" % (outPath, state, bolingerband_score, stochastic_score, item_name.replace(" ", ""), item_code) + fileName = "%s/%s__b(%.1f)__s(%.1f)__%s_%s.html" % (outPath, state, bolingerband_score, stochastic_score, item_name.replace(" ", ""), item_code) po.write_html(fig, file=fileName, auto_open=False) else: if STOCK[last_index]['volume'] > 1000000: fig = self.draw(stock) - title = "%s (%s) buy_price (%d), stochastic(%.3f), bolingerband(%.3f) 차트"%(item_name, item_code, buy_price, stochastic_score, bolingerband_score) + title = "%s (%s) buy_price (%d), stochastic(%.1f), bolingerband(%.1f) 차트"%(item_name, item_code, buy_price, stochastic_score, bolingerband_score) fig['layout'].update(title=title) - fileName = "%s/b(%.3f)__s(%.3f)__%s_%s.html"%(tmp_path, bolingerband_score, stochastic_score, item_name.replace(" ", ""), item_code) + fileName = "%s/b(%.1f)__s(%.1f)__%s_%s.html"%(tmp_path, bolingerband_score, stochastic_score, item_name.replace(" ", ""), item_code) po.write_html(fig, file=fileName, auto_open=False) rowid += 1 diff --git a/stockpredictor/analysis/Common.py b/stockpredictor/analysis/Common.py index 7defc8e..2d3ee94 100644 --- a/stockpredictor/analysis/Common.py +++ b/stockpredictor/analysis/Common.py @@ -537,7 +537,7 @@ class Common: if top - bottom > 0: energy = (price - bottom) / (top - bottom) if 0.1 < energy < 0.5: - return "p(" + str(round(energy, 2)) + ")_" + return "p(" + str(round(energy*100, 1)) + ")_" return ""