From f84e1c65b6e8e3b89fefa36d668b44dfdd2867e4 Mon Sep 17 00:00:00 2001 From: dosangyoon Date: Sun, 22 Aug 2021 22:43:09 +0900 Subject: [PATCH] init --- stockpredictor/analysis/Analyzer.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/stockpredictor/analysis/Analyzer.py b/stockpredictor/analysis/Analyzer.py index c597567..5be10fe 100644 --- a/stockpredictor/analysis/Analyzer.py +++ b/stockpredictor/analysis/Analyzer.py @@ -398,12 +398,10 @@ class Analyzer: fileName = "%s/%d__%s__p(%.2f)__b(%.2f)__s(%.2f)__%d__%s_%s.html" % (fileName, isbuy, state, positionalEnergy, bolingerband_score, stochastic_score, buy_price, item_name.replace(" ", ""), item_code) po.write_html(fig, file=fileName, auto_open=False) - count = 0 if bolingerband_score < 0.15: fileName = self.bolingerband_path fileName = "%s/%d__b(%.2f)__p(%.2f)__s(%.2f)__%s__%d__%s_%s.html" % (fileName, isbuy, bolingerband_score, positionalEnergy, stochastic_score, state, buy_price, item_name.replace(" ", ""), item_code) po.write_html(fig, file=fileName, auto_open=False) - count += 1 if stochastic_score < 15: fileName = self.stochastic_path @@ -414,9 +412,8 @@ class Analyzer: fileName = self.positionalEnergy_path fileName = "%s/%d__p(%.2f)__b(%.2f)__s(%.2f)__%s__%d__%s_%s.html" % (fileName, isbuy, positionalEnergy, bolingerband_score, stochastic_score, state, buy_price, item_name.replace(" ", ""), item_code) po.write_html(fig, file=fileName, auto_open=False) - count += 1 - if count > 1: + if isbuy > 0: fileName = self.outPath fileName = "%s/%d__p(%.2f)__b(%.2f)__s(%.2f)__%s__%d__%s_%s.html" % (fileName, isbuy, positionalEnergy, bolingerband_score, stochastic_score, state, buy_price, item_name.replace(" ", ""), item_code) po.write_html(fig, file=fileName, auto_open=False) @@ -517,11 +514,9 @@ class Analyzer: STOCK[-5]['low'] <= BOLINGERBAND[-5]['lower'] <= STOCK[-5]['high']): isbuy = 1 - # 종가가 120일선 아래에 있으면 매수한다. - #if STOCK[last_index]['close'] < STOCK[last_index]['avg120']: - # isbuy = 1 - #else: - # isbuy = 0 + # 종가가 240일선 아래에 있으면 매수한다. + if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg60']: + isbuy = 2 fig = self.draw(stock) title = "%s (%s), %s, buy_price (%d), stochastic(%.2f), bolingerband(%.2f), positionalEnergy(%.2f) 차트" % (item_name, item_code, state, buy_price, stochastic_score, bolingerband_score, positionalEnergy)