This commit is contained in:
dsyoon
2021-09-27 22:44:45 +09:00
parent d33304f784
commit 6e09a4d3f7

View File

@@ -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)