Skip to content

Commit 0c6c6cc

Browse files
committed
fix(client): add trailingDelta check
1 parent 202e45a commit 0c6c6cc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/node-binance-api.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,9 @@ export default class Binance {
735735
* @param {string} quantity - The quantity to buy or sell
736736
* @param {string} price - The price per unit to transact each unit at
737737
* @param {object} params - additional order settings
738+
* @param {number} [params.quoteOrderQty] - The quote order quantity, used for MARKET orders
739+
* @param {number} [params.stopPrice] - The stop price, used for STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT orders
740+
* @param {number} [params.trailingDelta] - Delta price
738741
* @return {undefined}
739742
*/
740743
async order(type: OrderType, side: OrderSide, symbol: string, quantity: number, price?: number, params: Dict = {}): Promise<Order> {
@@ -778,6 +781,13 @@ export default class Binance {
778781
request.newClientOrderId = this.SPOT_PREFIX + this.uuid22();
779782
}
780783

784+
if (params.trailingDelta) {
785+
request.trailingDelta = params.trailingDelta;
786+
787+
if (request.type === 'LIMIT' || request.type === 'LIMIT_MAKER' || request.type === 'MARKET') {
788+
throw Error('trailingDelta: Must set "type" to one of the following: STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT');
789+
}
790+
781791
/*
782792
* STOP_LOSS
783793
* STOP_LOSS_LIMIT

0 commit comments

Comments
 (0)