pairs_trading/lib/tools/config.py
Oleg Sheynin b196863a34 progress
2026-01-11 13:33:58 +00:00

18 lines
428 B
Python

import hjson
from typing import Dict
from datetime import datetime
# ---
from cvttpy_tools.config import Config
def load_config(config_path: str) -> Config:
return Config(json_src=f"file://{config_path}")
def expand_filename(filename: str) -> str:
# expand %T
res = filename.replace("%T", datetime.now().strftime("%Y%m%d_%H%M%S"))
# expand %D
return res.replace("%D", datetime.now().strftime("%Y%m%d"))