investfly.models.strategy.OptionPositionSizing

class OptionPositionSizingMode(builtins.str, enum.Enum):

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'.

FIXED_CONTRACTS = <OptionPositionSizingMode.FIXED_CONTRACTS: 'FIXED_CONTRACTS'>
PCT_OF_PORTFOLIO_RISK = <OptionPositionSizingMode.PCT_OF_PORTFOLIO_RISK: 'PCT_OF_PORTFOLIO_RISK'>
FIXED_NOTIONAL = <OptionPositionSizingMode.FIXED_NOTIONAL: 'FIXED_NOTIONAL'>
@dataclass
class OptionPositionSizing:

Position sizing rule for option groups. The runtime resolves contracts per signal based on the configured mode + portfolio value when the signal fires.

OptionPositionSizing( mode: OptionPositionSizingMode, fixedContracts: int | None = None, pctOfPortfolioRisk: float | None = None, fixedNotional: float | None = None)
fixedContracts: int | None = None
pctOfPortfolioRisk: float | None = None
fixedNotional: float | None = None
@staticmethod
def withFixedContracts( contracts: int) -> OptionPositionSizing:
def validate(self) -> None:
@staticmethod
def fromDict( jsonDict: Dict[str, Any]) -> OptionPositionSizing:
def toDict(self) -> Dict[str, Any]: