init
This commit is contained in:
@@ -9,6 +9,7 @@ from hts.OrderType import OrderType
|
||||
|
||||
from hts.BuySellChecker import BuySellChecker
|
||||
from hts.OrderChecker import OrderChecker
|
||||
from stock.util.SlackBot import SlackBot
|
||||
|
||||
class HTS_DAILY (HTS):
|
||||
|
||||
@@ -22,6 +23,7 @@ class HTS_DAILY (HTS):
|
||||
|
||||
def __init__(self, RESOURCE_PATH):
|
||||
super().__init__(RESOURCE_PATH)
|
||||
self.slackBot = SlackBot()
|
||||
|
||||
self.RESOURCE_PATH = RESOURCE_PATH
|
||||
self.dailyStatus = DailyStatus(RESOURCE_PATH)
|
||||
@@ -132,6 +134,8 @@ class HTS_DAILY (HTS):
|
||||
|
||||
# 매수를 주문한다.
|
||||
orderNum = self.requestOrder(OrderType.buy, stock_code, buy_count, bs_buy_price)
|
||||
# slackbot에 메시지를 보냄
|
||||
self.slackBot.post_to_slack(stock_code, stock_name, "BUY", bsLine['buy'][len(bsLine['buy']) - 1], buy_count)
|
||||
self.orderChecker.add(today, stock_code, 1, buy_count, bs_buy_price, orderNum)
|
||||
|
||||
# 로그 출력
|
||||
@@ -143,6 +147,8 @@ class HTS_DAILY (HTS):
|
||||
if bsLine['sell'][last_index] > 0:
|
||||
bs_sell_price = bsLine['sell'][last_index]
|
||||
orderNum = self.getSellingPrice(THIS_TIME, stock_code, bs_sell_price)
|
||||
# slackbot에 메시지를 보냄
|
||||
self.slackBot.post_to_slack(stock_code, stock_name, "SELL", bsLine['sell'][len(bsLine['sell']) - 1], -1)
|
||||
self.orderChecker.delete(today, stock_code)
|
||||
|
||||
# 로그 출력
|
||||
|
||||
Reference in New Issue
Block a user