1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 22:36:55 +08:00

[BUGFIX] allow sell in limit-up case and allow buy in limit-down case in topk strategy (#1407)

* 1) check limit_up/down should consider direction; 2) fix some typo, typehint etc

* fix error

* Update test_all_pipeline.py

Believe it's just some arbitrary number.
The excess return is expected to change when trading logic changes.

* add flag forbid_all_trade_at_limit to keep previous behivour for backward compatibility
This commit is contained in:
YQ Tsui
2023-01-10 09:46:18 +08:00
committed by GitHub
parent 7f08e6c7b3
commit d8764660dc
2 changed files with 36 additions and 16 deletions

View File

@@ -165,7 +165,7 @@ class TestAllFlow(TestAutoData):
analyze_df = backtest_analysis(TestAllFlow.PRED_SCORE, TestAllFlow.RID, self.URI_PATH)
self.assertGreaterEqual(
analyze_df.loc(axis=0)["excess_return_with_cost", "annualized_return"].values[0],
0.10,
0.05,
"backtest failed",
)
self.assertTrue(not analyze_df.isna().any().any(), "backtest failed")