MCPcopy Create free account
hub / github.com/ccxt/ccxt / create_orders_ws

Method create_orders_ws

python/ccxt/pro/gate.py:193–215  ·  view source on GitHub ↗

create a list of trade orders https://www.gate.io/docs/developers/futures/ws/en/#order-batch-place :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params

(self, orders: List[OrderRequest], params={})

Source from the content-addressed store, hash-verified

191 return order
192
193 async def create_orders_ws(self, orders: List[OrderRequest], params={}):
194 """
195 create a list of trade orders
196
197 https://www.gate.io/docs/developers/futures/ws/en/#order-batch-place
198
199 :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
200 :param dict [params]: extra parameters specific to the exchange API endpoint
201 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
202 """
203 await self.load_markets()
204 request = self.createOrdersRequest(orders, params)
205 firstOrder = orders[0]
206 market = self.market(firstOrder['symbol'])
207 if market['swap'] is not True:
208 raise NotSupported(self.id + ' createOrdersWs is not supported for swap markets')
209 # todo add swap support
210 messageType = self.get_type_by_market(market)
211 channel = messageType + '.order_batch_place'
212 url = self.get_url_by_market(market)
213 await self.authenticate(url, messageType)
214 rawOrders = await self.request_private(url, request, channel)
215 return self.parse_orders(rawOrders, market)
216
217 async def cancel_all_orders_ws(self, symbol: Str = None, params={}):
218 """

Callers

nothing calls this directly

Calls 9

createOrdersRequestMethod · 0.95
get_type_by_marketMethod · 0.95
get_url_by_marketMethod · 0.95
authenticateMethod · 0.95
request_privateMethod · 0.95
NotSupportedClass · 0.90
parse_ordersMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45

Tested by

no test coverage detected