Trying to use AccumulateWithClassSelection for course universe selection instead of SingleDayTopSelection but keep running into the error "This asset symbol (<NULL> W5373A5QVCRP) was not found in your security list. Please add this security or check it exists before using it with 'Securities.ContainsKey("<NULL> W5373A5QVCRP")' in SecurityManager.cs:line 254" and can't figure out why. Would appreciate thoughts on the source of this error.
As an example:
class TradeTop(QCAlgorithm):
def SingleDayTopSelection(self, coarse):
p = [{'symbol': cf.Symbol, 'price': cf.AdjustedPrice} for cf in coarse]
p.sort(key=lambda x: x.get("price"), reverse=True)
day_top = [x['symbol'] for x in p[:TAKE_TOP]]
self.Log(f"top syms: {[x.Value for x in day_top]}")
self.coarse_universe = day_top
return day_top
Derek Melchin
Hi Ro,
We were unable to reproduce the issue with the preceding code. However, this error occurs when we index the Securities property with a Symbol that's not in the collection. For further assistance, attach a backtest so we can reproduce the issue.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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
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!