Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Q18 Quick start guide not working anymore

    Support
    2
    2
    227
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      angusslq last edited by

      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'
      
      V 1 Reply Last reply Reply Quote 0
      • V
        Vyacheslav_B @angusslq last edited by

        @angusslq Hi. Try cloning the template or restarting JupyterLab. The error was fixed in the new version of the qnt library.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB | Contributors
        • Documentation
        • About
        • Career
        • My account
        • Privacy policy
        • Terms and Conditions
        • Cookies policy
        Home
        Copyright © 2014 - 2021 Quantiacs LLC.
        Powered by NodeBB | Contributors