rm dbg
This commit is contained in:
12
order.py
12
order.py
@@ -14,7 +14,6 @@ class OrderManager:
|
||||
"MS": 100,
|
||||
"WFC": 100,
|
||||
"XLF": 100,
|
||||
|
||||
}
|
||||
|
||||
self.exchange = exchange
|
||||
@@ -53,13 +52,14 @@ class OrderManager:
|
||||
# (print문은 필요시 주석 해제하여 로깅 용도로 사용하세요)
|
||||
# print("전송 제한 초과! 주문이 무시되었습니다.")
|
||||
return False
|
||||
print("전송 시도: ", action_type, kwargs)
|
||||
# 전송 조건 통과 시 실제 통신 수행
|
||||
if action_type == "add":
|
||||
size = kwargs["size"]
|
||||
if self.future_positions[kwargs["symbol"]] + size > self.POSITIONS_LIMIT[kwargs["symbol"]]:
|
||||
if (
|
||||
self.future_positions[kwargs["symbol"]] + size
|
||||
> self.POSITIONS_LIMIT[kwargs["symbol"]]
|
||||
):
|
||||
return False
|
||||
print(f"주문 전송: {kwargs}")
|
||||
self.future_positions[kwargs["symbol"]] += size
|
||||
self.exchange.send_add_message(**kwargs)
|
||||
|
||||
@@ -81,9 +81,9 @@ class OrderManager:
|
||||
price=price,
|
||||
size=size,
|
||||
)
|
||||
|
||||
def convert(self, symbol: str, size: int):
|
||||
if symbol == "VALE":
|
||||
target = "VALBZ"
|
||||
self.future_positions["VALE"] -= size
|
||||
self.future_positions["VALBZ"] += size
|
||||
self.positions["VALE"] -= size
|
||||
@@ -118,4 +118,4 @@ class OrderManager:
|
||||
self.orders[order_id]["quantity"] = new_size
|
||||
|
||||
def check_pos_limit(self, symbol: str) -> bool:
|
||||
return abs(self.positions[symbol]) < self.POSITIONS_LIMIT[symbol]
|
||||
return abs(self.positions[symbol]) < self.POSITIONS_LIMIT[symbol]
|
||||
|
||||
Reference in New Issue
Block a user