Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support optimization based strategy #754

Merged
merged 9 commits into from
Dec 28, 2021
Merged

support optimization based strategy #754

merged 9 commits into from
Dec 28, 2021

Conversation

evanzd
Copy link
Contributor

@evanzd evanzd commented Dec 17, 2021

Support optimization based strategy.

Description

This PR is an initial implementation to close the loop of planning-based portfolio optimization in Qlib workflow. Specifically, we implement the qlib.contrib.strategy.signal_strategy.EnhancedIndexingStrategy to support usings building a risk indexing product.

Motivation and Context

This PR is a follow-up of #280. Major changes include:

  • Implement EnhancedIndexingStrategy under Qlib's new strategy interface
  • Improve EnhancedIndexingOptimizer
  • Add example to use this strategy under examples/portfolio

How Has This Been Tested?

This PR has been tested by qrun examples/portfolio/config_enhanced_indexing.yaml (need to follow examples/portfolio/README.md to prepare data first. )

Screenshots of Test Results (if appropriate):

image

Types of changes

  • Add new feature

@evanzd evanzd marked this pull request as ready for review December 19, 2021 02:15
examples/portfolio/README.md Show resolved Hide resolved
examples/portfolio/prepare_riskdata.py Show resolved Hide resolved
examples/portfolio/prepare_riskdata.py Show resolved Hide resolved
date = price_all.index[i]
ref_date = price_all.index[i - T + 1]

print(date)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Discussions about the data preparation

qlib/contrib/strategy/optimizer/enhanced_indexing.py Outdated Show resolved Hide resolved
qlib/contrib/strategy/optimizer/enhanced_indexing.py Outdated Show resolved Hide resolved
evanzd and others added 4 commits December 21, 2021 00:00
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
@you-n-g you-n-g merged commit 1b8f0b4 into microsoft:main Dec 28, 2021
@you-n-g you-n-g added the enhancement New feature or request label Jan 12, 2022
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
* support optimization based strategy

* fix riskdata not found & update doc

* refactor signal_strategy

* add portfolio example

* Update examples/portfolio/prepare_riskdata.py

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>

* fix typo

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>

* fix typo

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>

* update doc

* fix riskmodel doc

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants