knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.86k stars 1.94k forks source link

Detect when an order is still live #2861

Open garciapd opened 5 years ago

garciapd commented 5 years ago

Hi, how do you detect when an order can be cancelled or not?

I have a case with Bitfinex, where the status after been normalized is PARTIALLY_FILLED, but in the response that comes from Bitfinex, the "isLive" attribute is false, meaning that it is a terminal status. So far what I see is that in Bitfinex there is that "isLive" attribute, and in Bittrex for instance there is "isOpen", but this attributes are not propagated into the normalized order.

Do you think it would make sense to add an "isLive" attribute in the Order? or does anybody have an alternative to know if an order can be cancelled or has an ending status?

Thanks.

walec51 commented 4 years ago

I think you could use the PARTIALLY_CANCELED status if isLive = false and the order was partially filled

feel free to submit a pull request