investfly.models.strategy.InstrumentSelectionSpec

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

DIRECT = <InstrumentSelectionType.DIRECT: 'DIRECT'>
FUTURE_CONTRACT = <InstrumentSelectionType.FUTURE_CONTRACT: 'FUTURE_CONTRACT'>
OPTION_STRUCTURE = <InstrumentSelectionType.OPTION_STRUCTURE: 'OPTION_STRUCTURE'>
class InstrumentSelectionSpec:
type: ClassVar[InstrumentSelectionType]
def validate( self, securityType: Optional[investfly.models.marketdata.SecurityType] = None) -> None:
def toDict(self) -> Dict[str, Any]:
@staticmethod
def direct() -> DirectInstrumentSelection:
@staticmethod
def futureContract( selector: investfly.models.strategy.FutureContractSelector) -> FutureContractSelection:
@staticmethod
def optionStructure( structure: investfly.models.strategy.OptionStructureSpec) -> OptionStructureSelection:
@staticmethod
def forAsset( securityType: investfly.models.marketdata.SecurityType) -> InstrumentSelectionSpec:
@staticmethod
def fromDict( jsonDict: Optional[Dict[str, Any]]) -> Optional[InstrumentSelectionSpec]:
@dataclass
class DirectInstrumentSelection(InstrumentSelectionSpec):
def validate( self, securityType: Optional[investfly.models.marketdata.SecurityType] = None) -> None:
def toDict(self) -> Dict[str, Any]:
@staticmethod
def fromDict( jsonDict: Optional[Dict[str, Any]]) -> Optional[DirectInstrumentSelection]:
@dataclass
class FutureContractSelection(InstrumentSelectionSpec):
FutureContractSelection( selector: investfly.models.strategy.FutureContractSelector)
type: ClassVar[InstrumentSelectionType] = <InstrumentSelectionType.FUTURE_CONTRACT: 'FUTURE_CONTRACT'>
def validate( self, securityType: Optional[investfly.models.marketdata.SecurityType] = None) -> None:
def toDict(self) -> Dict[str, Any]:
@staticmethod
def fromDict( jsonDict: Optional[Dict[str, Any]]) -> Optional[FutureContractSelection]:
@dataclass
class OptionStructureSelection(InstrumentSelectionSpec):
OptionStructureSelection( structure: investfly.models.strategy.OptionStructureSpec)
type: ClassVar[InstrumentSelectionType] = <InstrumentSelectionType.OPTION_STRUCTURE: 'OPTION_STRUCTURE'>
def validate( self, securityType: Optional[investfly.models.marketdata.SecurityType] = None) -> None:
def toDict(self) -> Dict[str, Any]:
@staticmethod
def fromDict( jsonDict: Optional[Dict[str, Any]]) -> Optional[OptionStructureSelection]: