alpacahq / Alpaca-API

The Alpaca API is a developer interface for trading operations and market data reception through the Alpaca platform.
https://alpaca.markets/
142 stars 13 forks source link

Partial fill trade updates should contain the most recent partial fill quantity #103

Closed garrett-davidson closed 4 years ago

garrett-davidson commented 4 years ago

I previously asked about this on the forums and got no response. Currently when one receives a partial fill trade update from the streaming API, they learn information about the totality of their order, but not about that specific partial fill.

For day trading this isn't tenable, because I want to have the option to turn the asset around the moment any part of the order fills. I have a detailed example in the above linked forum post. Basically, I'd like to see a field on the fill and partial_fill trade events which contains the quantity that was filled for that update. This way, if I have a buy for 10,000 shares that takes several partial fills to complete, I have the option turn around and open a sell each time there's a partial fill for whatever amount was recently filled, without needing to try to keep track of that manually.

umitanuki commented 4 years ago

Sounds like a good idea, let us take a look at it. Also suggested a workaround in the forum.

Neal commented 4 years ago

@garrett-davidson thanks for the suggestion - the (partial) fill trade update message now includes a qty field which equals to the quantity of shares filled in that update along with price which equals to the price it was filled at.

garrett-davidson commented 4 years ago

Wow, that was so fast! Thanks everyone!