from .clock import can_open_new, is_weekend, window_key
from .exits import check_exits
from .group import next_group_id
from .signal import Signal, decide

__all__ = [
    "Signal",
    "StrategyEngine",
    "can_open_new",
    "check_exits",
    "decide",
    "get_engine",
    "is_weekend",
    "next_group_id",
    "set_engine",
    "window_key",
]


def __getattr__(name: str):
    if name in ("StrategyEngine", "get_engine", "set_engine"):
        from .engine import StrategyEngine, get_engine, set_engine

        return {
            "StrategyEngine": StrategyEngine,
            "get_engine": get_engine,
            "set_engine": set_engine,
        }[name]
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
