bitmex `cancel_orders` doesnt return a list of orders, only a single order
See original GitHub issueReference:
Reproduction:
import os
import ccxt
exchange = ccxt.bitmex(
{
"apiKey": os.environ["BITMEX_API_KEY"],
"secret": os.environ["BITMEX_API_SECRET"],
}
)
exchange.set_sandbox_mode(True) # uncomment to use the testnet sandbox
symbol = "BTC/USD:BTC"
order_type = "limit"
side = "buy"
amount = 100
newOrder1 = exchange.create_order(symbol, order_type, side, amount, 15000)
newOrder2 = exchange.create_order(symbol, order_type, side, amount, 10000)
newOrder3 = exchange.create_order(symbol, order_type, side, amount, 9000)
cancelResponse = exchange.cancel_order(newOrder1["id"])
# cancel second and third order at the same time
ids = [newOrder2["id"], newOrder3["id"]]
cancelboth = exchange.cancel_orders(ids)
assert isinstance(cancelboth, dict)
assert isinstance(cancelboth, list), "cancelboth is not a list"
Output is a dict (should be a list of dicts):
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Order Types FAQ - BitMEX
A Stop Order is an order that does not enter the order book until the market ... Stop Orders can be selected in...
Read more >bitmex api php, cancel 1 order not working - Stack Overflow
the code above works just fine, cancelling all the orders.. however I want to cancel only one order using order ID, so I...
Read more >ccxt/bitmex.py at master - GitHub
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges - ccxt/bitmex.py at master · ccxt/ccxt....
Read more >BitMEX CEO Arthur Hayes on Medium criticism - Yahoo Finance
BitMEX CEO defends the billion-dollar crypto exchange: 'We don't trade ... but it does not trade against clients and exists only to bring ......
Read more >Bitmex api example - SFSHOP
Dec 29, 2018 Learn how to place orders, cancel orders, and get price quotes ... BitMEX (The Bitcoin Mercantile Exchange) is a cryptocurrency...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Works like a charm, once again I am impressed by this project, thanks @kroitor .
The problem seems to be the parsing of the response. Was able to make it work in Python by editing
cancel_order
:to