This commit is contained in:
dsyoon
2021-09-11 14:41:29 +09:00
parent 4d9f2a8c60
commit 547a0130c9

View File

@@ -513,18 +513,20 @@ class Analyzer:
isbuy = 0 isbuy = 0
if stochastic_score < 20 and bolingerband_score < 0.3: # 스토케스틱이 20이하이어야 하며, 볼린저밴드 0.3 보다 작으며, 위치에너지도 0.2보다 낮다면,
# 위치에너지 < 0.4 and 볼린저밴드 < 0.3 이어야 한다. if stochastic_score < 30 and bolingerband_score < 0.3 and positionalEnergy < 0.3:
if positionalEnergy < 0.2 or bolingerband_score < 0.2:
isbuy = 1 isbuy = 1
# 종가가 240일선 아래에 있으면 매수한다. # 위치에너지가 낮거나 240일선 아래에 있는 상태에서 상태값을 갖는 경우 매수한다.
if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg240']: if state != "":
isbuy = 2 isbuy = 2
# 위치에너지가 낮거나 240일선 아래에 있는 상태에서 상태값을 갖는 경우 매수한다. # 종가가 240일선 아래라면 매수한다.
if isbuy > 0 and state != "": if STOCK[last_index]['close'] < STOCK[last_index]['avg240']:
if state == "":
isbuy = 3 isbuy = 3
else:
isbuy = 4
if len(STOCK) > 5: if len(STOCK) > 5:
# 볼린저밴드 하단에 부딪혔다면, # 볼린저밴드 하단에 부딪혔다면,
@@ -540,10 +542,13 @@ class Analyzer:
# (KOSPI: 2011년 8월 11일) # (KOSPI: 2011년 8월 11일)
# 오늘 양봉이어야 한다. # 오늘 양봉이어야 한다.
if STOCK[last_index]['open'] < STOCK[last_index]['close']: if STOCK[last_index]['open'] < STOCK[last_index]['close']:
isbuy = 9 isbuy = 5
# (KOSPI: 2011년 9월 26일) # (KOSPI: 2011년 9월 26일)
# 오늘 음봉이라면, 오늘 시가는 어제 종가보다 높아야 하고, 오늘 종가는 어제 시가보다 높아야 한다. # 오늘 음봉이라면, 오늘 시가는 어제 종가보다 높아야 하고, 오늘 종가는 어제 시가보다 높아야 한다.
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 = 5
if isbuy==4 and stochastic_score < 30 and bolingerband_score < 0.3 and positionalEnergy < 0.3:
isbuy = 9 isbuy = 9
fig = self.draw(stock) fig = self.draw(stock)