mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 15:44:18 +08:00
feat(strategies): 内置策略从 5 个扩充到 18 个
新增 13 个经典策略,覆盖趋势/通道/震荡/均线四大类: 趋势类: - ema_cross EMA 双线交叉(比 MA 反应更灵敏) - triple_ma 三均线系统(多头/空头排列) - dmi DMI 趋向指标(+DI/-DI 交叉) - trix TRIX 三重平滑(过滤短期波动) 通道/突破类: - donchian 唐安奇通道突破(海龟交易法) - keltner 肯特纳通道(ATR-based) - atr_breakout ATR 通道突破(均线±K×ATR) 震荡/反转类: - cci CCI 超卖反弹 - wr_reversal WR 威廉超卖 - bias_reversal BIAS 乖离反弹 - emv EMV 简易波动(量价结合) - dpo DPO 区间震荡 均线类: - bbi BBI 多空指标(4 均线综合) 全部基于 MyTT 现成指标实现,每个策略声明参数 schema 供 Web 表单动态渲染。 18/18 策略冒烟测试通过(合成数据回测无运行时错误)。
This commit is contained in:
@@ -59,7 +59,7 @@ def test_registry_has_builtin_strategies():
|
||||
assert "boll_breakout" in names
|
||||
assert "rsi_reversal" in names
|
||||
assert "kdj_cross" in names
|
||||
assert len(names) >= 5
|
||||
assert len(names) >= 18
|
||||
|
||||
|
||||
def test_strategy_schema_serialization():
|
||||
@@ -522,7 +522,7 @@ def test_list_strategies_endpoint(client):
|
||||
resp = client.get("/api/v1/backtest/strategies")
|
||||
assert resp.status_code == 200
|
||||
body = resp.json()
|
||||
assert body["count"] >= 5
|
||||
assert body["count"] >= 18
|
||||
names = [s["name"] for s in body["strategies"]]
|
||||
assert "ma_cross" in names
|
||||
# 每个策略的 schema 结构完整
|
||||
|
||||
Reference in New Issue
Block a user