I am try to create a average value of InternalBarStrength of 3 days.
However, I use the IndicatorExtension.sma function to do this but the result is not giving me the average value of the IBS indicator.
I use the same approch in classic backtest and it works. But when I change to Alpha framework and it fails.
Am I doing something wrong?
Mia Alissi
Kevin's code contains several issues in the transition from a classic backtest to an alpha framework. Here is a summary of the errors and their fixes:
ManualUniverseSelectionModel:
ManualUniverseSelectionModelmatches argument typelist[Symbol].my_symbol_listis of typeList[Symbol], which can be used directly withManualUniverseSelectionModelas it expects a list ofSymbolobjects.InsightCollection Initialization:
InsightCollectionwith abstract attribute__iter__.InsightCollectioncannot be instantiated directly if it contains abstract methods. Consider using a different class or refactor this to work correctly.Variable Annotation:
insightslist.insightswithinsights: List[Insight] = [].Insight Price Method:
Insight.Pricematches the argument types.Insight.Pricemethod call has the correct parameters. The method signature expects parameters likesymbol,timedelta, anddirection. For example, useInsight.Price(sd.Security, timedelta(days=1), direction)instead of using an integer directly.By addressing these issues, Kevin's code should work better with the Alpha Model framework.
Sources: Short Term Reversal, Insight Weighting Framework Algorithm, Key Concepts - QuantConnect.com, Momentum In Mutual Fund Returns, Intraday Arbitrage Between Index ETFs
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.
Kevin Choi
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!