This commit is contained in:
dsyoon
2021-09-04 13:28:02 +09:00
parent 7fd567cb45
commit 4cdcb62dcf

View File

@@ -506,21 +506,24 @@ class Analyzer:
state, buy_price = self.analyzeFinalScore(last_index, STOCK, STOCHASTIC)
isbuy = 0
# 종가가 240일선 아래에 있으면 매수한다.
if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg60']:
isbuy = 1
# 위치에너지 < 0.4 and 볼린저밴드 < 0.3 이어야 한다.
if positionalEnergy < 0.3 or bolingerband_score < 0.3:
isbuy = 2
# 볼린저밴드 하단에 부딪힌 후 2개의 양봉을 보였으면, 매수한다.
if len(STOCK) > 5:
if STOCK[-1]['open'] < STOCK[-1]['close'] and STOCK[-2]['open'] < STOCK[-2]['close']:
if (STOCK[-3]['low'] <= BOLINGERBAND[-3]['lower'] <= STOCK[-3]['high'] or
STOCK[-4]['low'] <= BOLINGERBAND[-4]['lower'] <= STOCK[-4]['high'] or
STOCK[-5]['low'] <= BOLINGERBAND[-5]['lower'] <= STOCK[-5]['high']):
isbuy = 1
isbuy = 3
# 종가가 240일선 아래에 있으면 매수한다.
if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg60']:
isbuy = 2
# 위치에너지 < 0.4 and 볼린저밴드 < 0.3 이어야 한다.
if positionalEnergy < 30 or bolingerband_score < 0.3:
isbuy = 0
if isbuy >= 3 and state != "":
isbuy = 4
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)