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

Method createOrder

ts/src/xt.ts:2442–2451  ·  view source on GitHub ↗

* @method * @name xt#createOrder * @description create a trade order * @see https://doc.xt.com/#orderorderPost * @see https://doc.xt.com/#futures_ordercreate * @see https://doc.xt.com/#futures_entrustcreatePlan * @see https://doc.xt.com/#futures_entrustcreateProfit

(symbol: string, type: OrderType, side: OrderSide, amount: number, price: Num = undefined, params = {})

Source from the content-addressed store, hash-verified

2440 * @returns {object} an [order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
2441 */
2442 async createOrder (symbol: string, type: OrderType, side: OrderSide, amount: number, price: Num = undefined, params = {}) {
2443 await this.loadMarkets ();
2444 const market = this.market (symbol);
2445 symbol = market['symbol'];
2446 if (market['spot']) {
2447 return await this.createSpotOrder (symbol, type, side, amount, price, params);
2448 } else {
2449 return await this.createContractOrder (symbol, type, side, amount, price, params);
2450 }
2451 }
2452
2453 async createSpotOrder (symbol: string, type, side, amount, price = undefined, params = {}) {
2454 await this.loadMarkets ();

Callers 15

createOrderFunction · 0.45
htx-futures.tsFile · 0.45
example1Function · 0.45
htx-swaps.tsFile · 0.45
testFunction · 0.45
example1Function · 0.45
example2Function · 0.45
exampleFunction · 0.45

Calls 4

createSpotOrderMethod · 0.95
createContractOrderMethod · 0.95
loadMarketsMethod · 0.45
marketMethod · 0.45

Tested by 2

testFunction · 0.36
testFunction · 0.36