Hello all,
I created an alpha model to trade $O. When I add more securities to the universe, I get different results, even if I'm not trading those added securities yet. Below I'll attach two backtests, one with just $O in the universe, and then one with $O and some other securities. Those extra securities aren't being traded, but the backtest results are still different.
I.e.
self.AddUniverseSelection(ManualUniverseSelectionModel([O])) \\ vs
self.AddUniverseSelection(ManualUniverseSelectionModel([AMT, CCI, EQIX, DLR, O]))
In below examples, the difference in net profit is around ~2%, but in other backtests the difference has exceeded 15%.
Why does this occur? Is this an issue with LEAN or my implementation? Thanks.
AK M
Above was the backtest with only $O. Below is a backtest with other securities.
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.
Cole S
Hi AK,
I haven't had time to dig into it yet, but I did verify different results on backtests. This is interesting. I'll try to take a deeper look in the next day or two.
-Cole
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.
AK M
Thanks Cole, appreciate it.
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.
AK M
Gotcha, that makes sense. I guess the assets in my other strategies were liquid enough where this issue didn't occur. Glad to hear it's an issue with my code instead of with LEAN!
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.
Erik Bengtson
Cool James. I will take look. I might migrate what I'm doing to yours baseline implementation.I was just about to create an implementation for turtle soup strategy, better to start from a good basis
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.
Erik Bengtson
Thanks Jay, I will take a look at that option.
James, here my version of your baseline project. I will try to merge with the changes I've done on the previous project. The code looks cleaner.
GIT GenericTree updates
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.
Erik Bengtson
and of course, the current BB strategy implementation there must be only for trading ranges
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.
Erik Bengtson
James,
I updated some code with fixes and to make it compatible with QC
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.
James Smith
Thanks Erik. I'm going to try to integrate your changes as soon as I can. I can work without a pull request but you can go that route if you prefer. I'm giving genetic programming using this setup a lot of attention so feel free to suggest improvements or report any issues. The number one thing that helps me out is getting a third-party opinion on things. I have made quite a lot of changes to this and the genetic optimizer project and am getting fairly pleasing results.
In terms of an optimization rig, I have an old 4 slot server capable of 24 cores that I obtained for basically peanuts. I don't know how the costs stack up over time against cloud compute. I imagine it would even out after a few weeks of running 24/7 as long as power costs aren't too high.
For live hosting of trading algorithms +1 for digitalocean.
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.
Erik Bengtson
James, I will check how to do a pull request. Not really familiar with that.
Next steps for me are the integration of additional signals in order of creating a few strategies. The additional signals I'm looking at is the Autochartist, integration with rest based NN services.
I will provide further feedback as soon as I progress using this framework, but immeditelly I think the configuration is rather verbose, I will change it into 2 steps, to make it more human friendly.
Thanks for this.
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.
James Smith
I've merged the Bollinger and Channel breakout from your fork. Seems like a great idea to allow a survival period for the approximate coincidence of signals. I'm wondering whether this could use QuantConnect.Indicators.RollingWindow?
You're right that the Optimizer configuration is unwieldy for this level of complexity. I may address that sometime soon. In the meantime I'm using a few scripts and tools to shift json around.
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.
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!