Skip to content

Commit 491f22d

Browse files
authored
Add futuresMultipleOrders function by Wostafa
2 parents 57fbb23 + 74da49b commit 491f22d

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ console.info( await binance.futuresMarketBuy( 'BNBUSDT', 5 ) );
8080
```js
8181
console.info( await binance.futuresMarketSell( 'TRXUSDT', 1 ) );
8282
```
83+
84+
#### Futures Place Multiple Orders
85+
```js
86+
let orders = [
87+
{
88+
symbol:"BTCUSDT",
89+
side: "BUY",
90+
type: "MARKET",
91+
quantity: "0.01",
92+
},
93+
{
94+
symbol:"BNBUSDT",
95+
side: "SELL",
96+
type: "MARKET",
97+
quantity: "0.5",
98+
}
99+
]
100+
console.info( await binance.futuresMultipleOrders(orders) );
101+
```
102+
83103
#### Futures Market Orders: Get the fill price using newOrderRespType
84104
```js
85105
console.info( await binance.futuresMarketBuy( 'BNBUSDT', amount, { newOrderRespType: 'RESULT' } ) );

node-binance-api.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,6 +4111,11 @@ let api = function Binance( options = {} ) {
41114111
futuresMarketSell: async ( symbol, quantity, params = {} ) => {
41124112
return futuresOrder( 'SELL', symbol, quantity, false, params );
41134113
},
4114+
4115+
futuresMultipleOrders: async ( orders = [{}] ) => {
4116+
let params = { batchOrders: JSON.stringify(orders) };
4117+
return promiseRequest( 'v1/batchOrders', params, { base:fapi, type:'TRADE', method:'POST'} );
4118+
},
41144119

41154120
futuresOrder, // side symbol quantity [price] [params]
41164121

0 commit comments

Comments
 (0)