Skip to content

allow shorting stocks in US stock market#207

Closed
2young-2simple-sometimes-naive wants to merge 3 commits intomicrosoft:mainfrom
2young-2simple-sometimes-naive:patch-2
Closed

allow shorting stocks in US stock market#207
2young-2simple-sometimes-naive wants to merge 3 commits intomicrosoft:mainfrom
2young-2simple-sometimes-naive:patch-2

Conversation

@2young-2simple-sometimes-naive
Copy link
Copy Markdown
Contributor

update position.py to allow short orders (implemented as negative amount in position).

Description

Allow negative amount in position to represent short orders in US stock.

Motivation and Context

Allow short orders will allow more flexible strategies.

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.
    tested with xgboost script.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
    pytest.out.txt

  2. Your own tests:
    workflow-xgboost.log.txt

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

update position.py to allow short orders (implemented as negative amount in position).
@2young-2simple-sometimes-naive 2young-2simple-sometimes-naive changed the title allow shorting stocks in US stock allow shorting stocks in US stock market Jan 22, 2021
update position.py to allow short orders (as in US market).
cosmetic change
@you-n-g
Copy link
Copy Markdown
Contributor

you-n-g commented Jan 22, 2021

@2young-2simple-sometimes-naive
Thanks for your PR.
But shorting is not that simple.
More factors should be considdered (e.g. margin trading)

In this PR, the cache will increase when we short stock.

Thanks

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