This commit is contained in:
dosangyoon
2021-08-22 22:43:09 +09:00
parent 332a3b14a2
commit f84e1c65b6

View File

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