docstr: Place an order.
  
  Parameters
  ----------
  asset : TradingPair
      The asset that this order is for.
  
  amount : int
      The amount of assets to order. If ``amount`` is positive, this is
      the number of assets to buy or cover. If ``amount`` is negative,
      this is the number of assets to sell.
  
  limit_price : float, optional
      The limit price for the order.
  
  stop_price : float, optional
      The stop price for the order.
  
  style : ExecutionStyle, optional
      The execution style for the order.
  
  Returns
  -------
  order_id : str or None
      The unique identifier for this order, or None if no order was
      placed.
  
  Notes
  -----
  The ``limit_price`` and ``stop_price`` arguments provide shorthands for
  passing common execution styles. Passing ``limit_price=N`` is
  equivalent to ``style=LimitOrder(N)``. Similarly, passing
  ``stop_price=M`` is equivalent to ``style=StopOrder(M)``, and passing
  ``limit_price=N`` and ``stop_price=M`` is equivalent to
  ``style=StopLimitOrder(N, M)``. It is an error to pass both a ``style``
  and ``limit_price`` or ``stop_price``.
  
  See Also
  --------
  :class:`catalyst.finance.execution.ExecutionStyle`
  :func:`catalyst.api.order_value`
  :func:`catalyst.api.order_percent`
docstr_tok: ["Place","an","order",".","Parameters","--","--","--","--","--","asset",":","TradingPair","The","asset","that","this","order","is","for",".","amount",":","int","The","amount","of","assets","to","order",".","If","``","amount","``","is","positive",",","this","is","the","number","of","assets","to","buy","or","cover",".","If","``","amount","``","is","negative",",","this","is","the","number","of","assets","to","sell",".","limit_price",":","float",",","optional","The","limit","price","for","the","order",".","stop_price",":","float",",","optional","The","stop","price","for","the","order",".","style",":","ExecutionStyle",",","optional","The","execution","style","for","the","order",".","Returns","--","--","--","-","order_id",":","str","or","None","The","unique","identifier","for","this","order",",","or","None","if","no","order","was","placed",".","Notes","--","--","-","The","``","limit_price","``","and","``","stop_price","``","arguments","provide","shorthands","for","passing","common","execution","styles",".","Passing","``","limit_price=N","``","is","equivalent","to","``","style=LimitOrder","(","N",")","``",".","Similarly",",","passing","``","stop_price=M","``","is","equivalent","to","``","style=StopOrder","(","M",")","``",",","and","passing","``","limit_price=N","``","and","``","stop_price=M","``","is","equivalent","to","``","style=StopLimitOrder","(","N",",","M",")","``",".","It","is","an","error","to","pass","both","a","``","style","``","and","``","limit_price","``","or","``","stop_price","``",".","See","Also","--","--","--","--",":","class",":","`","catalyst.finance.execution.ExecutionStyle","`",":","func",":","`","catalyst.api.order_value","`",":","func",":","`","catalyst.api.order_percent","`"]
code: def order(self, asset, amount, style):
      """Place an order.
  
      Parameters
      ----------
      asset : TradingPair
          The asset that this order is for.
  
      amount : int
          The amount of assets to order. If ``amount`` is positive, this is
          the number of assets to buy or cover. If ``amount`` is negative,
          this is the number of assets to sell.
  
      limit_price : float, optional
          The limit price for the order.
  
      stop_price : float, optional
          The stop price for the order.
  
      style : ExecutionStyle, optional
          The execution style for the order.
  
      Returns
      -------
      order_id : str or None
          The unique identifier for this order, or None if no order was
          placed.
  
      Notes
      -----
      The ``limit_price`` and ``stop_price`` arguments provide shorthands for
      passing common execution styles. Passing ``limit_price=N`` is
      equivalent to ``style=LimitOrder(N)``. Similarly, passing
      ``stop_price=M`` is equivalent to ``style=StopOrder(M)``, and passing
      ``limit_price=N`` and ``stop_price=M`` is equivalent to
      ``style=StopLimitOrder(N, M)``. It is an error to pass both a ``style``
      and ``limit_price`` or ``stop_price``.
  
      See Also
      --------
      :class:`catalyst.finance.execution.ExecutionStyle`
      :func:`catalyst.api.order_value`
      :func:`catalyst.api.order_percent`
  
      """
      if amount == 0:
          log.warn("skipping order amount of 0")
          return None
  
      if self.quote_currency is None:
          raise ValueError(
              "no quote_currency defined for this exchange"
          )
  
      if asset.quote_currency != self.quote_currency.lower():
          raise MismatchingQuoteCurrencies(
              quote_currency=asset.quote_currency,
              algo_currency=self.quote_currency,
          )
  
      is_buy = amount > 0
      display_price = style.get_limit_price(is_buy)
  
      log.debug(
          "issuing {side} order of {amount} {symbol} for {type}:"
          " {price}".format(
              side="buy" if is_buy else "sell",
              amount=amount,
              symbol=asset.symbol,
              type=style.__class__.__name__,
              price="{}{}".format(display_price, asset.quote_currency),
          )
      )
  
      return self.create_order(asset, amount, is_buy, style)
  
imports: import abc
  from abc import ABCMeta, abstractmethod, abstractproperty
  from datetime import timedelta
  from time import sleep
  import numpy
  import pandas
  from catalyst.constants import LOG_LEVEL
  from catalyst.data.data_portal import BASE_FIELDS
  from catalyst.exchange.exchange_bundle import ExchangeBundle
  from catalyst.exchange.exchange_errors import MismatchingQuoteCurrencies, SymbolNotFoundOnExchange, PricingDataNotLoadedError, NoDataAvailableOnExchange, NoValueForField, NoCandlesReceivedFromExchange, TickerNotFoundError, NotEnoughCashError
  from catalyst.exchange.utils.datetime_utils import get_delta, get_periods_range, get_periods, get_start_dt, get_frequency, get_candles_number_from_minutes
  from catalyst.exchange.utils.exchange_utils import get_exchange_symbols, resample_history_df, has_bundle, get_candles_df
  from logbook import Logger
label_desc: Use image node_id 21 for calling the Exchange obj's underlying member method code with example usage: obj.order(asset, amount, style) and returns: self, None