OrderId

View as MarkdownOpen in Claude

The Order ID is a client-managed identifier used to track, modify, and cancel orders. As a result, it must be strictly increasing.

The nextValidId() callback function receives the next valid order ID. This function is called once upon initial connection.

The reqIds() function can be used to request the next valid ID, which is returned via the nextValidId() callback function.

Python
1class TestApp(EClient, EWrapper):
2 def __init__(self):
3 EClient.__init__(self, self)
4 self.nextOrderId = None
5
6 def nextValidId(self, orderId: OrderId):
7 self.nextOrderId = orderId