Yes I know but this repeated order number won't collide with the already executed order because?it's gone
toggle quoted message
Show quoted text
El s¨¢b, 2 dic 2023 a las 8:19, J G via (<windmill_1965=
[email protected]>) escribi¨®:
joanmarcel119 wrote: "If the number of the order (still open) is greater than the nextvalidId number I got at the beginning then I update it. This way the next increment is a number which won't collide with another order on the system. " I don't think that this is a foolproof solution. You only check for the highest order ID for the currently open orders. But you neglect to check for the order IDs for the orders that have already filled. It could be that an order (having order ID 120) you placed yesterday is still open, while a next order (e.g. order ID 123), placed today, has already filled.