This commit is contained in:
dosangyoon
2021-08-22 22:30:42 +09:00
parent 9cc1cee785
commit 332a3b14a2

View File

@@ -510,14 +510,13 @@ class Analyzer:
isbuy = 0 isbuy = 0
# 볼린저밴드 하단에 부딪힌 후 2개의 양봉을 보였으면, 매수한다. # 볼린저밴드 하단에 부딪힌 후 2개의 양봉을 보였으면, 매수한다.
count = 0 if len(STOCK) > 5:
if len(STOCK) > 3 and STOCK[-1]['open'] < STOCK[-1]['close']: if STOCK[-1]['open'] < STOCK[-1]['close'] and STOCK[-2]['open'] < STOCK[-2]['close']:
for idx in range(2, 5): if (STOCK[-3]['low'] <= BOLINGERBAND[-3]['lower'] <= STOCK[-3]['high'] or
if STOCK[-idx]['open'] < STOCK[-idx]['close']: STOCK[-4]['low'] <= BOLINGERBAND[-4]['lower'] <= STOCK[-4]['high'] or
count += 1 STOCK[-5]['low'] <= BOLINGERBAND[-5]['lower'] <= STOCK[-5]['high']):
if count > 1:
if (BOLINGERBAND[last_index]['lower'] < STOCK[-3]['close'] < BOLINGERBAND[last_index]['upper'] or BOLINGERBAND[last_index]['lower'] < STOCK[-4]['close'] < BOLINGERBAND[last_index]['upper']):
isbuy = 1 isbuy = 1
# 종가가 120일선 아래에 있으면 매수한다. # 종가가 120일선 아래에 있으면 매수한다.
#if STOCK[last_index]['close'] < STOCK[last_index]['avg120']: #if STOCK[last_index]['close'] < STOCK[last_index]['avg120']:
# isbuy = 1 # isbuy = 1