ccxt / ccxt

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
https://docs.ccxt.com
MIT License
32.81k stars 7.5k forks source link

Bitvavo: stopPrice is not filled in parse_orders method #8489

Closed marcoismobile closed 3 years ago

marcoismobile commented 3 years ago

Currently the stopPrice in receiving stopLoss (open)orders is not filled for the Bitvavo exchange.

Related code line:

https://github.com/ccxt/ccxt/blob/5b03765e915a9341e6b7667864e24d92d9873a5a/python/ccxt/async_support/bitvavo.py#L1163

This is an example StopLoss market order which I received from Bitvavo:

[{'info': {'orderId': 'a67f58ec-fe62-4b66-904e-ad78ac017604', 'market': 'BTC-EUR', 'created': 1613841944847, 'updated': 1613841944847, 'status': 'awaitingTrigger', 'side': 'sell', 'orderType': 'stopLoss', 'amount': '0.00010583', 'amountRemaining': '0.00010583', 'triggerPrice': '42476', 'triggerAmount': '42476', 'triggerType': 'price', 'triggerReference': 'lastTrade', 'onHold': '0.00010583', 'onHoldCurrency': 'BTC', 'filledAmount': '0', 'filledAmountQuote': '0', 'feePaid': '0', 'feeCurrency': 'EUR', 'fills': [], 'selfTradePrevention': 'decrementAndCancel', 'visible': False, 'disableMarketProtection': False}, 'id': 'a67f58ec-fe62-4b66-904e-ad78ac017604', 'clientOrderId': None, 'timestamp': 1613841944847, 'datetime': '2021-02-20T17:25:44.847Z', 'lastTradeTimestamp': None, 'symbol': 'BTC/EUR', 'type': 'stopLoss', 'timeInForce': None, 'postOnly': None, 'side': 'sell', 'price': None, 'stopPrice': None, 'amount': 0.00010583, 'cost': 0.0, 'average': None, 'filled': 0, 'remaining': 0.00010583, 'status': 'awaitingTrigger', 'fee': {'cost': 0.0, 'currency': 'EUR'}, 'trades': []}]

Like described in their API : https://docs.bitvavo.com/#tag/Orders/paths/~1order/get

It seems the triggerPrice has the correct value to put on the stopPrice value in the Unified order related methods.

Please make the stopPrice variable work in the unified order methods for the Bitvavo exchange.

marcoismobile commented 3 years ago

Also in addition to above we may also want to add the 'status': 'awaitingTrigger' to the parse_order_status method as state 'open'.

https://github.com/ccxt/ccxt/blob/5b03765e915a9341e6b7667864e24d92d9873a5a/python/ccxt/async_support/bitvavo.py#L1042