investfly.models.portfolio.TradeOrder
Single-leg and multi-leg trade order contracts.
class
OptionPackagePriceEffect(builtins.str, enum.Enum):
Whether a multi-leg option package produces a debit, credit, or even price.
class
PositionEffect(builtins.str, enum.Enum):
Whether an order opens or closes a position.
@dataclass(frozen=True)
class
OptionOrderIntent:
Position effect and leg role attached to an option order.
@dataclass
class
TradeOrder:
A class that represents a Trade Order.
For futures, if security is a product-level Security rather than a
specific Future contract, the engine automatically resolves it to the
earliest active contract outside the platform expiry buffer.
Action semantics are security-type specific:
- CRYPTO spot supports long-only
BUY/SELLorders;SHORT/COVERare invalid. - FOREX and FUTURE support directional
BUY/SELLorders. A short strategy opens withSELLand closes withBUY; it should not emitSHORTorCOVER. - STOCK/ETF/OPTION support the full
BUY/SELL/SHORT/COVERlifecycle labels.
@dataclass
class
OptionPackageOrder:
One atomic option-combo ticket plus optional option-structure metadata.
@dataclass
class
OrderStatus:
Trade Order Status