Is an order's change in to a position atomic?


#1

In handle_data I’m assuming that once I create an order then I can be sure that there will either be an open order or (once it has completed) an open position.

Is that a safe assumption or is there a potential race condition where the order has completed but the position isn’t listed in the context’s positions yet?


#2

Hi,
Catalyst updates the position, once an order has been filled. It removes the open order right after it was updated in the position. So the scenario specified isn’t possible.