All URIs are relative to https://api.bybit.com
Method | HTTP request | Description |
---|---|---|
conditionalCancel | POST /v2/private/stop-order/cancel | Cancel conditional order. |
conditionalCancelAll | POST /v2/private/stop-order/cancelAll | Cancel conditional order. |
conditionalGetOrders | GET /v2/private/stop-order/list | Get my conditional order list. |
conditionalNew | POST /v2/private/stop-order/create | Place a new conditional order. |
conditionalQuery | GET /v2/private/stop-order | Query real-time stop order information. |
conditionalReplace | POST /v2/private/stop-order/replace | Replace conditional order. Only incomplete orders can be modified. |
Object conditionalCancel(symbol, opts)
Cancel conditional order.
var BybitApi = require('bybit_api');
var defaultClient = BybitApi.ApiClient.instance;
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
// Configure API key authorization: timestamp
var timestamp = defaultClient.authentications['timestamp'];
timestamp.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.apiKeyPrefix = 'Token';
var apiInstance = new BybitApi.ConditionalApi();
var symbol = "symbol_example"; // String | Contract type.
var opts = {
'stopOrderId': "stopOrderId_example", // String | Order ID of conditional order.
'orderLinkId': "orderLinkId_example" // String | Agency customized order ID.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.conditionalCancel(symbol, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | Contract type. | |
stopOrderId | String | Order ID of conditional order. | [optional] |
orderLinkId | String | Agency customized order ID. | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object conditionalCancelAll(symbol)
Cancel conditional order.
var BybitApi = require('bybit_api');
var defaultClient = BybitApi.ApiClient.instance;
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
// Configure API key authorization: timestamp
var timestamp = defaultClient.authentications['timestamp'];
timestamp.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.apiKeyPrefix = 'Token';
var apiInstance = new BybitApi.ConditionalApi();
var symbol = "symbol_example"; // String | Contract type.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.conditionalCancelAll(symbol, callback);
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | Contract type. |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object conditionalGetOrders(symbol, opts)
Get my conditional order list.
var BybitApi = require('bybit_api');
var defaultClient = BybitApi.ApiClient.instance;
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
// Configure API key authorization: timestamp
var timestamp = defaultClient.authentications['timestamp'];
timestamp.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.apiKeyPrefix = 'Token';
var apiInstance = new BybitApi.ConditionalApi();
var symbol = "symbol_example"; // String | Contract type
var opts = {
'stopOrderStatus': "stopOrderStatus_example", // String | Stop order status.
'limit': 8.14, // Number | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page.
'direction': "direction_example", // String | Search direction. prev: prev page, next: next page. Defaults to next
'cursor': "cursor_example" // String | Page turning mark,Use return cursor,Sign use origin data, in request please urlencode
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.conditionalGetOrders(symbol, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | Contract type | |
stopOrderStatus | String | Stop order status. | [optional] |
limit | Number | Limit for data size per page, max size is 50. Default as showing 20 pieces of data per page. | [optional] |
direction | String | Search direction. prev: prev page, next: next page. Defaults to next | [optional] |
cursor | String | Page turning mark,Use return cursor,Sign use origin data, in request please urlencode | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json
Object conditionalNew(side, symbol, orderType, qty, basePrice, stopPx, timeInForce, opts)
Place a new conditional order.
var BybitApi = require('bybit_api');
var defaultClient = BybitApi.ApiClient.instance;
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
// Configure API key authorization: timestamp
var timestamp = defaultClient.authentications['timestamp'];
timestamp.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.apiKeyPrefix = 'Token';
var apiInstance = new BybitApi.ConditionalApi();
var side = "side_example"; // String | Side.
var symbol = "symbol_example"; // String | Contract type.
var orderType = "orderType_example"; // String | Conditional order type.
var qty = "qty_example"; // String | Order quantity.
var basePrice = "basePrice_example"; // String | Send current market price. It will be used to compare with the value of 'stop_px', to decide whether your conditional order will be triggered by crossing trigger price from upper side or lower side. Mainly used to identify the expected direction of the current conditional order..
var stopPx = "stopPx_example"; // String | Trigger price.
var timeInForce = "timeInForce_example"; // String | Time in force.
var opts = {
'price': "price_example", // String | Execution price for conditional order
'triggerBy': "triggerBy_example", // String | Trigger price type. Default LastPrice.
'closeOnTrigger': true, // Boolean | close on trigger.
'orderLinkId': "orderLinkId_example" // String | Customized order ID, maximum length at 36 characters, and order ID under the same agency has to be unique..
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.conditionalNew(side, symbol, orderType, qty, basePrice, stopPx, timeInForce, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
side | String | Side. | |
symbol | String | Contract type. | |
orderType | String | Conditional order type. | |
qty | String | Order quantity. | |
basePrice | String | Send current market price. It will be used to compare with the value of 'stop_px', to decide whether your conditional order will be triggered by crossing trigger price from upper side or lower side. Mainly used to identify the expected direction of the current conditional order.. | |
stopPx | String | Trigger price. | |
timeInForce | String | Time in force. | |
price | String | Execution price for conditional order | [optional] |
triggerBy | String | Trigger price type. Default LastPrice. | [optional] |
closeOnTrigger | Boolean | close on trigger. | [optional] |
orderLinkId | String | Customized order ID, maximum length at 36 characters, and order ID under the same agency has to be unique.. | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object conditionalQuery(opts)
Query real-time stop order information.
var BybitApi = require('bybit_api');
var defaultClient = BybitApi.ApiClient.instance;
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
// Configure API key authorization: timestamp
var timestamp = defaultClient.authentications['timestamp'];
timestamp.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.apiKeyPrefix = 'Token';
var apiInstance = new BybitApi.ConditionalApi();
var opts = {
'stopOrderId': "stopOrderId_example", // String | Order ID of conditional order.
'orderLinkId': "orderLinkId_example", // String | Agency customized order ID.
'symbol': "symbol_example" // String | Contract type.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.conditionalQuery(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
stopOrderId | String | Order ID of conditional order. | [optional] |
orderLinkId | String | Agency customized order ID. | [optional] |
symbol | String | Contract type. | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json
Object conditionalReplace(symbol, opts)
Replace conditional order. Only incomplete orders can be modified.
var BybitApi = require('bybit_api');
var defaultClient = BybitApi.ApiClient.instance;
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
// Configure API key authorization: timestamp
var timestamp = defaultClient.authentications['timestamp'];
timestamp.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.apiKeyPrefix = 'Token';
var apiInstance = new BybitApi.ConditionalApi();
var symbol = "symbol_example"; // String | Contract type.
var opts = {
'stopOrderId': "stopOrderId_example", // String | Stop order ID.
'orderLinkId': "orderLinkId_example", // String | Order Link ID.
'pRQty': "pRQty_example", // String | Order quantity.
'pRPrice': "pRPrice_example", // String | Order price.
'pRTriggerPrice': "pRTriggerPrice_example" // String | Trigger price.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.conditionalReplace(symbol, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | Contract type. | |
stopOrderId | String | Stop order ID. | [optional] |
orderLinkId | String | Order Link ID. | [optional] |
pRQty | String | Order quantity. | [optional] |
pRPrice | String | Order price. | [optional] |
pRTriggerPrice | String | Trigger price. | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json