Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. TheFlyingDutchman
    3. Topics
    T
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 16
    • Best 6
    • Groups 0
    • Blog

    Topics created by TheFlyingDutchman

    • T

      Calculation time exceeded on submission
      Support • • TheFlyingDutchman

      4
      1
      Votes
      4
      Posts
      279
      Views

      V

      @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:

      Comment out or delete the line where qnbt.backtest_ml is used. 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) 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.

    • T

      Error Q20 output missing when submitting
      Strategy help • • TheFlyingDutchman

      11
      1
      Votes
      11
      Posts
      1074
      Views

      V

      @theflyingdutchman

      it can help you. See topic 3) Not enough bid information.

      https://github.com/quantiacs/strategy-q20-nasdaq100-quick-start/blob/master/strategy.ipynb

      def get_enough_bid_for(data_, weights_): time_traded = weights_.time[abs(weights_).fillna(0).sum('asset') > 0] is_strategy_traded = len(time_traded) if is_strategy_traded: return xr.where(weights_.time < time_traded.min(), data_.sel(field="is_liquid"), weights_) return weights_ weights_new = get_enough_bid_for(data, weights) weights_new = weights_new.sel(time=slice("2006-01-01",None))
    • T

      Q18 testing
      Support • • TheFlyingDutchman

      8
      0
      Votes
      8
      Posts
      503
      Views

      E

      @support Thanks a lot!

    • Documentation
    • About
    • Career
    • My account
    • Privacy policy
    • Terms and Conditions
    • Cookies policy
    Home
    Copyright © 2014 - 2021 Quantiacs LLC.
    Powered by NodeBB | Contributors