LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
Found a pretty big issue in my backtesting. Any stock that is delisted in the present day is not included in the universe for the past. This introduces a lot of error into the universe creation and backtests. Is there a way around this like generating universe using the historically available stocks at that period?
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Non Compete
690 Pro
,
Hi Panda Trader , I think AlgoFramework automatically removes Delisted Insights, see line 456 here:
Using that framework isn't a requirement. You can run backtests just by inheriting from the QCAlgorithm class and using Initialize/OnData and optionally the other event handers (OnSecuritiesChanged, OnOrderEvent, OnEndOfAlgorithm) as described here:https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/getting-started
0
Edited by Non Compete
Newoptionz
2.2k Pro
,
Wow, well I have never really worked with the 'Algo Framework', I've been stuck in the ‘classic framework. I thought the whole idea of the Universe selection was to do away with this ’Surviourship bias', so it is strange that the more advanced ‘Algo Framework’ does this. It does make sense though if the ‘Algo Framework’ can trade those delisted securities in a backtest, before they get delisted. Then all is good.
0
Panda Trader
272 Pro
,
Thanks. I’m in the same boat though. I can’t think of a scenario where including this survivorship bias into the universe is a good thing. What’s the advantage? It’s an inherit flaw in the backtesting model and universe selec as it is now.
1
Louis Szeto
STAFF Pro
,
Hi All
LEAN will include past-delisted securities in universe selection, while removing the securities and liquidating your positions of them when they got delisted, so there is no survivorship bias, nor bug in this issue. To add past-delisted securites to your algorithm, refer to this post.
Best Louis
0
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Panda Trader
272 Pro
,
Hi Louis,
We were able to get it to trade delisted securities by exluding “has fundamental data” from our course screener. Looks like that was the main issue, although now we are hitting the situation where multiple stock splits are not properly handled by LEAN.
Thanks,
Rohit
0
Louis Szeto
STAFF Pro
,
Hi Panda Trader
Thank you for reporting this issue, we are able to reproduce this issue. Please subscribe to this GH issue for its fixing progress.
Best Louis
0
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Loading...
To unlock posting to the community forums please complete at least 30% of Boot Camp. You can
continue your Boot Camp training progress from the terminal. We
hope to see you in the community soon!