Parsing.OptionIdParser¶
Classes
OptionId(strike: float, ...) |
Container class representing the parameters of an option. |
OptionIdParser() |
Class to convert a futures option format into an object of type OptionId. |
OptionType |
Enum to represent the different types of an option. |
-
class
Parsing.OptionIdParser.OptionIdParser[source]¶ Class to convert a futures option format into an object of type
OptionId.Methods
parse(...)Convert a futures option format into an object of type OptionId.-
parse(option_id_str: str) → Backends.OptionId.OptionId[source]¶ Convert a futures option format into an object of type
OptionId.Parameters: option_id_str : str
Futures option description in the format strike + option type
Returns: option_id :
OptionIdThe representation of an option in a
OptionIdformatExamples
>>> from Parsing.OptionIdParser import OptionIdParser >>> option_id_parser = OptionIdParser() >>> option_format = "40p" >>> option_id = option_id_parser.parse(option_format) >>> print(option_id) Option Id: 40.0-OptionType.PUT
-