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( legRole: investfly.models.portfolio.OptionLegRole, action: investfly.models.portfolio.OptionLegAction, optionRight: investfly.models.marketdata.OptionType, quantityRatio: int = 1, linkedToLegRole: investfly.models.portfolio.OptionLegRole | None = None, widthFromLinked: float | None = None)
quantityRatio: int = 1
linkedToLegRole: investfly.models.portfolio.OptionLegRole | None = None
widthFromLinked: float | None = None
def validate(self) -> None:
@staticmethod
def fromDict( jsonDict: Dict[str, Any]) -> OptionLegSpec:
def toDict(self) -> Dict[str, Any]: