From e4fb3759c5d5ab6c7cf771dac524fafbd8a94b5c Mon Sep 17 00:00:00 2001 From: dsyoon Date: Thu, 14 Dec 2023 09:20:17 +0900 Subject: [PATCH] init --- hts/BuySellChecker.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hts/BuySellChecker.py b/hts/BuySellChecker.py index 4024615..056cfd5 100644 --- a/hts/BuySellChecker.py +++ b/hts/BuySellChecker.py @@ -133,8 +133,7 @@ class BuySellChecker(): # 방법 2: if data['avg480'][i] < data['avg120'][i] < data['avg60'][i] < data['avg20'][i] < data['avg5'][i] < data['close'][i]: if data['avg240'][i] < min(data['avg5'][i], data['avg20'][i], data['avg60'][i], data['avg120'][i]): - if BUY_LIST is not None and 0 < len(BUY_LIST['buy_list']) and data['ymd'][i] < \ - BUY_LIST['buy_list'][-1]['buy_ymd'] + timedelta(minutes=10): + if BUY_LIST is not None and 0 < len(BUY_LIST['buy_list']) and data['ymd'][i] < BUY_LIST['buy_list'][-1]['buy_ymd'] + timedelta(minutes=10): if BUY_LIST['buy_list'][-1]['buy_price'] < data['close'][i]: buy_price = data['close'][i] buy_type = 'golden' @@ -187,6 +186,13 @@ class BuySellChecker(): sell_price = data['close'][i] sell_count = sum([price['buy_count'] for price in BUY_LIST['buy_list']]) + down_count = [1 for c in range(i - 3, i + 1) if data['close'][c - 1] < data['open'][c]] + if 3 <= sum(down_count): + count = sum([price['buy_count'] for price in BUY_LIST['buy_list']]) + if 0 < count: + sell_price = data['close'][i] + sell_count = sum([price['buy_count'] for price in BUY_LIST['buy_list']]) + return sell_price, sell_count def checkTransaction1(self, ticker, MAX_BUY_PRICE, data, data_signal, BUY_LIST=None, isRealTime=True):