init
This commit is contained in:
@@ -256,19 +256,11 @@ class HTS_etf (HTS):
|
||||
|
||||
try:
|
||||
# 데이터를 가지고 온다.
|
||||
result = self.getRealTime(stock['stock_code'], today, LAST_DATA[stock['stock_code']])
|
||||
data = self.getRealTime(stock['stock_code'], today, LAST_DATA[stock['stock_code']])
|
||||
except:
|
||||
print("#ERROR:", stock['stock_code'], stock['stock_name'])
|
||||
continue
|
||||
|
||||
result_5 = self.makeTickData(result, mins=5)
|
||||
result_30 = self.makeTickData(result, mins=30)
|
||||
if len(result_30['time']) < 100:
|
||||
continue
|
||||
|
||||
data = self.buySellChecker.analyze(result)
|
||||
data.drop(data.index[:len(data) - analyzed_day], inplace=True)
|
||||
|
||||
# 현재 매수가
|
||||
bs_buy_price = data["close"][len(data["close"]) - 1]
|
||||
|
||||
@@ -280,12 +272,11 @@ class HTS_etf (HTS):
|
||||
|
||||
if bs_buy_price > 1000:
|
||||
|
||||
if not self.orderChecker.exist(today, "A" + stock['stock_code'], hours=9):
|
||||
if not self.orderChecker.exist(today, "A" + stock['stock_code'], hours=5):
|
||||
stock_type = self.getStockType(stock['stock_code'], short=False)
|
||||
buy_count = self.getBuyCount(bs_buy_price, kospi_type, stock_type)
|
||||
|
||||
if buy_count > 0:
|
||||
|
||||
# 매수를 주문한다.
|
||||
orderNum = self.requestOrder(OrderType.buy, stock['stock_code'], buy_count , bs_buy_price)
|
||||
self.orderChecker.buy(today, "A" + stock['stock_code'], buy_count, bs_buy_price, orderNum)
|
||||
|
||||
Reference in New Issue
Block a user