ExecutedOrderΒΆ

class alchemist_lib.database.executed_order.ExecutedOrder(order_id, ticker, instrument_id, exchange_name, broker_name, order_type, operation, amount, price=None, paid_fee=0, order_datetime=datetime.datetime(2018, 4, 26, 20, 13, 37, 250673))[source]

Map class for table executed_order.

  • order_datetime: DateTime, primary_key.
  • ticker: String(16), primary_key.
  • instrument_id: Integer, primary_key.
  • order_id: String(150), not null.
  • exchange_name: String(150), not null, foreign_key(exchange.exchange_name).
  • broker_name: String(150), not null, foreign_key(broker.broker_name)
  • order_type: String(3), not null.
  • operation: String(4), not null.
  • amount: Float(20, 8), not null.
  • price: Float(20, 8), null.
  • paid_fee: Float(20, 8), null.

Relationships:

  • exchange: List of Exchange instances. (One-to-Many)
  • asset: Asset instance. (One-to-Many)
  • broker: Broker instance. (One-to-Many)
__init__(order_id, ticker, instrument_id, exchange_name, broker_name, order_type, operation, amount, price=None, paid_fee=0, order_datetime=datetime.datetime(2018, 4, 26, 20, 13, 37, 250673))

Costructor method.

Parameters:
  • order_id (str) – Order identified, the form depends of the enchange.
  • order_datetime (datetime.datetime, optional) – When the order is submitted. Default is utcnow().
  • ticker (str) – Ticker code of the asset.
  • instrument_id (int) – Integer that identify tha type of financial instrument.
  • exchange_name (str) – Name of the exchange where the order is executed.
  • broker_name (str) – Name of the broker that execute the order.
  • order_type (str) – String that identify the type of order. Market, Limit, ecc.
  • operation (str) – The type of operation. (buy or sell).
  • amount (decimal.Decimal) – Order amount.
  • price (decimal.Decimal, optional) – Price of order execution. None if order_type is market.
  • paid_fee (decimal.Decimal) – Fee amount, in the base currency or in the quote one.
to_dict()[source]

As the name tell, it returns attributes in a dict form.

Note

The __dict__ method is not overrideble.