mirror of
https://github.com/quachtinh113/main-fx.git
synced 2026-08-16 20:08:04 +00:00
update data main fx
This commit is contained in:
+16
-3
@@ -18,13 +18,26 @@ import sys
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
def _find_repo_root(start: Path) -> Path:
|
||||
"""Walk up from start until a directory containing `src` is found."""
|
||||
current = start.resolve()
|
||||
while True:
|
||||
if (current / "src").is_dir():
|
||||
return current
|
||||
if current.parent == current:
|
||||
break
|
||||
current = current.parent
|
||||
|
||||
raise RuntimeError("Cannot locate repository root (directory containing 'src').")
|
||||
|
||||
|
||||
ROOT = _find_repo_root(Path(__file__).parent)
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from src.data.mt5_fetcher import MT5Config, MT5Fetcher # noqa: E402
|
||||
|
||||
|
||||
DEFAULT_SYMBOLS = ["EURUSD", "USDJPY", "GBPUSD", "USDCHF", "AUDUSD", "NZDUSD"]
|
||||
DEFAULT_TIMEFRAMES = ["M15", "H1", "H4"]
|
||||
|
||||
@@ -147,4 +160,4 @@ def main() -> None:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
Reference in New Issue
Block a user