modular_trader.common.enums#

Classes#

AssetClass

The class of an asset.

CaseInsensitiveEnum

Enum class that provides case insensitive value mapping.

TradingMode

The mode of trading.

Module Contents#

class modular_trader.common.enums.AssetClass#

Bases: CaseInsensitiveEnum

Inheritance diagram of modular_trader.common.enums.AssetClass

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

Inheritance diagram of modular_trader.common.enums.CaseInsensitiveEnum

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

Inheritance diagram of modular_trader.common.enums.TradingMode

The mode of trading.

Attributes:

LIVE: Live trading mode. PAPER: Paper trading mode.

LIVE#
PAPER#