init
This commit is contained in:
18
HTS_etf.py
18
HTS_etf.py
@@ -82,7 +82,7 @@ class HTS_etf (HTS):
|
|||||||
|
|
||||||
def getCount(self, stock_code, price):
|
def getCount(self, stock_code, price):
|
||||||
if stock_code == "252670" or stock_code == "122630":
|
if stock_code == "252670" or stock_code == "122630":
|
||||||
MAX_BUY_PRICE = 300000
|
MAX_BUY_PRICE = 200000
|
||||||
else:
|
else:
|
||||||
MAX_BUY_PRICE = 100000
|
MAX_BUY_PRICE = 100000
|
||||||
|
|
||||||
@@ -141,15 +141,17 @@ class HTS_etf (HTS):
|
|||||||
if not self.orderChecker.exist(today, "A" + stock['stock_code'], mins=30):
|
if not self.orderChecker.exist(today, "A" + stock['stock_code'], mins=30):
|
||||||
buy_count = self.getCount(stock['stock_code'], bs_buy_price)
|
buy_count = self.getCount(stock['stock_code'], bs_buy_price)
|
||||||
|
|
||||||
# 매수를 주문한다.
|
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)
|
|
||||||
|
|
||||||
# slackbot에 메시지를 보냄
|
# 매수를 주문한다.
|
||||||
self.slackBot.post_to_slack(stock['stock_code'], stock['stock_name'], "BUY", bsLine['buy'][len(bsLine['buy']) - 1], buy_count)
|
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)
|
||||||
|
|
||||||
# 로그 출력
|
# slackbot에 메시지를 보냄
|
||||||
print("BUY", THIS_TIME.strftime('%Y%m%d %H%M%S'), orderNum, stock['stock_code'], stock['stock_name'], bs_buy_price, buy_count)
|
self.slackBot.post_to_slack(stock['stock_code'], stock['stock_name'], "BUY", bsLine['buy'][len(bsLine['buy']) - 1], buy_count)
|
||||||
|
|
||||||
|
# 로그 출력
|
||||||
|
print("BUY", THIS_TIME.strftime('%Y%m%d %H%M%S'), orderNum, stock['stock_code'], stock['stock_name'], bs_buy_price, buy_count)
|
||||||
|
|
||||||
|
|
||||||
if bs_sell_price > 0:
|
if bs_sell_price > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user