Cancel an open order.

        Parameters
        ----------
        order_param : str or Order
            The order_id or order object to cancel.
427253
def cancel_order(self, order_param):
        
        order_id = order_param
        if isinstance(order_param, zipline.protocol.Order):
            order_id = order_param.id

        self.blotter.cancel(order_id)
301271
public static void applyOrderBy(MultivaluedMap<String, String> queryParams, Query query) {
        List<String> orders = queryParams.get(SORT_PARAM_NAME);
        if (orders != null && orders.size() > 0) {
            OrderBy orderBy = query.orderBy();
            for (String order : orders) {
                EbeanUtils.appendOrder(orderBy, order);
            }
        }
    }
656296
protected static function deleteOrderByIdAsyncWithHttpInfo($order_id) 
    {
        $returnType = '';  
        $request = self::deleteOrderByIdRequest($order_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
598296
def cancel(self,order_id):
        ''' 
        '''
        url= 'https://coincheck.com/api/exchange/orders/' + order_id
        headers = make_header(url,access_key=self.access_key,secret_key=self.secret_key)
        r = requests.delete(url,headers=headers)
        return json.loads(r.text)
1300455
def cancel_order(self, order_id: str) -> str:
        """"""
        self.log.debug(f'Canceling order id={order_id} on {self.name}')

        if self.dry_run:  # Don't cancel if dry run
            self.log.warning(f'DRY RUN: Order cancelled on {self.name}: id={order_id}')
            return order_id

        try:  # Cancel order
            self._cancel_order(order_id)
        except Exception as e:
            raise self.exception(OrderNotFound, f'Failed to cancel order: id={order_id}', e) from e

        self.log.info(f'Order cancelled on {self.name}: id={order_id}')
        return order_id
575469
def cancel_invoice(self, invoice_id):
        
        return self._create_put_request(
            resource=INVOICES,
            billomat_id=invoice_id,
            command=CANCEL,
        )
229647
def cancel(id)
      have_key?
      address = @url_private
      body = {
        "method"        => "cancel_order",
        "currency_pair" => "btc_jpy",
        "order_id" => id,
      }
      h = post_ssl(address, body)
      {
        "success" => h["success"]==1,
      }
    end
895325
def batchcancel_orders(self, order_ids: list, _async=False):
        
        assert isinstance(order_ids, list)
        params = {'order-ids': order_ids}
        path = f'/v1/order/orders/batchcancel'
        return api_key_post(params, path, _async=_async)
138632
def oneCancelsAll(
            orders: List[Order], ocaGroup: str, ocaType: int) -> List[Order]:
        
        for o in orders:
            o.ocaGroup = ocaGroup
            o.ocaType = ocaType
        return orders
157053
def admin_void
      return if !user_is_allowed('orders', 'edit')
      
      response = Caboose::StdClass.new({
        'refresh' => nil,
        'error' => nil,
        'success' => nil
      })
      
      order = Order.find(params[:id])
      
      if order.financial_status == 'captured'
        response.error = "This order has already been captured, you will need to refund instead"
      else
        if PaymentProcessor.void(order)
          order.update_attributes(
            :financial_status => 'voided',
            :status => 'cancelled'
          )
          
          # Add the variant quantities ordered back
          #order.cancel
          
          response.success = "Order voided successfully"
        else
          response.error = "Error voiding order."
        end
      end
    
      render :json => response
    end
1206055
def order_executed(self, orderDict):
        '''  '''
        for orderId, order in orderDict.items():
            if order.security in self.__trakers.keys():
                self.__trakers[order.security].orderExecuted(orderId)
1147230
def _limit_is_valid_or_none(self, params):
        
        if not "limit" in params or not params["limit"]:
            return True
        if not isinstance(params["limit"], int) or params["limit"] < 1:
            return False
        if not "order_by" in params:
            return False
        return True
588280
public function cancelOrder()
    {
        $this->oxorder__oxstorno = new \OxidEsales\Eshop\Core\Field(1);
        if ($this->save()) {
            // canceling ordered products
            foreach ($this->getOrderArticles() as $oOrderArticle) {
                $oOrderArticle->cancelOrderArticle();
            }
        }
    }
534837
def close_positions_order(self):
        

        order_list = []
        time = '{} 15:00:00'.format(self.date)
        if self.running_environment == RUNNING_ENVIRONMENT.TZERO:
            for code, amount in self.hold_available.iteritems():
                order = False
                if amount < 0:
                    # 先卖出的单子 买平
                    order = self.send_order(
                        code=code,
                        price=0,
                        amount=abs(amount),
                        time=time,
                        towards=ORDER_DIRECTION.BUY,
                        order_model=ORDER_MODEL.CLOSE,
                        amount_model=AMOUNT_MODEL.BY_AMOUNT,
                    )
                elif amount > 0:
                    # 先买入的单子, 卖平
                    order = self.send_order(
                        code=code,
                        price=0,
                        amount=abs(amount),
                        time=time,
                        towards=ORDER_DIRECTION.SELL,
                        order_model=ORDER_MODEL.CLOSE,
                        amount_model=AMOUNT_MODEL.BY_AMOUNT
                    )
                if order:
                    order_list.append(order)
            return order_list
        else:
            raise RuntimeError(
                'QAACCOUNT with {} environments cannot use this methods'.format(
                    self.running_environment
                )
            )
1266185
public function delete($order_id)
    {
        $result = null;
        $this->hook->attach('order.delete.before', $order_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $result = (bool) $this->db->delete('orders', array('order_id' => $order_id));

        if ($result) {
            $this->deleteLinked($order_id);
        }

        $this->hook->attach('order.delete.after', $order_id, $result, $this);
        return (bool) $result;
    }
180886
def my_cancel_child_order(product_code:, child_order_id: nil, child_order_acceptance_id: nil)
      return unless child_order_id || child_order_acceptance_id

      body =
        if child_order_id
          "{
            'product_code': \"#{product_code}\",
            'child_order_id': \"#{child_order_id}\"
          }"
        elsif child_order_acceptance_id
          "{
            'product_code': \"#{product_code}\",
            'child_order_acceptance_id': \"#{child_order_acceptance_id}\"
          }"
        end

      res = conn.post do |req|
        req.url "/v1/me/cancelchildorder"
        req.body = body
      end

      res.body
    end
1259752
def batchcancel_order(self, order_ids: list):
        
        assert isinstance(order_ids, list)
        params = {'order-ids': order_ids}
        path = f'/v1/order/orders/batchcancel'

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(api_key_post(params, path))

            return handle

        return _wrapper