2026-08-31 13:00:22 +08:00
|
|
|
"""做 T 策略的运行期依赖。"""
|
|
|
|
|
|
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
|
|
|
|
from config import AccountConfig, GlobalConfig
|
|
|
|
|
from libs.grid_take_profit import GridTrailingTracker
|
|
|
|
|
from sdk import Client
|
|
|
|
|
from strategy.trend.order import OrderBook
|
|
|
|
|
from strategy.trend.watch import DipWatch
|
|
|
|
|
|
|
|
|
|
from .state import TState
|
|
|
|
|
|
|
|
|
|
|
2026-09-05 13:56:04 +08:00
|
|
|
@dataclass(frozen=True, slots=True)
|
2026-08-31 13:00:22 +08:00
|
|
|
class Runtime:
|
|
|
|
|
client: Client
|
|
|
|
|
global_cfg: GlobalConfig
|
|
|
|
|
account_cfg: AccountConfig
|
|
|
|
|
state: TState
|
|
|
|
|
orders: OrderBook
|
|
|
|
|
buy_watch: DipWatch
|
|
|
|
|
sell_tracker: GridTrailingTracker
|