Skip to content

Commit fb788bf

Browse files
committed
Support new order statuses for JoinQuant
1 parent 46d12bb commit fb788bf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

shipane_sdk/joinquant/manager.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def convert_order(self, quant_order):
5353
price=quant_order.limit,
5454
amount=quant_order.amount,
5555
style=(OrderStyle.LIMIT if quant_order.limit > 0 else OrderStyle.MARKET),
56-
status=OrderStatus(quant_order.status.value),
56+
status=self._convert_status(quant_order.status),
5757
add_time=quant_order.add_time,
5858
)
5959
return common_order
@@ -99,6 +99,13 @@ def _convert_position(quant_position):
9999
position.value = quant_position.value
100100
return position
101101

102+
@staticmethod
103+
def _convert_status(quant_order_status):
104+
try:
105+
return OrderStatus(quant_order_status.value)
106+
except ValueError:
107+
return OrderStatus.open
108+
102109

103110
class JoinQuantLogger(BaseLogger):
104111
def debug(self, msg, *args, **kwargs):

0 commit comments

Comments
 (0)