tensortrade.orders.order module

class tensortrade.orders.order.Order(step, side, trade_type, pair, quantity, portfolio, price, criteria=None, path_id=None, start=None, end=None)[source]

Bases: tensortrade.base.core.TimedIdentifiable

Responsibilities of the Order:
  1. Confirming its own validity.
  2. Tracking its trades and reporting it back to the broker.
  3. Managing movement of quantities from order to order.
  4. Generating the next order in its path given that there is a ‘OrderSpec’ for how to make the next order.
  5. Managing its own state changes when it can.
add_order_spec(order_spec)[source]
Return type:Order
attach(listener)[source]
base_instrument
Return type:Instrument
cancel()[source]
complete(exchange)[source]
Return type:Order
detach(listener)[source]
execute(exchange)[source]
fill(exchange, trade)[source]
is_buy
Return type:bool
is_complete()[source]
is_executable_on(exchange)[source]
is_limit_order
Return type:bool
is_market_order
Return type:bool
is_sell
Return type:bool
price
Return type:float
quote_instrument
Return type:Instrument
release()[source]
size
Return type:float
to_dict()[source]
to_json()[source]
trades
class tensortrade.orders.order.OrderStatus[source]

Bases: enum.Enum

An enumeration.

CANCELLED = 'cancelled'
FILLED = 'filled'
OPEN = 'open'
PARTIALLY_FILLED = 'partially_filled'
PENDING = 'pending'