investfly.models.portfolio
Portfolio and trading models
Broker Type Enum
PositionType Enum
Trade Type Enum
Order Type Enum
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
front-month contract.
One atomic option-combo ticket plus optional option-structure metadata.
Trade Order Status
Inherited Members
Group-level view used by strategy code (live + backtest).
Exit decisions (closeBeforeDte, profit/loss-based exits) are evaluated per-group rather than
per-leg. The runtime fills legs from Java's reconciled open-position-group endpoint, not
raw overlay table rows. Legs may include the underlying stock/ETF for buy-write structures
that were opened atomically.
Per-leg view derived from a live open position matched to a persisted group leg.
Java persists only grouping keys. Price, quantity, contract unit, expiry, and option-right fields come from the currently-open broker/paper position and option symbol parsing.
Templated option structures supported by the Phase-1 MVP automated options engine.
Naked short calls/puts and any undefined-risk structure outside this list are rejected by validation. Each template prescribes a fixed leg count and action shape.
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.