1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 08:16:54 +08:00

black format

This commit is contained in:
bxdd
2021-01-19 01:06:17 +09:00
committed by you-n-g
parent 65d8af41e7
commit cc214a3462
2 changed files with 14 additions and 6 deletions

View File

@@ -45,7 +45,6 @@ def risk_analysis(r, N=252):
return res
# This is the API for compatibility for legacy code
def backtest(pred, account=1e9, shift=1, benchmark="SH000905", verbose=True, **kwargs):
"""This function will help you set a reasonable Exchange and provide default value for strategy
@@ -120,8 +119,12 @@ def backtest(pred, account=1e9, shift=1, benchmark="SH000905", verbose=True, **k
whether to print log.
"""
warnings.warn("this function is deprecated, please use backtest function in qlib.contrib.backtest", DeprecationWarning)
report_dict = backtest_func(pred=pred, account=account, shift=shift, benchmark=benchmark, verbose=verbose, return_order=False, **kwargs)
warnings.warn(
"this function is deprecated, please use backtest function in qlib.contrib.backtest", DeprecationWarning
)
report_dict = backtest_func(
pred=pred, account=account, shift=shift, benchmark=benchmark, verbose=verbose, return_order=False, **kwargs
)
return report_dict.get("report_df"), report_dict.get("positions")