Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Popular
    Log in to post
    • All categories
    • Support
    •      Request New Features
    • Strategy help
    • General Discussion
    • News and Feature Releases
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All Time
    • Day
    • Week
    • Month
    • magenta.grimer

      Importing external data
      General Discussion • • magenta.grimer

      4
      1
      Votes
      4
      Posts
      753
      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.

    • S

      Stocks strategy
      Strategy help • • spancham

      4
      0
      Votes
      4
      Posts
      720
      Views

      support

      @sheikh Hi, when it comes to stocks and historical simulations, the biggest issue is dealing with survivorship bias. The stock universe must include also stocks which have been delisted and we need to define trading rules which allow for trading instruments which make sense at each point in time. This week we are announing a new contest which is preparing the ground for stocks.

    • A

      Unable to see 15/16 of myu strategies
      Support • • anshul96go

      4
      0
      Votes
      4
      Posts
      737
      Views

      support

      @captain-nidoran hi, all your strategies which will take part to the contest should be under the "In Contest" tab in the "Competition" section.

      The migration "Candidates" -> "In Contest" was not immediate as we released minor improvements to the front-end side once the submission phase was over.

    • M

      Printing training performance of neural network models
      Support • • multi_byte.wildebeest

      4
      1
      Votes
      4
      Posts
      2436
      Views

      V

      @multi_byte-wildebeest Hello. I don't use machine learning models in trading.

    • O

      Can I use astronomical data as features for my machine learning model?
      Support • • omohyoid

      4
      0
      Votes
      4
      Posts
      683
      Views

      O

      @support Thx for ur reply

    • M

      Why we need to limit the time to process the strategy ?
      Support • • multi_byte.wildebeest

      4
      0
      Votes
      4
      Posts
      491
      Views

      support

      @multi_byte-wildebeest Hi, these limitations refer to the processing time per point in time, not for the full strategy.

      If it takes 10 minutes per historical day, and the simulation has to take into account 250 days for let us say 10 years, the multi-pass simulation would process 6 days per hour, 144 days per real day, that means 2 weeks of processing time for the full submission, it is a lot of time.

    • A

      Correlation fails although Sharpe ratio > 1
      Support • • agent.hitmonlee

      4
      0
      Votes
      4
      Posts
      367
      Views

      A

      Thanks for the answer!

      I still think something is wrong with this correlation checker. I even used this function to randomize the weights a few times, and I got the same correlation error:

      def add_random_noise(weights, noise_level=0.01): noise = np.random.uniform(-noise_level, noise_level, size=weights.shape) return weights + noise

      I am pretty sure it's impossible to have 90% correlation in this case.

    • magenta.grimer

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

      4
      0
      Votes
      4
      Posts
      660
      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.

    • news-quantiacs

      New futures data and next-to-front contracts
      News and Feature Releases • • news-quantiacs

      4
      1
      Votes
      4
      Posts
      640
      Views

      support

      @magenta-grimer Hello, we updated the documentation.

      Now there are 78 futures contracts. Yes, we allow allocating to only 1 asset. If you trade more assets, then you can go long on some of them and short others.

      Using more assets helps in increasing the Sharpe ratio, as the mean return grows linearly with the number of assets, and the volatility in the denominator with the square root of the number of assets if there are no correlation terms.

      Using uncorrelated assets would then lead to a scaling of the Sharpe ratio with the square root of the number of assets. In practice, however, correlation terms are decreasing this growth.

      Stated more simply, it is a good idea to avoid putting all your eggs in the same basket...

    • S

      Q22 submission, strategies excluded
      Support • • Sun-73

      4
      1
      Votes
      4
      Posts
      908
      Views

      S

      Hi @support, everything is all right now. Thank you!

    • M

      Technical indicators
      Strategy help • • maxime

      3
      0
      Votes
      3
      Posts
      366
      Views

      M

      @support Thank you, yes, this is what I was looking for

    • R

      Limit to submission number
      General Discussion • • rezhak21

      3
      0
      Votes
      3
      Posts
      454
      Views

      R

      @support thanks, yes....

    • J

      Local SSH development
      General Discussion • • Joshua408

      3
      0
      Votes
      3
      Posts
      329
      Views

      support

      @joshua408 We allow development on our cloud or local development on user's machines. No need to open any port.

    • E

      Q19 Contest
      General Discussion • • EDDIEE

      3
      0
      Votes
      3
      Posts
      1221
      Views

      support

      @eddiee Dear Eddiee, yes, the rules and the universe are the same. We will need some more time to extend the universe and the data set, so we decided to run a new contest with the same rules.

      Please note that according to the rules at https://quantiacs.com/contest/19

      A Trading System will be deemed to be a “unique“ Trading System if it was not submitted by the same user to a previous Contest and it was not published by the Sponsor itself and it was not submitted by another user to a previous Contest or to the current Contest. The Sponsor will run on submissions a correlation filter and will have to right to disqualify submissions which are not deemed to be unique.

      So re-submitting the same system will result into a system which is not eligible for a prize.

    • magenta.grimer

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

      3
      0
      Votes
      3
      Posts
      390
      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

      Trend following strategy BUG
      Strategy help • • magenta.grimer

      3
      0
      Votes
      3
      Posts
      483
      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.

    • A

      Bollinger Bands
      Strategy help • • anthony_m

      3
      0
      Votes
      3
      Posts
      1317
      Views

      A

      @antinomy wow, thank you so much, this is awesome!

    • R

      Saving weights and using them for trading
      Strategy help • • rezhak21

      3
      1
      Votes
      3
      Posts
      783
      Views

      R

      @support great, thank you, yes, this is what I was looking for

    • M

      best parameters for indicators
      Strategy help • • maxime

      3
      0
      Votes
      3
      Posts
      330
      Views

      support

      @maxime Yes, of course, you can use our optimizer:

      https://quantiacs.com/community/topic/29/optimizing-and-monitoring-a-trading-system-with-quantiacs

      Be careful with optimization as it will lead to overfitting....

    • A

      Using Volume/OI data
      Strategy help • • anshul96go

      3
      0
      Votes
      3
      Posts
      396
      Views

      support

      @anshul96go Hi Anshul, the IS period starts on January 1st 2014. You can use a strategy with the following logic:

      if Volume/OI is zero, then take this decision:

      Otherwise, take this decision:

      But yous algorithm should produce results also in the period when Volume/OI data were not available.

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