investfly.models.strategy.OptionLegSpec

@dataclass
class OptionLegSpec:

Specification for a single leg of an option strategy. See Java OptionLegSpec for the canonical contract; both languages share the same JSON shape.

OptionLegSpec( legId: str, action: investfly.models.portfolio.OptionLegAction, optionRight: investfly.models.marketdata.OptionType | None, quantityRatio: int = 1, linkedToLegId: str | None = None, widthFromLinked: float | None = None, securityType: investfly.models.marketdata.SecurityType = OPTION, contractSelector: investfly.models.strategy.OptionContractSelector | None = None, legRole: investfly.models.portfolio.OptionLegRole | None = None)
legId: str
quantityRatio: int = 1
linkedToLegId: str | None = None
widthFromLinked: float | None = None
contractSelector: investfly.models.strategy.OptionContractSelector | None = None
def validate(self) -> None:
@staticmethod
def fromDict( jsonDict: Dict[str, Any]) -> OptionLegSpec:
def toDict(self) -> Dict[str, Any]: