Перейти к содержанию

tinvest_signal_engine.config

tinvest_signal_engine.config

Загрузка YAML и настроек окружения.

Содержит типы для списка инструментов, порогов детектора и единый :class:RuntimeSettings, собираемый из переменных среды для всех сервисов.

LoadedDetectorConfig dataclass

Базовые настройки детектора и переопределения по instrument_id.

Source code in src/tinvest_signal_engine/config.py
@dataclass(frozen=True)
class LoadedDetectorConfig:
    """Базовые настройки детектора и переопределения по instrument_id."""

    default: "DetectorSettings"
    per_instrument: dict[str, "DetectorSettings"]
    lead_lag_pairs: tuple[tuple[str, str], ...] = ()

load_detector_settings

load_detector_settings(path: Path) -> DetectorSettings

Backward-compatible: returns global detector defaults only.

Source code in src/tinvest_signal_engine/config.py
def load_detector_settings(path: Path) -> DetectorSettings:
    """Backward-compatible: returns global detector defaults only."""
    return load_detector_config(path).default