investfly.models.strategy.OptionContractSelector

class StrikeSelectionMode(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'.

TARGET_DELTA = <StrikeSelectionMode.TARGET_DELTA: 'TARGET_DELTA'>
PERCENT_OFFSET = <StrikeSelectionMode.PERCENT_OFFSET: 'PERCENT_OFFSET'>
PRICE_OFFSET = <StrikeSelectionMode.PRICE_OFFSET: 'PRICE_OFFSET'>
TARGET_DTE_MIN = 1
TARGET_DTE_MAX = 730
TARGET_DELTA_MIN = 0.01
TARGET_DELTA_MAX = 0.99
TARGET_DELTA_STEP = 0.01
STRIKE_OFFSET_PCT_MIN = -50.0
STRIKE_OFFSET_PCT_MAX = 50.0
STRIKE_OFFSET_PCT_STEP = 0.5
STRIKE_OFFSET_MIN = -500.0
STRIKE_OFFSET_MAX = 500.0
STRIKE_OFFSET_STEP = 0.5
@dataclass
class OptionContractSelector:

Bounded contract selector applied after the underlying signal triggers.

The option template already supplies CALL/PUT and the leg structure. This selector keeps the user-facing contract choice to target DTE plus one primary strike rule. targetDelta is a positive delta magnitude; PUT selection applies the negative sign at runtime.

OptionContractSelector( targetDte: int, strikeSelectionMode: StrikeSelectionMode, targetDelta: float | None = None, strikeOffsetPct: float | None = None, strikeOffset: float | None = None)
targetDte: int
strikeSelectionMode: StrikeSelectionMode
targetDelta: float | None = None
strikeOffsetPct: float | None = None
strikeOffset: float | None = None
def validate(self) -> None:
@staticmethod
def fromDict( jsonDict: Dict[str, Any]) -> OptionContractSelector:
def toDict(self) -> Dict[str, Any]: