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