This commit is contained in:
dsyoon
2021-09-11 00:14:18 +09:00
parent 49c3ed87d5
commit 9de67f63a3

View File

@@ -512,13 +512,18 @@ class Analyzer:
state, buy_price = self.analyzeFinalScore(last_index, STOCK, STOCHASTIC) state, buy_price = self.analyzeFinalScore(last_index, STOCK, STOCHASTIC)
isbuy = 0 isbuy = 0
# 종가가 240일선 아래에 있으면 매수한다.
if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg240']:
isbuy = 1
# 위치에너지 < 0.4 and 볼린저밴드 < 0.3 이어야 한다. if stochastic_score < 30 and bolingerband_score < 0.3:
if positionalEnergy < 0.2 or bolingerband_score < 0.2: # 종가가 240일선 아래에 있으면 매수한다.
isbuy = 2 if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg240']:
isbuy = 1
# 위치에너지 < 0.4 and 볼린저밴드 < 0.3 이어야 한다.
if positionalEnergy < 0.2 or bolingerband_score < 0.2:
isbuy = 2
if isbuy > 0 and state != "":
isbuy = 3
if len(STOCK) > 5: if len(STOCK) > 5:
# 볼린저밴드 하단에 부딪혔다면, # 볼린저밴드 하단에 부딪혔다면,
@@ -540,9 +545,6 @@ class Analyzer:
if (STOCK[last_index]['close'] < STOCK[last_index]['open']) and (STOCK[last_index-1]['close'] < STOCK[last_index]['open'] and STOCK[last_index-1]['open'] < STOCK[last_index]['close']): if (STOCK[last_index]['close'] < STOCK[last_index]['open']) and (STOCK[last_index-1]['close'] < STOCK[last_index]['open'] and STOCK[last_index-1]['open'] < STOCK[last_index]['close']):
isbuy = 9 isbuy = 9
if isbuy >= 3 and state != "":
isbuy = 4
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)
fig['layout'].update(title=title) fig['layout'].update(title=title)