tensortrade.oms.orders.order_spec module

class tensortrade.oms.orders.order_spec.OrderSpec(side: TradeSide, trade_type: TradeType, exchange_pair: ExchangePair, criteria: Callable[[Order, Exchange], bool] = None)[source]

Bases: tensortrade.core.base.Identifiable

A class for order creation following an order being complete.

Parameters:
  • side (TradeSide) – The trading side of the specification.
  • trade_type (TradeType) – The type of trade for the specification.
  • exchange_pair (ExchangePair) – The exchange pair for the specification.
  • criteria (Callable[[Order, Exchange], bool]) – The criteria for executing the order after its been created.
create_order(order: tensortrade.oms.orders.order.Order) → tensortrade.oms.orders.order.Order[source]

Creates an order following from another order.

Parameters:order (Order) – The previous order in the order path.
Returns:Order – The order created from the specification parameters and the parameters of order.
to_dict() → dict[source]

Creates dictionary representation of specification.

Returns:dict – The dictionary representation of specification.