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