Skip to content

Fix backtest#719

Merged
you-n-g merged 10 commits intomicrosoft:mainfrom
zhupr:fix_backtest
Dec 7, 2021
Merged

Fix backtest#719
you-n-g merged 10 commits intomicrosoft:mainfrom
zhupr:fix_backtest

Conversation

@zhupr
Copy link
Collaborator

@zhupr zhupr commented Nov 27, 2021

Description

Motivation and Context

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@zhupr zhupr mentioned this pull request Nov 27, 2021
@zhupr zhupr requested a review from you-n-g November 27, 2021 17:06
@you-n-g
Copy link
Collaborator

you-n-g commented Dec 2, 2021

Please show the result of workflow.py

portfolio_metric_dict, indicator_dict = backtest_daily(
start_time="2017-01-01", end_time="2020-08-01", strategy=strategy_obj, executor=executor_obj
)
analysis_freq = "{0}{1}".format(*Freq.parse(FREQ))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can integrate this analysis_freq into backtest_daily.

**NOTE**: This will be applied to the outmost executor's calendar.
E.g. Executor[day](Executor[1min]), setting `end_time == 20XX0301` will include all the minutes on 20XX0301
strategy : Union[str, dict, BaseStrategy]
for initializing outermost portfolio strategy. Please refer to the docs of init_instance_by_config for more information.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can give a example in the docstring of this parameter

pos_type=pos_type,
)
return report_dict.get("report_df"), report_dict.get("positions")
return portfolio_metric_dict, indicator_dict
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return the daily result directly

@you-n-g you-n-g merged commit c276de4 into microsoft:main Dec 7, 2021
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
* modify FileStorage to support multiple freqs

* modify backtest's sample documentation

* change the logging level of read data exception from error to debug

* fix the backtest exception when volume is 0 or np.nan

* fix test_storage.py

* add backtest_daily

* modify backtest_daily's docstring

* add __repr__/__str__ to Position

* fix the bug of nested_decision_execution example

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
you-n-g added a commit to you-n-g/qlib that referenced this pull request Aug 16, 2025
* feat: Add spec_enabled configuration for data science settings

* make spec alternative

* change spec logic in exp_gen

* remove some general texts

* align

---------

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: yuanteli <1957922024@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants