modular_trader.common.enums#
Classes#
The class of an asset. |
|
Enum class that provides case insensitive value mapping. |
|
The mode of trading. |
Module Contents#
- class modular_trader.common.enums.AssetClass#
Bases:
CaseInsensitiveEnum
The class of an asset.
- Attributes:
STOCK: Stock asset class. CRYPTO: Cryptocurrency asset class. OPTION: Option asset class.
- CRYPTO#
- OPTION#
- STOCK#
- class modular_trader.common.enums.CaseInsensitiveEnum#
Bases:
enum.StrEnum
Enum class that provides case insensitive value mapping.
When an enum value is not found in the class, this class tries to find a matching enum value by converting the given value to upper case.
- Attributes:
- _missing_: The class method that is called when an enum value is not
found in the class. This method is used to implement the case insensitive mapping.
- classmethod _missing_(value: str) typing_extensions.Self | None #
Try to find a matching enum value by converting the given value to upper case.
- Args:
value: The value to look up in the class.
- Returns:
The enum value if found, otherwise None.
- Parameters:
value (str)
- Return type:
typing_extensions.Self | None
- class modular_trader.common.enums.TradingMode#
Bases:
CaseInsensitiveEnum
The mode of trading.
- Attributes:
LIVE: Live trading mode. PAPER: Paper trading mode.
- LIVE#
- PAPER#