* @see https://developers.binance.com/docs/derivatives/option/trade/New-Order * @param type type of order to create * @param side side of the order (BUY or SELL) * @param symbol symbol of the market to trade * @param quantity quantity of the order to create * @param price pr
(type: OrderType, side: string, symbol: string, quantity: number, price?: number, params: Dict = {})
| 1306 | * @returns |
| 1307 | */ |
| 1308 | async deliveryOrder(type: OrderType, side: string, symbol: string, quantity: number, price?: number, params: Dict = {}): Promise<FuturesOrder> { |
| 1309 | params.symbol = symbol; |
| 1310 | params.side = side; |
| 1311 | params.quantity = quantity; |
| 1312 | params.type = type; |
| 1313 | // if in the binance futures setting Hedged mode is active, positionSide parameter is mandatory |
| 1314 | if (this.Options.hedgeMode) { |
| 1315 | params.positionSide = side === 'BUY' ? 'LONG' : 'SHORT'; |
| 1316 | } |
| 1317 | // LIMIT STOP MARKET STOP_MARKET TAKE_PROFIT TAKE_PROFIT_MARKET |
| 1318 | // reduceOnly stopPrice |
| 1319 | if (price) { |
| 1320 | params.price = price; |
| 1321 | if (!params.type) params.type = 'LIMIT'; |
| 1322 | } else { |
| 1323 | if (!params.type) params.type = 'MARKET'; |
| 1324 | } |
| 1325 | if (!params.timeInForce && (params.type.includes('LIMIT') || params.type === 'STOP' || params.type === 'TAKE_PROFIT')) { |
| 1326 | params.timeInForce = 'GTX'; // Post only by default. Use GTC for limit orders. |
| 1327 | } |
| 1328 | |
| 1329 | if (!params.newClientOrderId) { |
| 1330 | params.newClientOrderId = this.CONTRACT_PREFIX + this.uuid22(); |
| 1331 | } |
| 1332 | return await this.privateDeliveryRequest('v1/order', params, 'POST'); |
| 1333 | } |
| 1334 | |
| 1335 | // ------ WS RELATED FUNCTIONS ------ // |
| 1336 |
no test coverage detected