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
    • A

      Expected Time to Run Strategy
      Support • • anshul96go

      4
      0
      Votes
      4
      Posts
      1357
      Views

      A

      @support Got it, thanks a lot!

    • S

      Cryptocurrency algos issues
      Support • • Sheikh

      4
      1
      Votes
      4
      Posts
      965
      Views

      S

      @support
      Thanks.
      You guys are the best!🏆

    • A

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

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

    • C

      Different dataset locally and in jupiterLab
      Support • • cross_platform.zebra

      4
      0
      Votes
      4
      Posts
      403
      Views

      support

      @cross_platform-zebra Hi, there is no other limitation regarding local development. It is already configured to be exactly the same datasets for Nasdaq100 stocks, and returns the same statistics for trading system running locally or online.

    • P

      Xarray Value Error
      Strategy help • • pink.seel

      4
      0
      Votes
      4
      Posts
      630
      Views

      support

      @pink-seel Super that you found it, please do not hesitate to ask for support!

    • magenta.grimer

      Help !
      Support • • magenta.grimer

      4
      0
      Votes
      4
      Posts
      465
      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)

    • P

      Holding period, execution simulation, feedback from live Quantiacs trading?
      General Discussion • • Penrose-Moore

      4
      0
      Votes
      4
      Posts
      612
      Views

      P

      @support yes coarse heuristics work well as long as you are conservative. For shorter term models I have started using minute bars despite the computational hit, because it helps in a lot of other ways.

      I may enter this contest, I am pretty rusty on predictive modelling and I am not sure I can do a good job using just daily prices, there is not a lot of data. I used to work at a CTA and I feel like we wasted a lot of man years using only prices, hoping better models would acheive more alpha. in the end the sharpe is similar to the S&P but uncorrelated, but you have gotten there with some simpler models and enjoyed life.

      I have some other questions about the platform and the contest that I will post here.

      Best
      P.M.

    • A

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

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

    • L

      Windows or Linux?
      Strategy help • • laudis

      4
      0
      Votes
      4
      Posts
      546
      Views

      L

      Thanks !

    • M

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

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

    • O

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

      4
      0
      Votes
      4
      Posts
      736
      Views

      O

      @support Thx for ur reply

    • E

      Q17 Machine learning - RidgeRegression (Long/Short); there is an error in the code
      Strategy help • • EDDIEE

      4
      1
      Votes
      4
      Posts
      971
      Views

      E

      @support

      This is a possible fix, but no gurantee. You have to adjust also the prediction function.

      def train_model(data):
      """Create and train the models working on an asset-by-asset basis."""

      models = dict()

      asset_name_all = data.coords['asset'].values

      data = data.sel(time=slice('2013-05-01',None)) # cut the noisy data head before 2013-05-01

      features_all = get_features(data)
      target_all = get_target_classes(data)

      model = create_model()

      for asset_name in asset_name_all:

      # drop missing values: target_cur = target_all.sel(asset=asset_name).dropna('time', 'any') features_cur = features_all.sel(asset=asset_name).dropna('time', 'any') # align features and targets: target_for_learn_df, feature_for_learn_df = xr.align(target_cur, features_cur, join='inner') if len(features_cur.time) < 10: # not enough points for training continue try: model.fit(feature_for_learn_df.values, target_for_learn_df) models[asset_name] = model except KeyboardInterrupt as e: raise e except: logging.exception('model training failed')

      return models

    • D

      Kelly criterion
      Support • • dark.pidgeot

      4
      0
      Votes
      4
      Posts
      504
      Views

      support

      @dark-pidgeot Yes, of course. Please note that we do not implement leverage, and the sum of the absolute values of the weights has to be equal or smaller than 1. If it is larger, they will be rescaled down.

    • M

      training, predicting and backtesting Neural Network
      Support • • magenta.kabuto

      4
      0
      Votes
      4
      Posts
      423
      Views

      support

      @magenta-kabuto The weights generated are simply the daily allocations to the various assets.

    • A

      Taking long time and no status update
      Support • • anshul96go

      4
      0
      Votes
      4
      Posts
      805
      Views

      support

      @anshul96go Sorry for the late answer, we missed it somehow. Yes, all submissions sent before deadline will be processed and accepted.

    • S

      Pairs trading with states iterations
      Strategy help • • spancham

      4
      0
      Votes
      4
      Posts
      777
      Views

      S

      @support
      Cool, thanks very much! 👍

    • magenta.grimer

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

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

    • E

      Q17 Contest: When will you update the performance of the strategies?
      Support • • EDDIEE

      4
      1
      Votes
      4
      Posts
      608
      Views

      support

      @theflyingdutchman Hello, before the end of the week the update will be ready, sorry for the delay

    • M

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

      4
      1
      Votes
      4
      Posts
      2472
      Views

      V

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

    • X

      allocations and orders
      General Discussion • • xiaolan

      4
      0
      Votes
      4
      Posts
      578
      Views

      support

      @xiaolan Yes, allocations are translate to orders internally, it is enough to check the variation in the allocations and transform it into number of contracts bought/sold. When we designed the toolbox the goal was to simplify development as much as possible for the users.

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