|
4 | 4 |
|
5 | 5 | from cn_equity_strategies.catalog import ( |
6 | 6 | CN_DIVIDEND_QUALITY_SNAPSHOT_PROFILE, |
| 7 | + CN_INDUSTRY_ETF_ROTATION_AGGRESSIVE_PROFILE, |
7 | 8 | CN_INDUSTRY_ETF_ROTATION_PROFILE, |
8 | 9 | ) |
9 | 10 | from runtime_config_support import PlatformRuntimeSettings, load_platform_runtime_settings |
|
13 | 14 | def test_qmt_enabled_profiles_include_primary_runtime_strategies(): |
14 | 15 | profiles = get_enabled_profiles_for_platform(QMT_PLATFORM, policy=PLATFORM_POLICY) |
15 | 16 | assert CN_INDUSTRY_ETF_ROTATION_PROFILE in profiles |
| 17 | + assert CN_INDUSTRY_ETF_ROTATION_AGGRESSIVE_PROFILE in profiles |
16 | 18 | assert CN_DIVIDEND_QUALITY_SNAPSHOT_PROFILE in profiles |
17 | 19 |
|
18 | 20 |
|
@@ -54,3 +56,32 @@ def test_dry_run_cycle_returns_target_weights(monkeypatch: pytest.MonkeyPatch, m |
54 | 56 | assert report["target_weights"] |
55 | 57 | assert report["order_previews"] |
56 | 58 | assert report["dry_run_only"] is True |
| 59 | + |
| 60 | + |
| 61 | +def test_dry_run_cycle_supports_aggressive_industry_profile( |
| 62 | + monkeypatch: pytest.MonkeyPatch, |
| 63 | + market_history_csv: str, |
| 64 | +): |
| 65 | + monkeypatch.setenv("STRATEGY_PROFILE", CN_INDUSTRY_ETF_ROTATION_AGGRESSIVE_PROFILE) |
| 66 | + monkeypatch.setenv("QMT_DRY_RUN_ONLY", "true") |
| 67 | + monkeypatch.setenv("QMT_MARKET_HISTORY_PATH", market_history_csv) |
| 68 | + |
| 69 | + from application.dry_run_service import run_dry_run_cycle |
| 70 | + from application.qmt_client import QmtBrokerClient |
| 71 | + |
| 72 | + settings = PlatformRuntimeSettings( |
| 73 | + strategy_profile=CN_INDUSTRY_ETF_ROTATION_AGGRESSIVE_PROFILE, |
| 74 | + strategy_display_name="CN Industry ETF Rotation Aggressive", |
| 75 | + strategy_domain="cn_equity", |
| 76 | + dry_run_only=True, |
| 77 | + market_history_path=market_history_csv, |
| 78 | + feature_snapshot_path=None, |
| 79 | + feature_snapshot_manifest_path=None, |
| 80 | + ) |
| 81 | + report = run_dry_run_cycle( |
| 82 | + runtime_settings=settings, |
| 83 | + client=QmtBrokerClient(market_history_path=market_history_csv), |
| 84 | + ) |
| 85 | + assert report["status"] == "ok" |
| 86 | + assert report["strategy_profile"] == CN_INDUSTRY_ETF_ROTATION_AGGRESSIVE_PROFILE |
| 87 | + assert report["target_weights"] |
0 commit comments