From 6e09a4d3f73da1e21021973eafd64773424708c8 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Mon, 27 Sep 2021 22:44:45 +0900 Subject: [PATCH] init --- hts/HTS.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hts/HTS.py b/hts/HTS.py index 4952874..73ae30b 100644 --- a/hts/HTS.py +++ b/hts/HTS.py @@ -638,6 +638,7 @@ class HTS: return def buyRealTime(self, stock_code, given_day): + buy_count = 0 logFp = open(given_day+".log", "w") timecheckList = pd.read_csv("timecheck.csv").values.tolist() @@ -677,9 +678,13 @@ class HTS: logFp.write("%s,%s, %d\n" % ("BUY", second, price)) logFp.flush() - count = 100 + count = 20 + buy_count += 1 + if buy_count > 5: + buy_count = 2 + # 매수 주문 - self.requestOrder("2", stock_code, count, price) + self.requestOrder("2", stock_code, count * buy_count, price) ## 매도 주문 (아래 잔고를 체킇서 매도를 호출하는 것으로 시도한다.) #time.sleep(60) #self.requestOrder("1", stock_code, count, price + 5)