static createOrderBody(order) {
    if (!order.getAmount() && !order.getPrice() && !order.getSymbol()) {
      throw 'Invalid amount for update';
    }

    let orderType;
    const ourOrderType = order.getType();
    if (!ourOrderType) {
      orderType = 'Limit';
    } else if (ourOrderType === Order.TYPE_LIMIT) {
      orderType = 'Limit';
    } else if (ourOrderType === Order.TYPE_STOP) {
      orderType = 'Stop';
    } else if (ourOrderType === Order.TYPE_MARKET) {
      orderType = 'Market';
    }

    if (!orderType) {
      throw 'Invalid order type';
    }

    const body = {
      symbol: order.getSymbol(),
      orderQty: order.getAmount(),
      ordType: orderType,
      text: 'Powered by your awesome crypto-bot watchdog'
    };

    const execInst = [];
    if (order.options && order.options.close === true && orderType === 'Limit') {
      execInst.push('ReduceOnly');
    }

    if (order.options && order.options.close === true && orderType === 'Stop') {
      execInst.push('Close');
    }

    // we need a trigger; else order is filled directly on: "market sell [short]"
    if (orderType === 'Stop') {
      execInst.push('LastPrice');
    }

    if (order.isPostOnly()) {
      execInst.push('ParticipateDoNotInitiate');
    }

    if (execInst.length > 0) {
      body.execInst = execInst.join(',');
    }

    if (orderType === 'Stop') {
      body.stopPx = order.getPrice();
    } else if (orderType === 'Limit') {
      body.price = order.getPrice();
    }

    body.side = order.isShort() ? 'Sell' : 'Buy';

    if (order.getId()) {
      body.clOrdID = order.getId();
    }

    return body;
  }
Create a REST API body for Bitmex based on our internal order

@param order
@returns {{symbol: *, orderQty: *, ordType: undefined, text: string}}