Test Order
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function testOrderUM(exchange, options) {
try {
let result = await exchange.testOrderUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await testOrderUM(myBingxExchange, {
symbol: "<string>",
type: "<string>",
side: "<string>"
});
Place order
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function placeOrderUM(exchange, options) {
try {
let result = await exchange.placeOrderUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await placeOrderUM(myBingxExchange, {
symbol: "<string>",
type: "<string>",
side: "<string>"
});
Place order in demo trading
Function Name:
placeOrderDemoTradingUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function placeOrderDemoTradingUM(exchange, options) {
try {
let result = await exchange.placeOrderDemoTradingUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await placeOrderDemoTradingUM(myBingxExchange, {
symbol: "<string>",
type: "<string>",
side: "<string>"
});
Place multiple orders
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function placeBatchOrderUM(exchange, options) {
try {
let result = await exchange.placeBatchOrderUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await placeBatchOrderUM(myBingxExchange, {
batchOrders: "<LIST<Order>>"
});
Close All Positions
Function Name:
closeAllPositionsUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function closeAllPositionsUM(exchange, options) {
try {
let result = await exchange.closeAllPositionsUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await closeAllPositionsUM(myBingxExchange);
Cancel Order
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function cancelOrderUM(exchange, options) {
try {
let result = await exchange.cancelOrderUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelOrderUM(myBingxExchange, {
symbol: "<string>"
});
Cancel multiple orders
Function Name:
batchCancelOrdersUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function batchCancelOrdersUM(exchange, options) {
try {
let result = await exchange.batchCancelOrdersUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await batchCancelOrdersUM(myBingxExchange, {
symbol: "<string>"
});
Cancel All Open Orders
Function Name:
cancelAllOpenOrdersUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function cancelAllOpenOrdersUM(exchange, options) {
try {
let result = await exchange.cancelAllOpenOrdersUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelAllOpenOrdersUM(myBingxExchange);
Current All Open Orders
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getAllOpenOrdersUM(exchange, options) {
try {
let result = await exchange.getAllOpenOrdersUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getAllOpenOrdersUM(myBingxExchange);
Query pending order status
Function Name:
getPendingOrderStatusUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getPendingOrderStatusUM(exchange, options) {
try {
let result = await exchange.getPendingOrderStatusUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getPendingOrderStatusUM(myBingxExchange, {
symbol: "<string>"
});
Query Order details
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getOrderDetailsUM(exchange, options) {
try {
let result = await exchange.getOrderDetailsUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getOrderDetailsUM(myBingxExchange, {
symbol: "<string>"
});
Query Margin Type
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getMarginTypeUM(exchange, options) {
try {
let result = await exchange.getMarginTypeUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getMarginTypeUM(myBingxExchange, {
symbol: "<string>"
});
Change Margin Type
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function changeMarginTypeUM(exchange, options) {
try {
let result = await exchange.changeMarginTypeUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await changeMarginTypeUM(myBingxExchange, {
symbol: "<string>",
marginType: "<string>"
});
Query Leverage
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getLeverageUM(exchange, options) {
try {
let result = await exchange.getLeverageUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getLeverageUM(myBingxExchange, {
symbol: "<string>"
});
Set Leverage
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function setLeverageUM(exchange, options) {
try {
let result = await exchange.setLeverageUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await setLeverageUM(myBingxExchange, {
symbol: "<string>",
side: "<string>",
leverage: "<int64>"
});
Users Force Orders
Function Name:
getUsersForceOrdersUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getUsersForceOrdersUM(exchange, options) {
try {
let result = await exchange.getUsersForceOrdersUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getUsersForceOrdersUM(myBingxExchange);
Query Order history
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getOrderHistoryUM(exchange, options) {
try {
let result = await exchange.getOrderHistoryUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getOrderHistoryUM(myBingxExchange, {
limit: "<int>"
});
Modify Isolated Position Margin
Function Name:
modifyIsolatedPositionMarginUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function modifyIsolatedPositionMarginUM(exchange, options) {
try {
let result = await exchange.modifyIsolatedPositionMarginUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await modifyIsolatedPositionMarginUM(myBingxExchange, {
symbol: "<string>",
amount: "<float64>",
type: "<int>",
positionSide: "<string>"
});
Query historical transaction orders
Function Name:
getHistoricalTransactionOrdersUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "false",
label: "bingx"
});
async function getHistoricalTransactionOrdersUM(exchange, options) {
try {
let result = await exchange.getHistoricalTransactionOrdersUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getHistoricalTransactionOrdersUM(myBingxExchange, {
tradingUnit: "<string>",
startTs: "<int64>",
endTs: "<int64>"
});
Set Position Mode
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function setPositionModeUM(exchange, options) {
try {
let result = await exchange.setPositionModeUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await setPositionModeUM(myBingxExchange);
Query position mode
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getPositionModeUM(exchange, options) {
try {
let result = await exchange.getPositionModeUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getPositionModeUM(myBingxExchange);
Cancel an Existing Order and Send a New Orde
Function Name:
cancelExistingOrderAndPlaceOrderUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function cancelExistingOrderAndPlaceOrderUM(exchange, options) {
try {
let result = await exchange.cancelExistingOrderAndPlaceOrderUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelExistingOrderAndPlaceOrderUM(myBingxExchange, {
cancelReplaceMode: "<string>",
symbol: "<string>",
type: "<string>",
side: "<string>"
});
Cancel orders in batches and place orders in batches
Function Name:
cancelOrdersInBatchesAndPlaceOrdersInBatchesUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function cancelOrdersInBatchesAndPlaceOrdersInBatchesUM(exchange, options) {
try {
let result = await exchange.cancelOrdersInBatchesAndPlaceOrdersInBatchesUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelOrdersInBatchesAndPlaceOrdersInBatchesUM(myBingxExchange, {
batchOrders: "<string>"
});
Cancel All After
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function cancelAllAfterUM(exchange, options) {
try {
let result = await exchange.cancelAllAfterUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelAllAfterUM(myBingxExchange);
Close position by position ID
Function Name:
closePositionByPositionIDUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function closePositionByPositionIDUM(exchange, options) {
try {
let result = await exchange.closePositionByPositionIDUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await closePositionByPositionIDUM(myBingxExchange, {
positionId: "<string>"
});
All Orders
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getAllOrdersUM(exchange, options) {
try {
let result = await exchange.getAllOrdersUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getAllOrdersUM(myBingxExchange, {
limit: "<int>"
});
Position and Maintenance Margin Ratio
Function Name:
getPositionMaintenanceMarginRatioUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getPositionMaintenanceMarginRatioUM(exchange, options) {
try {
let result = await exchange.getPositionMaintenanceMarginRatioUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getPositionMaintenanceMarginRatioUM(myBingxExchange);
Query historical transaction details
Function Name:
getHistoricalTransactionDetailsUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getHistoricalTransactionDetailsUM(exchange, options) {
try {
let result = await exchange.getHistoricalTransactionDetailsUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getHistoricalTransactionDetailsUM(myBingxExchange, {
startTs: "<int64>",
endTs: "<int64>"
});
Query Position History
Function Name:
getPositionHistoryUM()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBingxExchange = createExchange({
exchange: "bingx",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "bingx"
});
async function getPositionHistoryUM(exchange, options) {
try {
let result = await exchange.getPositionHistoryUM(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getPositionHistoryUM(myBingxExchange);