Skip to content

Commit a118d10

Browse files
author
cryptomefai
committed
Add timeframe validation helper
1 parent 6191eae commit a118d10

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/mefai_engine/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,9 @@ def load_config(config_path: str | Path | None = None) -> Settings:
259259
yaml_data = yaml.safe_load(f) or {}
260260

261261
return Settings(**yaml_data)
262+
263+
264+
def validate_timeframe(timeframe: str) -> bool:
265+
"""Validate that a timeframe string is supported."""
266+
valid = {"1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1M"}
267+
return timeframe in valid

0 commit comments

Comments
 (0)