Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. magenta.grimer
    3. Topics
    • Profile
    • Following 0
    • Followers 2
    • Topics 18
    • Posts 53
    • Best 9
    • Groups 0
    • Blog

    Topics created by magenta.grimer

    • magenta.grimer

      Example strategy for Q23
      Support • • magenta.grimer

      2
      0
      Votes
      2
      Posts
      45
      Views

      support

      @magenta-grimer Hi, the Q22 basic template is a good starting point.

    • magenta.grimer

      Some clarifications
      General Discussion • • magenta.grimer

      5
      0
      Votes
      5
      Posts
      369
      Views

      support

      @magenta-grimer Hi, we cannot provide the list of strategies we are still trading and the payouts. However, all the statistics are public, the new ones (since Q15) and the old ones at:
      https://legacy.quantiacs.com/Systems.aspx

    • magenta.grimer

      In Sample Leaderboard for Q16
      Request New Features • • magenta.grimer

      3
      1
      Votes
      3
      Posts
      393
      Views

      support

      @magenta-grimer Yes, we are going to add it soon, important!

    • magenta.grimer

      More color on contest rules
      General Discussion • • magenta.grimer

      16
      0
      Votes
      16
      Posts
      1073
      Views

      support

      @magenta-grimer Hello, the 34 M USD have been allocated to the winning strategies according to the contest rules.

      Other strategies have been funded, and agreements are in place between quantiacs, investors and quants. We cannot disclose more details now, sorry.

      5M USD is a reasonable capacity a strategy could handle, yes.

    • magenta.grimer

      Q16 strategies submitted and still in checking phase
      Support • • magenta.grimer

      3
      0
      Votes
      3
      Posts
      276
      Views

      magenta.grimer

      @support yes, they have

    • magenta.grimer

      Help in using optimizer for the custom args trend following strategy
      Support • • magenta.grimer

      3
      0
      Votes
      3
      Posts
      173
      Views

      magenta.grimer

      @magenta-grimer thank you @support 🙇 🙇 🙇 🙇 🙇 🙇
      My compliments four your exceptional python skills

    • magenta.grimer

      Optimize the Trend Following strategy with custom args
      Strategy help • • magenta.grimer

      6
      0
      Votes
      6
      Posts
      434
      Views

      support

      Hello.

      I checked this problem. The script which cut "###DEBUG###" cells was incorrect. I fixed this and resent your strategies (filtered by time out) to checking.

      Regards.

    • magenta.grimer

      Help me in using Voting Classifier ML on Futures
      Support • • magenta.grimer

      2
      0
      Votes
      2
      Posts
      171
      Views

      magenta.grimer

      @magenta-grimer sorry now it seems to work as it is....

    • magenta.grimer

      Template strategy broken!
      Support • • magenta.grimer

      3
      0
      Votes
      3
      Posts
      174
      Views

      support

      Thank you for the report. The template has been updated.

    • magenta.grimer

      Help !
      Support • • magenta.grimer

      4
      0
      Votes
      4
      Posts
      208
      Views

      A

      @magenta-grimer There are 2 things you might want to change:

      1: the lookback_period is 365 but you want a 400-day SMA. This will only produce NaNs, so the boolean array sma20 < sma20_crypto will be False everywhere resulting in -1 weights. 2*365 as lookback does the trick for these settings.

      2: Bitcoin is trading 24/7, futures aren't. Better use crypto.time.values instead of futures.time.values for the output of load_data.

      There might be something else that I didn't catch but the resulting sharpe is at least close to what would be expected (1.109 with 5 and 385)

    • magenta.grimer

      Optimizer for simple MA crypto strategy
      Strategy help • • magenta.grimer

      4
      0
      Votes
      4
      Posts
      273
      Views

      A

      There is a way to use the optimizer with a (stateful) mulit pass algo, but depending on the total number of changed parameters it can take a very long time. However, if it runs on a local computer with many workers this can still be useful.

      We could run the backtester with the multi pass algo to get all the weights for the test period and pass these weights to the optimizer.
      There's just one problem with this: you can't pass changed parameters to the strategy using the backtester.
      In order to solve this I created a nested function where the outer function takes the changed parameters from the optimizer. The inner function is the actual multi pass strategy and doesn't define the params but just uses the ones from the outer function. Still within the outer function we run the backtester with one set of params, get the weights it returns and return them to the optimizer.

      The time it takes to run the optimization would roughly be
      (time for 1 multi pass backtest) x (total number of parameter changes) / (number of workers that are able to run)
      So if one multi pass takes 1 minute, you want to optimize 10 parameter changes and can run 5 workers it would take about 2 minutes.

      Here's an example based on the one above with 2 parameter changes and 2 workers:

      import qnt.data as qndata import qnt.ta as qnta import qnt.optimizer as qnop import qnt.backtester as qnbt import xarray as xr def load_data(period): """Loads the BTC Futures data for the BTC Futures contest""" return qndata.cryptofutures.load_data(tail=period, dims=("time", "field", "asset")) def multi_pass_strategy(data, ma_slow_param=50, ma_fast_param=10): """The outer function gets called by the optimizer with changed params, the inner function gets passed to the backtester.""" def strategy(data, state): # The state isn't used in this example, this is just to show that it can be used while optimizing. if state is None: state = 0 state += 1 close = data.sel(field="close") ma_slow = qnta.lwma(close, ma_slow_param).isel(time=-1) ma_fast = qnta.lwma(close, ma_fast_param).isel(time=-1) weights = xr.zeros_like(close.isel(time=-1)) weights[:] = 1 if ma_fast > ma_slow else -1 return weights, state """The backtester returns all weights for the test period which will then be returned to the optimizer""" weights, state = qnbt.backtest( strategy=strategy, competition_type="cryptofutures", load_data=load_data, lookback_period=700, start_date='2014-01-01', build_plots=False, ) return weights data = qndata.cryptofutures.load_data(min_date='2014-01-01') result = qnop.optimize_strategy( data, multi_pass_strategy, qnop.full_range_args_generator( ma_slow_param=range(50, 60, 5), # min, max, step # ma_fast_param=range(5, 100, 5) # min, max, step ), workers=2 # you can set more workers on your PC ) print("---") print("Best iteration:") print(result['best_iteration']) qnop.build_plot(result)

      There might be more efficient ways to do this, so if anyone has one feel free to post it here.

    • magenta.grimer

      Trend following strategy BUG
      Strategy help • • magenta.grimer

      3
      0
      Votes
      3
      Posts
      208
      Views

      support

      @magenta-grimer

      Hello.

      I confirm this bug.
      It is fixed now.
      If you clone this template again, it will work ok.

      Thank you very much for your report.

    • magenta.grimer

      Importing external data
      General Discussion • • magenta.grimer

      4
      1
      Votes
      4
      Posts
      286
      Views

      support

      @penrose-moore Thank you for the idea. For the Bitcoin Futures contest we are indeed patching the Bitcoin Futures data with the BTC spot price to build a meaningful time series. For the other Futures contracts, for the moment we will keep the futures histories only, but add spot prices + patching with spot prices to increase the length of the time series to our to-do list.

    • magenta.grimer

      Can't apply optimizer to another simple strategy!
      Strategy help • • magenta.grimer

      3
      0
      Votes
      3
      Posts
      181
      Views

      support

      @magenta-grimer

      Hello.

      Remove .isel(time=-1).

      ma_slow = close.rolling(time=parameter1).mean() #.isel(time=-1) ma_fast = close.rolling(time=parameter2).mean()#.isel(time=-1)

      It selects the last day, you need an entire series.

      Regards.

    • magenta.grimer

      Adding new datasets, like sentiment datasets
      Request New Features • • magenta.grimer

      3
      0
      Votes
      3
      Posts
      380
      Views

      magenta.grimer

      @support yes, stocktwits or something like it would be the best! With Tiingo I couldn't develop competitive strategies, but stocktwits or even twitter sentiment are really promising, even for daily resolution strategies !

    • magenta.grimer

      Modify an example strategy to trade on the futures market
      Strategy help • • magenta.grimer

      8
      0
      Votes
      8
      Posts
      450
      Views

      magenta.grimer

      @support Thank you very much!

      I hope to don't disturb you so often in the future @support , but before that I need help to "get going".

    • magenta.grimer

      IP Protection and the ongoing sustainability of the business model
      General Discussion • • magenta.grimer

      8
      3
      Votes
      8
      Posts
      526
      Views

      support

      @magenta-grimer That is correct, but you can for example train a model locally on your machine, and then submit a code which uses the results of the training (for example stored in numerical form) but does not reveal the underlying idea.

    • magenta.grimer

      Help in developing a strategy
      Strategy help • • magenta.grimer

      9
      0
      Votes
      9
      Posts
      673
      Views

      support

      @magenta-grimer Hi, the lookback period in the backtester function is expressed in calendar days, and the indicators are expressed in trading days. So as far as the lookback period is long enough to include all indicator needed periods, all choices are fine.

      If the longest period needed for an indicator is 10 trading days (2 weeks), a lookback period of (for example) 20, 50 or 100 for the backtester function will deliver the same results. The shorter the better for efficiency.

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