microsoft / qlib

Qlib is an AI-oriented quantitative investment platform that aims to realize the potential, empower research, and create value using AI technologies in quantitative investment, from exploring ideas to implementing productions. Qlib supports diverse machine learning modeling paradigms. including supervised learning, market dynamics modeling, and RL.
https://qlib.readthedocs.io/en/latest/
MIT License
15.14k stars 2.59k forks source link

Enter a position on open price and exit on close price #432

Closed shashank-yadav closed 3 years ago

shashank-yadav commented 3 years ago

Is it possible to to enter a position on the open price of t+1 and exit on the close price of the same day in the backtesting engine. There is an argument called ‘deal_price’ but that is used nowhere

you-n-g commented 3 years ago

Hi, @shashank-yadav It will a little awkward to implement your feature in the current system.

Please pay attention to https://github.com/microsoft/qlib/pull/408 for refracting the trading framework.
You can implement your feature much easier in this new framework

If you want this feature in the current system, you can implement your own executor https://github.com/microsoft/qlib/blob/main/qlib/contrib/online/executor.py .

arisliang commented 3 years ago

Curious on this feature as well. The PR mentioned is replaced by #438.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open for three months with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days