init
This commit is contained in:
23
HTS_daily.py
23
HTS_daily.py
@@ -120,19 +120,20 @@ class HTS_DAILY (HTS):
|
||||
bsLine, data = self.buySellChecker.checkTransactionWithEnvelope(data, stock_code, self.analyzed_day, isRealTime=False)
|
||||
|
||||
# 다음 조건이면 매수한다.
|
||||
if len(data.index) > 10 and max(bsLine['buy'][len(bsLine['buy']) - 1:]) > 1000 and not self.orderChecker.exist(stock_code):
|
||||
last_index = len(bsLine['buy'])-1
|
||||
if bsLine['buy'][last_index] > 0:
|
||||
bs_buy_price = bsLine['buy'][last_index]
|
||||
bs_buy_weight = bsLine['buy_weight'][last_index]
|
||||
buy_count = int((self.MAX_BUY_PRICE*bs_buy_weight) / bs_buy_price)
|
||||
if len(data.index) > 10 and max(bsLine['buy'][len(bsLine['buy']) - 1:]) > 1000:
|
||||
if not self.orderChecker.exist(stock_code):
|
||||
last_index = len(bsLine['buy'])-1
|
||||
if bsLine['buy'][last_index] > 0:
|
||||
bs_buy_price = bsLine['buy'][last_index]
|
||||
bs_buy_weight = bsLine['buy_weight'][last_index]
|
||||
buy_count = int((self.MAX_BUY_PRICE*bs_buy_weight) / bs_buy_price)
|
||||
|
||||
# 매수를 주문한다.
|
||||
orderNum = self.requestOrder(OrderType.buy, stock_code, buy_count, bs_buy_price)
|
||||
self.orderChecker.add(today, stock_code, 1, orderNum, buy_count, bs_buy_price)
|
||||
# 매수를 주문한다.
|
||||
orderNum = self.requestOrder(OrderType.buy, stock_code, buy_count, bs_buy_price)
|
||||
self.orderChecker.add(today, stock_code, 1, orderNum, buy_count, bs_buy_price)
|
||||
|
||||
# 로그 출력
|
||||
print("BUY", THIS_TIME.strftime('%Y%m%d %H%M%S'), orderNum, stock_code, stock_name, bs_buy_price, buy_count)
|
||||
# 로그 출력
|
||||
print("BUY", THIS_TIME.strftime('%Y%m%d %H%M%S'), orderNum, stock_code, stock_name, bs_buy_price, buy_count)
|
||||
|
||||
"""
|
||||
# 다음 조건이면 매도한다.
|
||||
|
||||
Reference in New Issue
Block a user