for crypto in self.filtered_universe:
cg_symbol = crypto.symbol.value.replace("USDT", "")
if cg_symbol not in [s.value for s in self.cg_symbols]:
CoinGecko_symbol = self.add_data(CoinGecko, cg_symbol, Resolution.DAILY).symbol
self.cg_symbols.append(CoinGecko_symbol)
self.cg_ticker_map[cg_symbol] = crypto
self.coingecko_dic[cg_symbol] = RollingWindow[Slice](5)
cg_history = self.history[Slice](CoinGecko_symbol, 5, Resolution.DAILY)
for data in cg_history:
self.coingecko_dic[cg_symbol].add(data)
This gives me incompatibility issues as I think history calls outputs pandas dataframes which aren't directly mapped into my slice objectany help?
Mia Alissi
To address the issues in the code, ensure that the
self
context is correctly defined within a class method, and properly instantiate theSlice
object with the required parameters. Here's how you can modify the code:Make sure to replace
YourAlgorithm
with the actual name of your algorithm class and adjust the parameters for theSlice
constructor as needed based on your specific requirements.Sources: Indices - QuantConnect.com, Crypto Futures - QuantConnect.com, Crypto - QuantConnect.com, CFD - QuantConnect.com, Futures - QuantConnect.com
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.
Tamer
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!