Open and closed positions
You can now query the closed positions of a portfolio, in addition to the open ones, and each position now reports its state.
The List Positions endpoint accepts the new positionState parameter, with the values OPEN (default, open positions only), CLOSED (closed positions only) or ALL (open and closed positions). Each position in the response also includes the new state field, with the value OPEN or CLOSED. A position is closed when its quantity has been fully zeroed out.
Learn more in Position.