XChange
XChange copied to clipboard
[Bittrex] user trade history - exchange API issues
I've come across a couple of issues with the Bittrex user trade history query (merge #636 by @zholmes1), related to having to work around limitations with the exchange's API, specifically that trade history has to be derived from order history because there is no separate feed of user trades. I've outlined the 2 issues and potential "fixes" below. Thoughts?
- no trades are received for partially filled but still open orders since they have not migrated from the getopenorders to getorderhistory query. The user trade history method could be changed to run both these queries. However, one consequence of this is that an application could receive user trade objects with the same id with updating quantity, price and fees fields as an order is partially filled over time. Conceivably this could be a problem for applications that are not expecting this behaviour. Although if any other existing exchange implementations similarly amended trade details this would be less of an issue. It might be simpler and less invasive for the open orders query to return a sub-classed LimitOrder object which an interested application could check for the presence of partial fills.
- the trade timestamp is actually the order creation timestamp, In respect to partially filling orders or those that do not execute immediately it would be more accurate (although still not entirely correct) to use the order close timestasmp rather than the order creation time.