val 22 e2

This commit is contained in:
2026-05-09 16:21:56 +09:00
parent e8886cebc4
commit d5c06c6b1a
2 changed files with 14 additions and 4 deletions

View File

@@ -98,6 +98,16 @@ def on_book(message, man: Manager):
valePos * valeBid > valePos * valeBid >
valbzPos * valbzBid + FEE): valbzPos * valbzBid + FEE):
man.orderMan.convert("VALBZ", Dir.SELL, valbzPos) man.orderMan.convert("VALBZ", Dir.SELL, valbzPos)
elif message["message"] == "BOND":
now = time.time()
if now > last_print_time:
last_print_time = now
print(message)
print()
bondPos = man.positionMan.get_position("BOND")
bondBid = man.valueMan.get_bid("")

View File

@@ -16,7 +16,7 @@ class OrderManager:
self._order_size += 1 self._order_size += 1
return self._order_size return self._order_size
def _attempt_send(self, action_type: str, symbol: str, dir: Dir, price: int, size: int) -> bool: def _attempt_send(self, action_type: str, order_id: int, symbol: str, dir: Dir, price: int, size: int) -> bool:
""" """
주문 전송을 시도합니다. 주문 전송을 시도합니다.
제한에 걸려 무시되면 False를, 정상 전송되면 True를 반환합니다. 제한에 걸려 무시되면 False를, 정상 전송되면 True를 반환합니다.
@@ -30,11 +30,11 @@ class OrderManager:
# 전송 조건 통과 시 실제 통신 수행 # 전송 조건 통과 시 실제 통신 수행
if action_type == "add": if action_type == "add":
self.exchange.send_add_message(symbol=symbol, dir=dir, price=price, size=size) self.exchange.send_add_message(symbol=symbol, order_id=order_id, dir=dir, price=price, size=size)
elif action_type == "cancel": elif action_type == "cancel":
self.exchange.send_cancel_message(symbol=symbol, dir=dir, price=price, size=size) self.exchange.send_cancel_message(order_id=order_id)
elif action_type == "convert": elif action_type == "convert":
self.exchange.send_convert_message(symbol=symbol, dir=dir, price=price, size=size) self.exchange.send_convert_message(symbol=symbol, order_id=order_id, dir=dir, size=size)
self._send_timestamps.append(now) self._send_timestamps.append(now)
return True return True