Back to Ccxt

Bitmex

wiki/exchanges/bitmex.md

4.5.5242.7 KB
Original Source

<a name="bitmex" id="bitmex"></a>

bitmex{docsify-ignore}

Kind: global class
Extends: <code>Exchange</code>

<a name="fetchCurrencies" id="fetchcurrencies"></a>

fetchCurrencies{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchCurrencies ([params])

<a name="fetchMarkets" id="fetchmarkets"></a>

fetchMarkets{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchMarkets ([params])

<a name="fetchBalance" id="fetchbalance"></a>

fetchBalance{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchBalance ([params])

<a name="fetchOrderBook" id="fetchorderbook"></a>

fetchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchOrderBook (symbol[, limit, params])

<a name="fetchOrder" id="fetchorder"></a>

fetchOrder{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>Yesthe order id
symbol<code>string</code>Yesunified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchOrder (id, symbol[, params])

<a name="fetchOrders" id="fetchorders"></a>

fetchOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Nothe earliest time in ms to fetch orders for
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
bitmex.fetchOrders (symbol[, since, limit, params])

<a name="fetchOpenOrders" id="fetchopenorders"></a>

fetchOpenOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>Nothe maximum number of open orders structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchOpenOrders (symbol[, since, limit, params])

<a name="fetchClosedOrders" id="fetchclosedorders"></a>

fetchClosedOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchClosedOrders (symbol[, since, limit, params])

<a name="fetchMyTrades" id="fetchmytrades"></a>

fetchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
bitmex.fetchMyTrades (symbol[, since, limit, params])

<a name="fetchLedger" id="fetchledger"></a>

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 <code>bitmex</code>
Returns: <code>object</code> - a ledger structure

See: https://www.bitmex.com/api/explorer/#!/User/User_getWalletHistory

ParamTypeRequiredDescription
code<code>string</code>Nounified currency code, default is undefined
since<code>int</code>Notimestamp in ms of the earliest ledger entry, default is undefined
limit<code>int</code>Nomax number of ledger entries to return, default is undefined
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchLedger ([code, since, limit, params])

<a name="fetchDepositsWithdrawals" id="fetchdepositswithdrawals"></a>

fetchDepositsWithdrawals{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Nounified currency code for the currency of the deposit/withdrawals, default is undefined
since<code>int</code>Notimestamp in ms of the earliest deposit/withdrawal, default is undefined
limit<code>int</code>Nomax number of deposit/withdrawals to return, default is undefined
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchDepositsWithdrawals ([code, since, limit, params])

<a name="fetchTicker" id="fetchticker"></a>

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 <code>bitmex</code>
Returns: <code>object</code> - a ticker structure

See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_get

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchTicker (symbol[, params])

<a name="fetchTickers" id="fetchtickers"></a>

fetchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchTickers (symbols[, params])

<a name="fetchOHLCV" id="fetchohlcv"></a>

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 <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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
bitmex.fetchOHLCV (symbol, timeframe[, since, limit, params])

<a name="fetchTrades" id="fetchtrades"></a>

fetchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
bitmex.fetchTrades (symbol[, since, limit, params])

<a name="createOrder" id="createorder"></a>

createOrder{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified 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>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.triggerPrice<code>object</code>Nothe price at which a trigger order is triggered at
params.triggerDirection<code>object</code>Nothe direction whenever the trigger happens with relation to price - 'ascending' or 'descending'
params.trailingAmount<code>float</code>Nothe quote amount to trail away from the current market price
javascript
bitmex.createOrder (symbol, type, side, amount[, price, params])

<a name="cancelOrder" id="cancelorder"></a>

cancelOrder{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesnot used by bitmex cancelOrder ()
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.cancelOrder (id, symbol[, params])

<a name="cancelOrders" id="cancelorders"></a>

cancelOrders{docsify-ignore}

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

ParamTypeRequiredDescription
ids<code>Array<string></code>Yesorder ids
symbol<code>string</code>Yesnot used by bitmex cancelOrders ()
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.cancelOrders (ids, symbol[, params])

<a name="cancelAllOrders" id="cancelallorders"></a>

cancelAllOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.cancelAllOrders (symbol[, params])

<a name="cancelAllOrdersAfter" id="cancelallordersafter"></a>

cancelAllOrdersAfter{docsify-ignore}

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

ParamTypeRequiredDescription
timeout<code>number</code>Yestime in milliseconds, 0 represents cancel the timer
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.cancelAllOrdersAfter (timeout[, params])

<a name="fetchLeverages" id="fetchleverages"></a>

fetchLeverages{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Noa list of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchLeverages ([symbols, params])

<a name="fetchPositions" id="fetchpositions"></a>

fetchPositions{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchPositions (symbols[, params])

<a name="withdraw" id="withdraw"></a>

withdraw{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
amount<code>float</code>Yesthe amount to withdraw
address<code>string</code>Yesthe address to withdraw to
tag<code>string</code>Yes
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.withdraw (code, amount, address, tag[, params])

<a name="fetchFundingRates" id="fetchfundingrates"></a>

fetchFundingRates{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchFundingRates (symbols[, params])

<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>

fetchFundingRateHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the funding rate history for
since<code>int</code>Notimestamp in ms of the earliest funding rate to fetch
limit<code>int</code>Nothe maximum amount of funding rate structures to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms for ending date filter
params.reverse<code>bool</code>Noif true, will sort results newest first
params.start<code>int</code>Nostarting point for results
params.columns<code>string</code>Noarray of column names to fetch in info, if omitted, will return all columns
params.filter<code>string</code>Nogeneric 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
javascript
bitmex.fetchFundingRateHistory (symbol[, since, limit, params])

<a name="setLeverage" id="setleverage"></a>

setLeverage{docsify-ignore}

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

ParamTypeRequiredDescription
leverage<code>float</code>Yesthe rate of leverage
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.setLeverage (leverage, symbol[, params])

<a name="setMarginMode" id="setmarginmode"></a>

setMarginMode{docsify-ignore}

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

ParamTypeRequiredDescription
marginMode<code>string</code>Yes'cross' or 'isolated'
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.setMarginMode (marginMode, symbol[, params])

<a name="fetchDepositAddress" id="fetchdepositaddress"></a>

fetchDepositAddress{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.network<code>string</code>Nodeposit 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])

<a name="fetchDepositWithdrawFees" id="fetchdepositwithdrawfees"></a>

fetchDepositWithdrawFees{docsify-ignore}

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

ParamTypeRequiredDescription
codes<code>Array<string></code>, <code>undefined</code>Yeslist of unified currency codes
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchDepositWithdrawFees (codes[, params])

<a name="fetchOpenInterests" id="fetchopeninterests"></a>

fetchOpenInterests{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Noa list of unified CCXT market symbols
params<code>object</code>Noexchange specific parameters
javascript
bitmex.fetchOpenInterests ([symbols, params])

<a name="fetchLiquidations" id="fetchliquidations"></a>

fetchLiquidations{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified CCXT market symbol
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the bitmex api endpoint
params.until<code>int</code>Notimestamp in ms of the latest liquidation
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
bitmex.fetchLiquidations (symbol[, since, limit, params])

<a name="fetchPositionsADLRank" id="fetchpositionsadlrank"></a>

fetchPositionsADLRank{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.fetchPositionsADLRank ([symbols, params])

<a name="fetchSettlementHistory" id="fetchsettlementhistory"></a>

fetchSettlementHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the settlement history
since<code>int</code>Notimestamp in ms
limit<code>int</code>Nonumber of records
params<code>object</code>Noexchange specific params
params.until<code>int</code>Notimestamp in ms EXCHANGE SPECIFIC PARAMETERS
params.filter<code>string</code>Nogeneric 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>Noarray 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>Nopossible values are >= 0 starting point for results, default value = 0
params.reverse<code>boolean</code>Noif true, will sort results newest first, default value = false
javascript
bitmex.fetchSettlementHistory (symbol[, since, limit, params])

<a name="closePosition" id="closeposition"></a>

closePosition{docsify-ignore}

closes open positions for a market

Kind: instance method of <code>bitmex</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified CCXT market symbol
side<code>string</code>Yesthe 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>Noextra parameters specific to the bingx api endpoint
javascript
bitmex.closePosition (symbol, side[, params])

<a name="watchTicker" id="watchticker"></a>

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 <code>bitmex</code>
Returns: <code>object</code> - a ticker structure

See: https://www.bitmex.com/app/wsAPI#Subscriptions

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchTicker (symbol[, params])

<a name="watchTickers" id="watchtickers"></a>

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 <code>bitmex</code>
Returns: <code>object</code> - a ticker structure

See: https://www.bitmex.com/app/wsAPI#Subscriptions

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchTickers (symbols[, params])

<a name="watchLiquidations" id="watchliquidations"></a>

watchLiquidations{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified CCXT market symbol
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the bitmex api endpoint
javascript
bitmex.watchLiquidations (symbol[, since, limit, params])

<a name="watchLiquidationsForSymbols" id="watchliquidationsforsymbols"></a>

watchLiquidationsForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yes
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the bitmex api endpoint
javascript
bitmex.watchLiquidationsForSymbols (symbols[, since, limit, params])

<a name="watchBalance" id="watchbalance"></a>

watchBalance{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchBalance ([params])

<a name="watchTrades" id="watchtrades"></a>

watchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchTrades (symbol[, since, limit, params])

<a name="watchPositions" id="watchpositions"></a>

watchPositions{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
since<code>int</code>Nothe earliest time in ms to watch positions for
limit<code>int</code>Nothe maximum number of positions to retrieve
params<code>object</code>Yesextra parameters specific to the exchange API endpoint
javascript
bitmex.watchPositions (symbols[, since, limit, params])

<a name="watchOrders" id="watchorders"></a>

watchOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchOrders (symbol[, since, limit, params])

<a name="watchMyTrades" id="watchmytrades"></a>

watchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market trades were made in
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trade structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchMyTrades (symbol[, since, limit, params])

<a name="watchOrderBook" id="watchorderbook"></a>

watchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchOrderBook (symbol[, limit, params])

<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>

watchOrderBookForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified array of symbols
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchOrderBookForSymbols (symbols[, limit, params])

<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>

watchTradesForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchTradesForSymbols (symbols[, since, limit, params])

<a name="watchOHLCV" id="watchohlcv"></a>

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 <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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
bitmex.watchOHLCV (symbol, timeframe[, since, limit, params])