Trading
Documentation on interacting with ByBit's Trading API functions through the PENDAX Javascript SDK.
All parameters of type INTEGER listed in the Bybit API docs need to be passed in as a string.
Place Order
Function name:
placeOrder(options)Usage:
import { createExchange } from "./exchanges/exchange.js";
let myByBitAccount = createExchange({
exchange: "bybit",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
label: "bybit",
testnet: "false"
});
async function placeOrder(exchange, options) {
try {
let result = await exchange.placeOrder(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await placeOrder(myByBitAccount,
{
category: 'linear',
symbol: 'BTCUSD',
side: 'Buy',
orderType: 'Market',
qty: '10'
});Amend Order
Function name:
Usage:
Cancel Order
Function name:
Usage:
Get Open Orders
Function name:
Usage:
Cancel All Orders
Function name:
Usage:
Get Order History
Function name:
Usage:
Batch Place Order
This function is under construction and may behave unexpectedly
Function name:
Usage:
Batch Amend Order
This function is under construction and may behave unexpectedly
Function name:
Usage:
Batch Cancel Order
This function is under construction and may behave unexpectedly
Function name:
Usage:
Get Borrow Quota
Function name:
Usage:
Set Disconnect Cancel All
This function is under construction and may behave unexpectedly
Function name:
Usage:
Last updated