refactor: 缠论引擎包化与 Web 分层(ECR-001)
将根目录引擎迁入 chanlun/ 并保留兼容 shim;拆分 TF_DF 与 web 服务; 前端模块化;strategies 改用 chanlun 导入;补充 ESS 文档与 golden 回归。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""Web 运行时配置(环境变量优先,去掉硬编码代理)。"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
DATA_SERVICE_URL = os.environ.get(
|
||||
"DATA_SERVICE_URL",
|
||||
os.environ.get("DATASVC_URL", "https://provider.jackyu66.com"),
|
||||
)
|
||||
ASHARE_DP_URL = os.environ.get("ASHARE_DP_URL", "http://103.179.242.166:8000")
|
||||
|
||||
# HTTP 代理:未设置则不走代理;可设 HTTP_PROXY/HTTPS_PROXY 或 CHAN_HTTP_PROXY
|
||||
_CHAN_PROXY = os.environ.get("CHAN_HTTP_PROXY") or os.environ.get("HTTP_PROXY") or os.environ.get("http_proxy")
|
||||
_HTTPS_PROXY = os.environ.get("HTTPS_PROXY") or os.environ.get("https_proxy") or _CHAN_PROXY
|
||||
|
||||
def ccxt_proxies() -> dict | None:
|
||||
if not _CHAN_PROXY and not _HTTPS_PROXY:
|
||||
return None
|
||||
return {
|
||||
"http": _CHAN_PROXY or _HTTPS_PROXY,
|
||||
"https": _HTTPS_PROXY or _CHAN_PROXY,
|
||||
}
|
||||
|
||||
MACD_FACTOR = int(os.environ.get("MACD_FACTOR", "1"))
|
||||
MACD_SMOOTH = int(os.environ.get("MACD_SMOOTH", "1"))
|
||||
MACD_FAST = 12 * MACD_FACTOR
|
||||
MACD_SLOW = 26 * MACD_FACTOR
|
||||
MACD_SIGNAL = 9 * MACD_SMOOTH
|
||||
|
||||
FLASK_HOST = os.environ.get("FLASK_HOST", "0.0.0.0")
|
||||
FLASK_PORT = int(os.environ.get("FLASK_PORT", "8128"))
|
||||
Reference in New Issue
Block a user