init
This commit is contained in:
@@ -514,12 +514,24 @@ class Analyzer:
|
|||||||
if positionalEnergy < 0.2 or bolingerband_score < 0.2:
|
if positionalEnergy < 0.2 or bolingerband_score < 0.2:
|
||||||
isbuy = 2
|
isbuy = 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[-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']):
|
||||||
|
# 어제 양봉이거나
|
||||||
|
# 음봉이라면 그저깨 종가보다 어제 시가가 높거나 같고 그저깨 시가보다 어제 종가가 높다.
|
||||||
|
# 음봉이라면 그저깨 시가보다 어제 시가가 높거나 같고 그저깨 종가보다 어제 종가가 높다.
|
||||||
|
if STOCK[-2]['open'] < STOCK[-2]['close'] or (
|
||||||
|
(STOCK[-3]['close'] <= STOCK[-2]['open'] and STOCK[-3]['open'] < STOCK[-2]['close']) or
|
||||||
|
(STOCK[-3]['open'] <= STOCK[-2]['open'] and STOCK[-3]['close'] < STOCK[-2]['close'])):
|
||||||
|
# (KOSPI: 2011년 8월 11일)
|
||||||
|
# 오늘 양봉이어야 한다.
|
||||||
|
if STOCK[-1]['open'] < STOCK[-1]['close']:
|
||||||
|
isbuy = 3
|
||||||
|
# (KOSPI: 2011년 9월 26일)
|
||||||
|
# 오늘 음봉이라면, 오늘 시가는 어제 종가보다 높아야 하고, 오늘 종가는 어제 시가보다 높아야 한다.
|
||||||
|
if (STOCK[-1]['close'] < STOCK[-1]['open']) and (STOCK[-2]['close'] < STOCK[-1]['open'] and STOCK[-2]['open'] < STOCK[-1]['close']):
|
||||||
isbuy = 3
|
isbuy = 3
|
||||||
|
|
||||||
if isbuy >= 3 and state != "":
|
if isbuy >= 3 and state != "":
|
||||||
|
|||||||
Reference in New Issue
Block a user