diff --git a/backend/live_executor.py b/backend/live_executor.py index 42db7f1..f57c5d0 100644 --- a/backend/live_executor.py +++ b/backend/live_executor.py @@ -11,6 +11,11 @@ Live Executor - 实盘交易执行模块 import os import sys +from pathlib import Path +try: + from dotenv import load_dotenv; load_dotenv(Path(__file__).parent / ".env") +except ImportError: + pass import json import time import logging diff --git a/backend/position_sync.py b/backend/position_sync.py index 675a942..aa68dc3 100644 --- a/backend/position_sync.py +++ b/backend/position_sync.py @@ -10,6 +10,11 @@ Position Sync - 仓位同步与对账模块 import os import sys import json +from pathlib import Path +try: + from dotenv import load_dotenv; load_dotenv(Path(__file__).parent / ".env") +except ImportError: + pass import time import logging import asyncio diff --git a/backend/risk_guard.py b/backend/risk_guard.py index 8263f2b..9d21a79 100644 --- a/backend/risk_guard.py +++ b/backend/risk_guard.py @@ -15,6 +15,11 @@ import os import sys import json import time +from pathlib import Path +try: + from dotenv import load_dotenv; load_dotenv(Path(__file__).parent / ".env") +except ImportError: + pass import logging import asyncio import hashlib