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

Migrate NeuTrader to Qlib RL #1169

Merged
merged 46 commits into from
Aug 1, 2022
Merged

Migrate NeuTrader to Qlib RL #1169

merged 46 commits into from
Aug 1, 2022

Conversation

lihuoran
Copy link
Contributor

Description

  • Migrate RL simulator in NeuTrader to Qlib.
  • Add test script to run QlibSimulator
  • Related file refinements.

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

qlib/rl/entries/test.py Outdated Show resolved Hide resolved
qlib/backtest/executor.py Outdated Show resolved Hide resolved
qlib/rl/data/pickle_styled.py Show resolved Hide resolved
qlib/rl/data/pickle_styled.py Show resolved Hide resolved
qlib/rl/order_execution/from_neutrader/config.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/simulator_qlib.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/simulator_qlib.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/simulator_qlib.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/simulator_simple.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/tests/test_simulator_qlib.py Outdated Show resolved Hide resolved
@you-n-g
Copy link
Collaborator

you-n-g commented Jul 15, 2022

Please merge the main branch and solve the conflicts.

@you-n-g
Copy link
Collaborator

you-n-g commented Jul 20, 2022

You can merge master to update the latest handler by fyc #1212

@@ -0,0 +1,2 @@
# Copyright (c) Microsoft Corporation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think from_neutrader should be renamed.

I remember I raised a similar comment once, but somehow I couldn't find it any more...

Copy link
Collaborator

@ultmaster ultmaster left a comment

Choose a reason for hiding this comment

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

Is this PR really still a draft?

qlib/rl/order_execution/simulator_qlib.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/simulator_qlib.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/simulator_qlib.py Outdated Show resolved Hide resolved
qlib/rl/order_execution/simulator_qlib.py Outdated Show resolved Hide resolved
@lihuoran lihuoran marked this pull request as ready for review July 29, 2022 03:51
Copy link
Collaborator

@ultmaster ultmaster left a comment

Choose a reason for hiding this comment

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

A few more minor comments. The rest part looks good to me.


Parameters
----------
action (float):
Copy link
Collaborator

Choose a reason for hiding this comment

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


Parameters
----------
order (Order):
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 omit the type in docstring if type annotation is available.

@you-n-g you-n-g merged commit 2752bdc into main Aug 1, 2022
@lihuoran lihuoran deleted the huoran/qlib_rl branch August 3, 2022 07:05
@you-n-g you-n-g added the enhancement New feature or request label Dec 9, 2022
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
* Refine previous version RL codes

* Polish utils/__init__.py

* Draft

* Use | instead of Union

* Simulator & action interpreter

* Test passed

* Migrate to SAOEState & new qlib interpreter

* Black format

* . Revert file_storage change

* Refactor file structure & renaming functions

* Enrich test cases

* Add QlibIntradayBacktestData

* Test interpreter

* Black format

* .

.

.

* Rename receive_execute_result()

* Use indicator to simplify state update

* Format code

* Modify data path

* Adjust file structure

* Minor change

* Add copyright message

* Format code

* Rename util functions

* Add CI

* Pylint issue

* Remove useless code to pass pylint

* Pass mypy

* Mypy issue

* mypy issue

* mypy issue

* Revert "mypy issue"

This reverts commit 8eb1b01.

* mypy issue

* mypy issue

* Fix the numpy version incompatible bug

* Fix a minor typing issue

* Try to skip python 3.7 test for qlib simulator

* Resolve PR comments by Yuge; solve several CI issues.

* Black issue

* Fix a low-level type error

* Change data name

* Resolve PR comments. Leave TODOs in the code base.

Co-authored-by: Young <[email protected]>
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.

3 participants