Dynamic Quantity for sell orders

I am running into an error where the amount of positions reported from api.list_positions is changing before I have a chance to set a trailing stop order. I am reading the trade updates in from a web socket and reacting to ‘fill’ and ‘partial’ fill events. Even If I pull the position at the time of the trade update by the time I send the sell order the quantity has changed on several stocks per minute. This is due to stop loss and partial fill orders.

I guess I should put in a bracket order of some type with a trailing stop and I’ll research how to do that. It would be helpful if there was a directive that means 100% of positions. I think for day and swing trading, the ‘percent_of_positions’ data type for sell orders will be very useful. Is there an eloquent way to do this already?