Spaces:
Running
Running
| from models.factor_strategy_catalog import catalog_rows | |
| from scripts.run_factor_strategy_accuracy_report import build_default_args | |
| def test_factor_strategy_catalog_describes_pattern_combinations(): | |
| rows = {row["factor"]: row for row in catalog_rows(["oldwang_trend", "high_volume_upper_shadow", "bt_bull_engulf"])} | |
| assert rows["oldwang_trend"]["zh_name"] == "三陽開泰 / 三聲無奈" | |
| assert rows["high_volume_upper_shadow"]["zh_name"] == "高檔爆大量長上影" | |
| assert rows["bt_bull_engulf"]["group"] == "pattern" | |
| def test_strict_research_profile_enforces_requested_gates(): | |
| args = build_default_args() | |
| joined = " ".join(args) | |
| assert "--max-zero-factor-weights 3" in joined | |
| assert "--min-accuracy-delta-pp 1.0001" in joined | |
| assert "--min-buy-precision-delta-pp 1.0001" in joined | |
| assert "--min-direction-accuracy-delta-pp 0.0" in joined | |
| assert "--max-sell-precision-drop-pp 0.0" in joined | |
| assert "--search-method beam" in joined | |
| assert "--ranking-strategy protected_metrics_first" in joined | |
| assert "--hold-bias-values 0.0,0.01,0.02" in joined | |
| assert ",0.28,0.29,0.30" in joined | |
| assert "--retain-all-configs" in args | |