MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / ocoOrder

Method ocoOrder

src/node-binance-api.ts:939–954  ·  view source on GitHub ↗

* Create an OCO spot order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {OrderSide} side - BUY or SELL * @param {string} symbol - The symbol to buy or sell * @param {string} quantity - The quantity

(side: OrderSide, symbol: string, quantity: number, params: Dict = {})

Source from the content-addressed store, hash-verified

937 * @return {undefined}
938 */
939 async ocoOrder(side: OrderSide, symbol: string, quantity: number, params: Dict = {}): Promise<OCOOrder> {
940 const request = {
941 symbol: symbol,
942 side: side,
943 quantity: quantity,
944 } as Dict;
945
946 if (!params.listClientOrderId) {
947 const id = this.SPOT_PREFIX + this.uuid22();
948 request.listClientOrderId = id;
949 }
950
951 const endpoint = 'v3/orderList/oco';
952 const response = await this.privateSpotRequest(endpoint, this.extend(request, params), 'POST');
953 return response;
954 }
955
956 /**
957 * Creates a buy order

Callers 1

mainFunction · 0.95

Calls 2

uuid22Method · 0.95
privateSpotRequestMethod · 0.95

Tested by

no test coverage detected