Hey QC forum
I coded up an algorithm, based on the QC framework (The alpha is taken from GitHub, and modified a bit). I am having trouble with my risk module because it takes a REALLY long time to compute and finish the backtest (24 hr for 2 years). The risk module is supposed to liquidate all of the holdings, as soon as SPY falls under the moving average. Without the risk module, the backtest does not take too long.
Any way of optimizing the risk module, or in any way of making it faster? Maybe there are some bugs that I have been missing.
As always, thank you very much!
Lucas
Lucas
And here is the backtest for 2 days, did not have the patience to finish the backtest for 10 years
Varad Kabade
Hi Lucas,
In the risk management model, we recommend using self.ActiveSecurities instead of self.Securities as it contains all the securities added in the Universe thus it keeps on increasing during runtime.
Best,
Varad Kabade
Lucas
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!