mirror of
https://github.com/silencesdg/mt5_python_ea_suite.git
synced 2026-08-15 11:48:12 +00:00
重构项目架构,新增 MT5 代理服务
- 重构核心模块:DataProvider 依赖注入、RiskController 门面、信号注册表 - 新增 FastAPI 代理服务 (run/server.py),支持局域网远程调用 MT5 - 新增 RemoteDataProvider + AttrDict,远端无缝替代 LiveDataProvider - 新增序列化模块,MT5 对象转 JSON 兼容格式 - 重构入口点至 run/ 包,支持 python -m run.realtime/server/backtest/optimize - 更新 CLAUDE.md 文档 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
co-authored by
Claude
Happy
parent
e8226edd96
commit
4cb4f4a15e
+4
-1
@@ -12,7 +12,10 @@ class KDJStrategy(BaseStrategy):
|
||||
def _calculate_indicators(self, df):
|
||||
low_min = df['low'].rolling(self.period).min()
|
||||
high_max = df['high'].rolling(self.period).max()
|
||||
rsv = (df['close'] - low_min) / (high_max - low_min) * 100
|
||||
# 避免除零:当最高价==最低价时,RSV 取 50(中性)
|
||||
price_range = high_max - low_min
|
||||
rsv = (df['close'] - low_min) / price_range.replace(0, float('nan')) * 100
|
||||
rsv = rsv.fillna(50)
|
||||
df['k'] = rsv.ewm(com=2).mean()
|
||||
df['d'] = df['k'].ewm(com=2).mean()
|
||||
df['j'] = 3 * df['k'] - 2 * df['d']
|
||||
|
||||
Reference in New Issue
Block a user