init
This commit is contained in:
@@ -352,7 +352,7 @@ class Analyzer:
|
|||||||
|
|
||||||
# Potential Energy
|
# Potential Energy
|
||||||
potential_energy_status = self.common.checkPotentialEnergy(STOCK, i)
|
potential_energy_status = self.common.checkPotentialEnergy(STOCK, i)
|
||||||
# 365일 중 가장 찾은 금액과 가장 높았던 금액 중 현재가의 위치 계산
|
# 120일 중 가장 낮은 금액과 가장 높았던 금액 중 현재가의 위치 계산
|
||||||
if potential_energy_status != "":
|
if potential_energy_status != "":
|
||||||
status += potential_energy_status
|
status += potential_energy_status
|
||||||
|
|
||||||
@@ -421,14 +421,14 @@ class Analyzer:
|
|||||||
fig = self.draw(stock)
|
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(%.3f), bolingerband(%.3f) 차트" % (item_name, item_code, state, buy_price, stochastic_score, bolingerband_score)
|
||||||
fig['layout'].update(title=title)
|
fig['layout'].update(title=title)
|
||||||
fileName = "%s/%s__%.3f__%.3f__%s_%s.html" % (outPath, state, stochastic_score, bolingerband_score, item_name.replace(" ", ""), item_code)
|
fileName = "%s/%s__b(%.3f)__s(%.3f)__%s_%s.html" % (outPath, state, bolingerband_score, stochastic_score, item_name.replace(" ", ""), item_code)
|
||||||
po.write_html(fig, file=fileName, auto_open=False)
|
po.write_html(fig, file=fileName, auto_open=False)
|
||||||
else:
|
else:
|
||||||
if STOCK[last_index]['volume'] > 1000000:
|
if STOCK[last_index]['volume'] > 1000000:
|
||||||
fig = self.draw(stock)
|
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(%.3f), bolingerband(%.3f) 차트"%(item_name, item_code, buy_price, stochastic_score, bolingerband_score)
|
||||||
fig['layout'].update(title=title)
|
fig['layout'].update(title=title)
|
||||||
fileName = "%s/%.3f__%.3f__%s_%s.html"%(tmp_path, bolingerband_score, stochastic_score, item_name.replace(" ", ""), item_code)
|
fileName = "%s/b(%.3f)__s(%.3f)__%s_%s.html"%(tmp_path, bolingerband_score, stochastic_score, item_name.replace(" ", ""), item_code)
|
||||||
po.write_html(fig, file=fileName, auto_open=False)
|
po.write_html(fig, file=fileName, auto_open=False)
|
||||||
|
|
||||||
rowid += 1
|
rowid += 1
|
||||||
|
|||||||
@@ -520,14 +520,14 @@ class Common:
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
def checkPotentialEnergy(self, stock, i):
|
def checkPotentialEnergy(self, stock, i):
|
||||||
# 365일 중 가장 찾은 금액과 가장 높았던 금액 중 현재가의 위치 계산
|
# 120일 중 가장 찾은 금액과 가장 높았던 금액 중 현재가의 위치 계산
|
||||||
|
|
||||||
top = stock[i]['close']
|
top = stock[i]['close']
|
||||||
bottom = stock[i]['close']
|
bottom = stock[i]['close']
|
||||||
price = stock[i]['close']
|
price = stock[i]['close']
|
||||||
|
|
||||||
if len(stock) > 365:
|
if len(stock) > 120:
|
||||||
for i in range(2, 365):
|
for i in range(2, 120):
|
||||||
if top < stock[-i]["close"]:
|
if top < stock[-i]["close"]:
|
||||||
top = stock[-i]["close"]
|
top = stock[-i]["close"]
|
||||||
|
|
||||||
@@ -537,7 +537,7 @@ class Common:
|
|||||||
if top - bottom > 0:
|
if top - bottom > 0:
|
||||||
energy = (price - bottom) / (top - bottom)
|
energy = (price - bottom) / (top - bottom)
|
||||||
if 0.1 < energy < 0.5:
|
if 0.1 < energy < 0.5:
|
||||||
return "e(" + str(round(energy, 2)) + ")_"
|
return "p(" + str(round(energy, 2)) + ")_"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user