wiki/exchanges/bitmex.md
<a name="bitmex" id="bitmex"></a>
Kind: global class
Extends: <code>Exchange</code>
<a name="fetchCurrencies" id="fetchcurrencies"></a>
fetches all available currencies on an exchange
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an associative dictionary of currencies
See: https://www.bitmex.com/api/explorer/#!/Wallet/Wallet_getAssetsConfig
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchCurrencies ([params])
<a name="fetchMarkets" id="fetchmarkets"></a>
retrieves data on all markets for bitmex
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - an array of objects representing market data
See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActive
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchMarkets ([params])
<a name="fetchBalance" id="fetchbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a balance structure
See: https://www.bitmex.com/api/explorer/#!/User/User_getMargin
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchBalance ([params])
<a name="fetchOrderBook" id="fetchorderbook"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://www.bitmex.com/api/explorer/#!/OrderBook/OrderBook_getL2
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchOrderBook (symbol[, limit, params])
<a name="fetchOrder" id="fetchorder"></a>
fetches information on an order made by the user
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - An order structure
See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchOrder (id, symbol[, params])
<a name="fetchOrders" id="fetchorders"></a>
fetches information on multiple orders made by the user
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the earliest time in ms to fetch orders for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
bitmex.fetchOrders (symbol[, since, limit, params])
<a name="fetchOpenOrders" id="fetchopenorders"></a>
fetch all unfilled currently open orders
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchOpenOrders (symbol[, since, limit, params])
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
fetches information on multiple closed orders made by the user
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<Order></code> - a list of order structures
See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchClosedOrders (symbol[, since, limit, params])
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://www.bitmex.com/api/explorer/#!/Execution/Execution_getTradeHistory
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
bitmex.fetchMyTrades (symbol[, since, limit, params])
<a name="fetchLedger" id="fetchledger"></a>
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a ledger structure
See: https://www.bitmex.com/api/explorer/#!/User/User_getWalletHistory
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | <code>int</code> | No | max number of ledger entries to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchLedger ([code, since, limit, params])
<a name="fetchDepositsWithdrawals" id="fetchdepositswithdrawals"></a>
fetch history of deposits and withdrawals
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a list of transaction structure
See: https://www.bitmex.com/api/explorer/#!/User/User_getWalletHistory
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code for the currency of the deposit/withdrawals, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest deposit/withdrawal, default is undefined |
| limit | <code>int</code> | No | max number of deposit/withdrawals to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchDepositsWithdrawals ([code, since, limit, params])
<a name="fetchTicker" id="fetchticker"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a ticker structure
See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_get
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchTicker (symbol[, params])
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a dictionary of ticker structures
See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActiveAndIndices
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchTickers (symbols[, params])
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://www.bitmex.com/api/explorer/#!/Trade/Trade_getBucketed
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
bitmex.fetchOHLCV (symbol, timeframe[, since, limit, params])
<a name="fetchTrades" id="fetchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://www.bitmex.com/api/explorer/#!/Trade/Trade_get
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
bitmex.fetchTrades (symbol[, since, limit, params])
<a name="createOrder" id="createorder"></a>
create a trade order
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an order structure
See: https://www.bitmex.com/api/explorer/#!/Order/Order_new
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | <code>object</code> | No | the price at which a trigger order is triggered at |
| params.triggerDirection | <code>object</code> | No | the direction whenever the trigger happens with relation to price - 'ascending' or 'descending' |
| params.trailingAmount | <code>float</code> | No | the quote amount to trail away from the current market price |
bitmex.createOrder (symbol, type, side, amount[, price, params])
<a name="cancelOrder" id="cancelorder"></a>
cancels an open order
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - An order structure
See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancel
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | not used by bitmex cancelOrder () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.cancelOrder (id, symbol[, params])
<a name="cancelOrders" id="cancelorders"></a>
cancel multiple orders
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an list of order structures
See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancel
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | Yes | not used by bitmex cancelOrders () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.cancelOrders (ids, symbol[, params])
<a name="cancelAllOrders" id="cancelallorders"></a>
cancel all open orders
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of order structures
See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancelAll
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.cancelAllOrders (symbol[, params])
<a name="cancelAllOrdersAfter" id="cancelallordersafter"></a>
dead man's switch, cancel all orders after the given timeout
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - the api result
See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancelAllAfter
| Param | Type | Required | Description |
|---|---|---|---|
| timeout | <code>number</code> | Yes | time in milliseconds, 0 represents cancel the timer |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.cancelAllOrdersAfter (timeout[, params])
<a name="fetchLeverages" id="fetchleverages"></a>
fetch the set leverage for all contract markets
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a list of leverage structures
See: https://www.bitmex.com/api/explorer/#!/Position/Position_get
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchLeverages ([symbols, params])
<a name="fetchPositions" id="fetchpositions"></a>
fetch all open positions
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of position structure
See: https://www.bitmex.com/api/explorer/#!/Position/Position_get
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchPositions (symbols[, params])
<a name="withdraw" id="withdraw"></a>
make a withdrawal
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a transaction structure
See: https://www.bitmex.com/api/explorer/#!/User/User_requestWithdrawal
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to withdraw |
| address | <code>string</code> | Yes | the address to withdraw to |
| tag | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.withdraw (code, amount, address, tag[, params])
<a name="fetchFundingRates" id="fetchfundingrates"></a>
fetch the funding rate for multiple markets
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of funding rate structures, indexed by market symbols
See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActiveAndIndices
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchFundingRates (symbols[, params])
<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>
Fetches the history of funding rates
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of funding rate structures
See: https://www.bitmex.com/api/explorer/#!/Funding/Funding_get
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the funding rate history for |
| since | <code>int</code> | No | timestamp in ms of the earliest funding rate to fetch |
| limit | <code>int</code> | No | the maximum amount of funding rate structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms for ending date filter |
| params.reverse | <code>bool</code> | No | if true, will sort results newest first |
| params.start | <code>int</code> | No | starting point for results |
| params.columns | <code>string</code> | No | array of column names to fetch in info, if omitted, will return all columns |
| params.filter | <code>string</code> | No | generic table filter, send json key/value pairs, such as {"key": "value"}, you can key on individual fields, and do more advanced querying on timestamps, see the timestamp docs for more details |
bitmex.fetchFundingRateHistory (symbol[, since, limit, params])
<a name="setLeverage" id="setleverage"></a>
set the level of leverage for a market
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - response from the exchange
See: https://www.bitmex.com/api/explorer/#!/Position/Position_updateLeverage
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>float</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.setLeverage (leverage, symbol[, params])
<a name="setMarginMode" id="setmarginmode"></a>
set margin mode to 'cross' or 'isolated'
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - response from the exchange
See: https://www.bitmex.com/api/explorer/#!/Position/Position_isolateMargin
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | <code>string</code> | Yes | 'cross' or 'isolated' |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.setMarginMode (marginMode, symbol[, params])
<a name="fetchDepositAddress" id="fetchdepositaddress"></a>
fetch the deposit address for a currency associated with this account
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an address structure
See: https://www.bitmex.com/api/explorer/#!/User/User_getDepositAddress
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | deposit chain, can view all chains via this.publicGetWalletAssets, default is eth, unless the currency has a default chain within this.options['networks'] |
bitmex.fetchDepositAddress (code[, params])
<a name="fetchDepositWithdrawFees" id="fetchdepositwithdrawfees"></a>
fetch deposit and withdraw fees
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a list of fee structures
See: https://www.bitmex.com/api/explorer/#!/Wallet/Wallet_getAssetsConfig
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified currency codes |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchDepositWithdrawFees (codes[, params])
<a name="fetchOpenInterests" id="fetchopeninterests"></a>
Retrieves the open interest for a list of symbols
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of open interest structures
See: https://docs.bitmex.com/api-explorer/get-stats
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified CCXT market symbols |
| params | <code>object</code> | No | exchange specific parameters |
bitmex.fetchOpenInterests ([symbols, params])
<a name="fetchLiquidations" id="fetchliquidations"></a>
retrieves the public liquidations of a trading pair
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an array of liquidation structures
See: https://www.bitmex.com/api/explorer/#!/Liquidation/Liquidation_get
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest liquidation |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
bitmex.fetchLiquidations (symbol[, since, limit, params])
<a name="fetchPositionsADLRank" id="fetchpositionsadlrank"></a>
fetches the auto deleveraging rank and risk percentage for a list of symbols
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - an auto de leverage structure
See: https://www.bitmex.com/api/explorer/#!/Position/Position_get
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.fetchPositionsADLRank ([symbols, params])
<a name="fetchSettlementHistory" id="fetchsettlementhistory"></a>
fetches historical settlement records
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of settlement history objects
See: https://docs.bitmex.com/api-explorer/get-settlements
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the settlement history |
| since | <code>int</code> | No | timestamp in ms |
| limit | <code>int</code> | No | number of records |
| params | <code>object</code> | No | exchange specific params |
| params.until | <code>int</code> | No | timestamp in ms EXCHANGE SPECIFIC PARAMETERS |
| params.filter | <code>string</code> | No | generic table filter, send json key/value pairs, such as {"key": "value"}, you can key on individual fields, and do more advanced querying on timestamps, see the timestamp docs for more details, default value = {} |
| params.columns | <code>string</code> | No | array of column names to fetch, if omitted, will return all columns, note that this method will always return item keys, even when not specified, so you may receive more columns that you expect |
| params.start | <code>int</code> | No | possible values are >= 0 starting point for results, default value = 0 |
| params.reverse | <code>boolean</code> | No | if true, will sort results newest first, default value = false |
bitmex.fetchSettlementHistory (symbol[, since, limit, params])
<a name="closePosition" id="closeposition"></a>
closes open positions for a market
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| side | <code>string</code> | Yes | the buy or sell side of the closing order, if the position is long set the side to sell, reduceOnly is implied |
| params | <code>object</code> | No | extra parameters specific to the bingx api endpoint |
bitmex.closePosition (symbol, side[, params])
<a name="watchTicker" id="watchticker"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a ticker structure
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchTicker (symbol[, params])
<a name="watchTickers" id="watchtickers"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a ticker structure
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchTickers (symbols[, params])
<a name="watchLiquidations" id="watchliquidations"></a>
watch the public liquidations of a trading pair
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an array of liquidation structures
See: https://www.bitmex.com/app/wsAPI#Liquidation
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
bitmex.watchLiquidations (symbol[, since, limit, params])
<a name="watchLiquidationsForSymbols" id="watchliquidationsforsymbols"></a>
watch the public liquidations of a trading pair
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an array of liquidation structures
See: https://www.bitmex.com/app/wsAPI#Liquidation
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
bitmex.watchLiquidationsForSymbols (symbols[, since, limit, params])
<a name="watchBalance" id="watchbalance"></a>
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - a balance structure
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchBalance ([params])
<a name="watchTrades" id="watchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchTrades (symbol[, since, limit, params])
<a name="watchPositions" id="watchpositions"></a>
watch all open positions
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of position structure
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to watch positions for |
| limit | <code>int</code> | No | the maximum number of positions to retrieve |
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
bitmex.watchPositions (symbols[, since, limit, params])
<a name="watchOrders" id="watchorders"></a>
watches information on multiple orders made by the user
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of order structures
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchOrders (symbol[, since, limit, params])
<a name="watchMyTrades" id="watchmytrades"></a>
watches information on multiple trades made by the user
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market trades were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trade structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchMyTrades (symbol[, since, limit, params])
<a name="watchOrderBook" id="watchorderbook"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://www.bitmex.com/app/wsAPI#OrderBookL2
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchOrderBook (symbol[, limit, params])
<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://www.bitmex.com/app/wsAPI#OrderBookL2
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified array of symbols |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchOrderBookForSymbols (symbols[, limit, params])
<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>
get the list of most recent trades for a list of symbols
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchTradesForSymbols (symbols[, since, limit, params])
<a name="watchOHLCV" id="watchohlcv"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>bitmex</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://www.bitmex.com/app/wsAPI#Subscriptions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
bitmex.watchOHLCV (symbol, timeframe[, since, limit, params])