From 4d9f2a8c6037ba3508c5b6ab00cc6c15a4292479 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Sat, 11 Sep 2021 14:24:34 +0900 Subject: [PATCH] init --- stockpredictor/analysis/Analyzer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stockpredictor/analysis/Analyzer.py b/stockpredictor/analysis/Analyzer.py index 6d4173a..b77247c 100644 --- a/stockpredictor/analysis/Analyzer.py +++ b/stockpredictor/analysis/Analyzer.py @@ -514,14 +514,15 @@ class Analyzer: isbuy = 0 if stochastic_score < 20 and bolingerband_score < 0.3: - # 종가가 240일선 아래에 있으면 매수한다. - if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg240']: - isbuy = 1 - # 위치에너지 < 0.4 and 볼린저밴드 < 0.3 이어야 한다. if positionalEnergy < 0.2 or bolingerband_score < 0.2: + isbuy = 1 + + # 종가가 240일선 아래에 있으면 매수한다. + if isbuy > 0 and STOCK[last_index]['close'] < STOCK[last_index]['avg240']: isbuy = 2 + # 위치에너지가 낮거나 240일선 아래에 있는 상태에서 상태값을 갖는 경우 매수한다. if isbuy > 0 and state != "": isbuy = 3