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