This commit is contained in:
dosangyoon
2022-08-11 03:06:30 +09:00
parent e117b108fc
commit 42df0fc3fa
5 changed files with 98 additions and 51 deletions

View File

@@ -41,12 +41,8 @@ class HTS_122630 (HTS):
else:
sell_price = (int(final_price) - int(final_price) % 5) + diff
if code == "A"+stock_code:
if log_time.strftime('%H%M') < "1430":
orderNum = self.requestOrder(OrderType.sell, stock_code, jangoDic[code]['매도가능'], sell_price)
print("ORDER_SELL", stock_code, log_time.strftime('%Y%m%d %H%M%S'), jangoDic[code]['매도가능'], sell_price)
else:
orderNum = self.requestOrder(OrderType.sell, stock_code, jangoDic[code]['매도가능'], sell_price)
print("ORDER_SELL", stock_code, log_time.strftime('%Y%m%d %H%M%S'), jangoDic[code]['매도가능'], sell_price)
orderNum = self.requestOrder(OrderType.sell, stock_code, jangoDic[code]['매도가능'], sell_price)
print("ORDER_SELL", stock_code, log_time.strftime('%Y%m%d %H%M%S'), jangoDic[code]['매도가능'], sell_price)
return
def buyRealTime(self, today):
@@ -115,7 +111,7 @@ class HTS_122630 (HTS):
self.cancelOrderList(orderListToCancel)
# 매도 한다.
self.getSellingPrice(THIS_TIME, self.stock_code, final_price)
self.getSellingPrice(THIS_TIME, self.stock_code, final_price, diff=0)
# 로그 출력
@@ -152,7 +148,7 @@ class HTS_122630 (HTS):
result = self.getRealTime(self.stock_code, today, LAST_DATA)
final_price = result["close"][len(result["close"]) - 1]
self.getSellingPrice(THIS_TIME, self.stock_code, final_price)
self.getSellingPrice(THIS_TIME, self.stock_code, final_price=0)
final_sell_check = True
@@ -179,7 +175,7 @@ if __name__ == "__main__":
# KODEX 인버스 * 2
stock_code = "122630"
stock_name = "KODEX 레버리지"
buy_count = 130
buy_count = 120
hts = HTS_122630(RESOURCE_PATH, stock_code, buy_count)
today_str = today.strftime('%Y%m%d')