init
This commit is contained in:
@@ -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)
|
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)
|
po.write_html(fig, file=fileName, auto_open=False)
|
||||||
|
|
||||||
count = 0
|
|
||||||
if bolingerband_score < 0.15:
|
if bolingerband_score < 0.15:
|
||||||
fileName = self.bolingerband_path
|
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)
|
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)
|
po.write_html(fig, file=fileName, auto_open=False)
|
||||||
count += 1
|
|
||||||
|
|
||||||
if stochastic_score < 15:
|
if stochastic_score < 15:
|
||||||
fileName = self.stochastic_path
|
fileName = self.stochastic_path
|
||||||
@@ -414,9 +412,8 @@ class Analyzer:
|
|||||||
fileName = self.positionalEnergy_path
|
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)
|
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)
|
po.write_html(fig, file=fileName, auto_open=False)
|
||||||
count += 1
|
|
||||||
|
|
||||||
if count > 1:
|
if isbuy > 0:
|
||||||
fileName = self.outPath
|
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)
|
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)
|
po.write_html(fig, file=fileName, auto_open=False)
|
||||||
@@ -517,11 +514,9 @@ class Analyzer:
|
|||||||
STOCK[-5]['low'] <= BOLINGERBAND[-5]['lower'] <= STOCK[-5]['high']):
|
STOCK[-5]['low'] <= BOLINGERBAND[-5]['lower'] <= STOCK[-5]['high']):
|
||||||
isbuy = 1
|
isbuy = 1
|
||||||
|
|
||||||
# 종가가 120일선 아래에 있으면 매수한다.
|
# 종가가 240일선 아래에 있으면 매수한다.
|
||||||
#if STOCK[last_index]['close'] < STOCK[last_index]['avg120']:
|
if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg60']:
|
||||||
# isbuy = 1
|
isbuy = 2
|
||||||
#else:
|
|
||||||
# isbuy = 0
|
|
||||||
|
|
||||||
fig = self.draw(stock)
|
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)
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user