Navigation

    Quantiacs Community

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

    Calculation time exceeded on submission

    Support
    3
    4
    279
    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.
    • T
      TheFlyingDutchman last edited by

      @support : My Q21 submission gives a “Calculation time exceeded” error. This revers to: “Timeout, An error message stating that the strategy calculation exceeds a given time implies that you need to optimize the code and reduce the execution time. Futures systems should be evaluated in 10 minutes and Bitcoin futures/Crypto long systems in 5 minutes of time.”

      Could you please help? Submission number is # 16381634.

      Best Regards.

      support V 2 Replies Last reply Reply Quote 1
      • support
        support @TheFlyingDutchman last edited by

        @theflyingdutchman Hi, sorry for delay. That is correct, execution takes too long. Can you try to speed up computation on your side? Are you maybe trying to train a ML model on a daily basis?

        T 1 Reply Last reply Reply Quote 0
        • T
          TheFlyingDutchman @support last edited by

          @support The Ml algo does not train on a daily basis, I also tried to decrease the traning days, but that lowered the SR. Could you look into the process? Maybe the execution time does take longer for certain ML algo's.

          1 Reply Last reply Reply Quote 0
          • V
            Vyacheslav_B @TheFlyingDutchman last edited by

            @theflyingdutchman Hello,

            Another option is to rewrite your strategy for a single-pass version before submitting it. This approach will significantly speed up the calculations. However, it's important to note that the actual statistical values can only be tracked after submitting the strategy to the competition.

            For example:
            https://github.com/quantiacs/strategy-ml-crypto-long-short/blob/master/strategy.ipynb

            To adapt this strategy for a single-pass version, follow these steps:

            1. Comment out or delete the line where qnbt.backtest_ml is used.
            2. Insert the following code:
            import xarray as xr
            import qnt.ta as qnta
            import qnt.data as qndata
            import qnt.output as qnout
            import qnt.stats as qnstats
            
            retrain_interval = 3*365 + 1
            data = qndata.stocks.load_ndx_data(tail=retrain_interval)
            
            models = train_model(data)
            weights = predict(models, data)
            
            1. In a new cell, insert code to save the weights:
            qnout.write(weights)
            

            To view the strategy's statistics, use the following code in a new cell:

            
            # Calculate stats
            stats = qnstats.calc_stat(data, weights)
            display(stats.to_pandas().tail())
            
            # Graph
            performance = stats.to_pandas()["equity"]
            import qnt.graph as qngraph
            qngraph.make_plot_filled(performance.index, performance, name="PnL (Equity)", type="log")
            

            The qnbt.backtest_ml function is a unique tool for evaluating machine learning strategies, which stands out from what is offered on other platforms. It allows users to set retraining intervals and analyze statistical metrics of the strategy, as opposed to the traditional evaluation of the machine learning model. This provides a deeper understanding of the strategy's effectiveness under various market conditions.

            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