From 4475ba411974530268d47ab8a75bbfb38ac233fc Mon Sep 17 00:00:00 2001 From: dsyoon Date: Mon, 6 Feb 2023 12:41:28 +0900 Subject: [PATCH] init --- hts/BuySellChecker.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hts/BuySellChecker.py b/hts/BuySellChecker.py index 7b29f08..1f80240 100644 --- a/hts/BuySellChecker.py +++ b/hts/BuySellChecker.py @@ -112,6 +112,9 @@ class BuySellChecker: def getBuyPriceAndWeight(self, data, data_5, data_30, i): buy, weight = -1, -1 + if len(data_5['slow_k']) <= i: + return buy, weight + if data_5['slow_k'][i] < 20: if data_5['slow_k'][i - 1] < data_5['slow_d'][i - 1] and data_5['slow_d'][i] < data_5['slow_k'][i]: buy = data['low'][i]