Place Order
Function name:
placeOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt",
testnet: "false"
});
async function placeOrderFutures(exchange, options) {
try {
let result = await exchange.placeOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await placeOrderFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
size: "0.01",
side: "open_long",
orderType: "market"
});
Batch Order
Function name:
placeBatchOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function placeBatchOrderFutures(exchange, options) {
try {
let result = await exchange.placeBatchOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await placeBatchOrderFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
orderDataList:[
{
size: "0.003",
side: "open_long",
orderType: "limit",
price: "10000"
},
{
size: "0.004",
side: "open_long",
orderType: "limit",
price: "10000"
}]
});
Cancel Order
Function name:
cancelOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function cancelOrderFutures(exchange, options) {
try {
let result = await exchange.cancelOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await cancelOrderFutures(myBitgetAccount
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
orderId: "1009818807293329409"
});
Batch Cancel Order
Function name:
cancelBatchOrdersFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function cancelBatchOrdersFutures(exchange, options) {
try {
let result = await exchange.cancelBatchOrdersFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await cancelBatchOrdersFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
orderIds:["1011271303899529219", "1011271303903723526"]
});
Cancel All Order
Function name:
cancelAllOrdersFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function cancelAllOrdersFutures(exchange, options) {
try {
let result = await exchange.cancelAllOrdersFutures(optionsoptions);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await cancelAllOrdersFutures(myBitgetAccount,
{
productType: "umcbl",
marginCoin: "USDT"
});
Get Open Order
Function name:
getOpenOrdersFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getOpenOrdersFutures(exchange, options) {
try {
let result = await exchange.getOpenOrdersFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getOpenOrdersFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL"
});
Get All Open Order
Function name:
getAllOpenOrdersFutures()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getAllOpenOrdersFutures(exchange, options) {
try {
let result = await exchange.getAllOpenOrdersFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getAllOpenOrdersFutures(myBitgetAccount,
{
productType: "umcbl",
marginCoin: "USDT"
});
Get History Orders
Function name:
getOrdersHistoryFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getOrdersHistoryFutures(exchange, options) {
try {
let result = await exchange.getOrdersHistoryFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getOrdersHistoryFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
startTime: "1659403328000",
endTime: "1659410528000",
pageSize: "20"
});
Get ProductType History Orders
Function name:
getOrdersHistoryByProductTypeFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getOrdersHistoryByProductTypeFutures(exchange, options) {
try {
let result = await exchange.getOrdersHistoryByProductTypeFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getOrdersHistoryByProductTypeFutures(myBitgetAccount,
{
productType: "umcbl",
startTime: "1659403328000",
endTime: "1659410528000",
pageSize: "20"
});
Get Order Details
Function name:
getOrderDetailsFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getOrderDetailsFutures(exchange, options) {
try {
let result = await exchange.getOrderDetailsFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getOrderDetailsFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
orderId: "12345"
});
Get Order Fill Details
Function name:
getOrderFillDetailFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getOrderFillDetailFutures(exchange, options) {
try {
let result = await exchange.getOrderFillDetailFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getOrderFillDetailFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
startTime: "1659403328000",
orderId: "1010182528922435618"
});
Get ProductType Order Fill Details
Function name:
getProductTypeOrderFillDetailFutures(options)
Usage:
API requires either endTime and startTime or lastEndId as parameters
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getProductTypeOrderFillDetailFutures(exchange, options) {
try {
let result = await exchange.getProductTypeOrderFillDetailFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getProductTypeOrderFillDetailFutures(myBitgetAccount,
{
productType: "umcbl",
startTime: "0",
endTime: "1676832767000"
});
Place Plan Order
Function name:
placePlanOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function placePlanOrderFutures(exchange, options) {
try {
let result = await exchange.placePlanOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await placePlanOrderFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
size: "0.05",
side: "open_long",
orderType: "market",
triggerPrice: "22000",
triggerType: "market_price"
});
Modify Plan Order
Function name:
modifyPlanOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function modifyPlanOrderFutures(exchange, options) {
try {
let result = await exchange.modifyPlanOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await modifyPlanOrderFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
orderId: "12345",
side: "open_long",
orderType: "market",
triggerPrice: "21000",
triggerType: "market_price"
});
Modify Plan Order TPSL
Function name:
modifyPlanOrderTpslFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function modifyPlanOrderTpslFutures(exchange, options) {
try {
let result = await exchange.modifyPlanOrderTpslFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await modifyPlanOrderTpslFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
orderId: "12345"
});
Place Stop Order
Function name:
placeStopOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function placeStopOrderFutures(exchange, options) {
try {
let result = await exchange.placeStopOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await placeStopOrderFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
size: "0.001",
planType: "profit_plan",
triggerPrice:"23555.5",
holdSide:"long"
});
Place Trailing Stop Order
This function is under construction
Function name:
placeTrailingStopOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function placeTrailingStopOrderFutures(exchange, options) {
try {
let result = await exchange.placeTrailingStopOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await placeTrailingStopOrderFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
triggerPrice:"22000",
holdSide: "long",
rangeRate: "1"
});
Place Position TPSL
This Function is currently under construction
Function name:
placePositionTpslFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function placePositionTpslFutures(exchange, options) {
try {
let result = await exchange.placePositionTpslFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await placePositionTpslFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
planType: "pos_profit",
triggerPrice:"24720",
holdSide:"long"
});
Modify Stop Order
Function name:
modifyStopOrderFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function modifyStopOrderFutures(exchange, options) {
try {
let result = await exchange.modifyStopOrderFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await modifyStopOrderFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
orderId: "1010239532700766209",
planType: "pos_profit",
triggerPrice:"24620",
holdSide:"long"
});
Cancel Plan Order TPSL
Function name:
cancelPlanOrderTpslFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function cancelPlanOrderTpslFutures(exchange, options) {
try {
let result = await exchange.cancelPlanOrderTpslFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await cancelPlanOrderTpslFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
orderId: "1010239532700766209",
planType: "pos_profit"
});
Cancel All Trigger Order TPSL
Function name:
cancelAllTriggerOrdersTpslFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function cancelAllTriggerOrdersTpslFutures(exchange, options) {
try {
let result = await exchange.cancelAllTriggerOrdersTpslFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await cancelAllTriggerOrdersTpslFutures(myBitgetAccount,
{
productType: "umcbl",
planType: "pos_profit"
});
Get Plan Order TPSL List
Function name:
getPlanOrderListTpslFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getPlanOrderListTpslFutures(exchange, options) {
try {
let result = await exchange.getPlanOrderListTpslFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getPlanOrderListTpslFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL"
});
Get History Plan Orders TPSL
Function name:
getHistoryPlanOrdersTpslFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt"
});
async function getHistoryPlanOrdersTpslFutures(exchange, options) {
try {
let result = await exchange.getHistoryPlanOrdersTpslFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getHistoryPlanOrdersTpslFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
startTime: "1659403328000",
endTime: "1659410528000",
pageSize: "20"
});