Q18 Quick start guide not working anymore
-
I am currently trying to retry multi data set. i follow the example of Q18 and change for spx / s&p500. However, it doesn't work anymore. May i know how can i return multi data set in Q22 now? Thanks a lot.
https://quantiacs.com/documentation/en/examples/q18_quick_start.html
def load_data(period): futures = qndata.futures.load_data(tail=period, assets=["F_DX"]).isel(asset=0) stocks = qndata.stocks.load_spx_data(tail=period) return {"futures": futures, "stocks": stocks}, futures.time.values qnbt.backtest( competition_type= "stocks_s&p500", load_data= load_data, lookback_period= 365, start_date= "2006-01-01", strategy= strategy, window= window )
Error happened in validate_data function
File ~/book/qnt/backtester.py:386, in backtest.<locals>.validate_data(data) 377 def validate_data(data): 378 mismatches = { 379 'stocks': ['stocks', 'stocks_long'], 380 'stocks_s&p500': ['stocks_s&p500'], (...) 384 'futures': ['futures'] 385 } --> 386 if data.name not in mismatches.get(competition_type, []): 387 log_err( 388 f"WARNING! The data type and the competition type are mismatched. Data type: {data.name}, competition type: {competition_type}") AttributeError: 'tuple' object has no attribute 'name'
-
@angusslq Hi. Try cloning the template or restarting JupyterLab. The error was fixed in the new version of the qnt library.