From 332a3b14a21b6a1f505cf5ca561a6c10ca496012 Mon Sep 17 00:00:00 2001 From: dosangyoon Date: Sun, 22 Aug 2021 22:30:42 +0900 Subject: [PATCH] init --- stockpredictor/analysis/Analyzer.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/stockpredictor/analysis/Analyzer.py b/stockpredictor/analysis/Analyzer.py index b69144d..c597567 100644 --- a/stockpredictor/analysis/Analyzer.py +++ b/stockpredictor/analysis/Analyzer.py @@ -510,14 +510,13 @@ class Analyzer: isbuy = 0 # 볼린저밴드 하단에 부딪힌 후 2개의 양봉을 보였으면, 매수한다. - count = 0 - if len(STOCK) > 3 and STOCK[-1]['open'] < STOCK[-1]['close']: - for idx in range(2, 5): - if STOCK[-idx]['open'] < STOCK[-idx]['close']: - count += 1 - 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']): + 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 + STOCK[-4]['low'] <= BOLINGERBAND[-4]['lower'] <= STOCK[-4]['high'] or + STOCK[-5]['low'] <= BOLINGERBAND[-5]['lower'] <= STOCK[-5]['high']): isbuy = 1 + # 종가가 120일선 아래에 있으면 매수한다. #if STOCK[last_index]['close'] < STOCK[last_index]['avg120']: # isbuy = 1