Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Recent
    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
    • M

      Differences between Sharpe in Precheck and Sharpe in strategy.ipynb
      Support • • multi_byte.wildebeest

      5
      0
      Votes
      5
      Posts
      336
      Views

      M

      @support Thank you !

    • C

      WARNING! Strategy trades non-liquid assets.
      Support • • CommanderAngle

      2
      0
      Votes
      2
      Posts
      138
      Views

      support

      @commanderangle Hi, the reason is that the algorithm is generating non-negative weights for assets which are not liquid at some point in time, in other words they are not part of the Nasdaq index at that time.

    • M

      Submitting Deep Learning model-Filtered by Calculation time exceeded
      Support • • multi_byte.wildebeest

      2
      1
      Votes
      2
      Posts
      191
      Views

      support

      @multi_byte-wildebeest is it taking 2-3 minutes for each point in time?

    • D

      Optimization speed in python
      Strategy help • • dark.pidgeot

      2
      0
      Votes
      2
      Posts
      229
      Views

      support

      @dark-pidgeot Hi, the question is a bit too generic, what do you need exactly to speed up?

    • N

      How to filter ticker futures by sharpe
      Support • • newbiequant96

      5
      1
      Votes
      5
      Posts
      280
      Views

      N

      @vyacheslav_b Thank you so much.

      I have one more question for you to answer. I ran the precheck and the result was nan value the first time, but I set the min_date to 2005 - 01 - 01. I would like to ask, why is there a nan value problem? Is it because the ticker I chose had some companies that weren't listed at that time? My strategy id code is # 16767242. Thank you so much

      Screenshot 2024-04-09 173002.png
      Screenshot 2024-04-09 173012.png

    • V

      Clarification on Sharpe Ratio definition
      Support • • vg2001

      2
      0
      Votes
      2
      Posts
      137
      Views

      support

      @vg2001 of course you are right, thanks for pointing out the typo in the formula!

    • M

      Missed Call to write output
      Strategy help • • magenta.kabuto

      16
      1
      Votes
      16
      Posts
      961
      Views

      M

      I finally resolved the issue, after lots of struggle. The custom layers, custom loss function and the function had to be serialized and deserialized correctly in order to save the architecture and weights as Json, rather than in a dictionary, like is suggested for pytorch in the Neural netowork template.
      It seems Pytorch is way more user friendly when it comes to saving and loading models.

    • N

      Is it possible to combine stocks with crypto?
      Support • • newbiequant96

      3
      1
      Votes
      3
      Posts
      186
      Views

      N

      @vyacheslav_b Thank you very much for your support.

      I would like to ask, if I want to filter out the crypto codes with the highest sharpness, what should I do? Thank you. I tried using the get_best_instruments function but it didn't work

      import qnt.stats as qnstats # data = qndata.stocks.load_ndx_data(tail = 17*365, dims = ("time", "field", "asset")) data = qndata.stocks.load_ndx_data(min_date="2005-01-01") def get_best_instruments(data, weights, top_size): # compute statistics: stats_per_asset = qnstats.calc_stat(data, weights, per_asset=True) # calculate ranks of assets by "sharpe_ratio": ranks = (-stats_per_asset.sel(field="sharpe_ratio")).rank("asset") # select top assets by rank "top_period" days ago: top_period = 1 rank = ranks.isel(time=-top_period) top = rank.where(rank <= top_size).dropna("asset").asset # select top stats: top_stats = stats_per_asset.sel(asset=top.values) # print results: print("SR tail of the top assets:") display(top_stats.sel(field="sharpe_ratio").to_pandas().tail()) print("avg SR = ", top_stats[-top_period:].sel(field="sharpe_ratio").mean("asset")[-1].item()) display(top_stats) return top_stats.coords["asset"].values get_best_instruments(data, weights, 10)

      19ae499c-71f3-4702-bba3-81d20fb6c5ac-image.png

    • M

      How can we have the estimation of Sharpe submitted ?
      Support • • multi_byte.wildebeest

      3
      2
      Votes
      3
      Posts
      225
      Views

      V

      @multi_byte-wildebeest Hello.

      How to get the Sharpe Ratio is in the Quick Start template.
      https://github.com/quantiacs/strategy-q20-nasdaq100-quick-start/blob/master/strategy.ipynb

      import qnt.stats as qnstats def get_sharpe(market_data, weights): rr = qnstats.calc_relative_return(market_data, weights) sharpe = qnstats.calc_sharpe_ratio_annualized(rr).values[-1] return sharpe sharpe = get_sharpe(data, weights) # weights.sel(time=slice("2006-01-01",None))

      or

      import qnt.output as qnout qnout.check(weights, data, "stocks_nasdaq100")

      or

      stat = qnstats.calc_stat(data, weights) display(stat.to_pandas().tail())

      or

      import qnt.graph as qngraph statistics = qnstats.calc_stat(data, weights) display(statistics.to_pandas().tail()) performance = statistics.to_pandas()["equity"] qngraph.make_plot_filled(performance.index, performance, name="PnL (Equity)", type="log") display(statistics[-1:].sel(field=["sharpe_ratio"]).transpose().to_pandas()) qnstats.print_correlation(weights, data)

      Please look at this post
      https://quantiacs.com/community/topic/515/what-is-forward-looking-and-why-it-s-effective-badly-to-strategy/6?_=1711712434795

    • M

      Kernel Dies
      Support • • magenta.kabuto

      6
      0
      Votes
      6
      Posts
      279
      Views

      M

      @vyacheslav_b perfect. It wasnt obvious to me that single pass was meant by that. Thank you

    • M

      Missed call to write_output although had included it
      Support • • multi_byte.wildebeest

      5
      0
      Votes
      5
      Posts
      294
      Views

      V

      @illustrious-felice Hello. please look at this post
      https://quantiacs.com/community/topic/515/what-is-forward-looking-and-why-it-s-effective-badly-to-strategy/6?_=1711712434795

    • C

      Fot Q21 NASDAQ-100 which are the 100 stocks used out of the 249 that returns "qndata.stocks.load_ndx_data(tail = 365 * 5)" ?
      Support • • captain.dog

      2
      0
      Votes
      2
      Posts
      133
      Views

      S

      @captain-dog Hi,

      This is the total number of different companies that have been constituents of Nasdaq-100 index at some point, from 2006-01-01 and so on. At any point, there are 100 companies in index (sometimes more, up to 108) and those are considered as liquid ("is_liquid"=1.0), as long as they are part of the index.

    • M

      Non Deep learning strategy filtered by Calculation time exceed
      Support • • multi_byte.wildebeest

      2
      0
      Votes
      2
      Posts
      127
      Views

      support

      @multi_byte-wildebeest Dear multi_byte-wildebeest,
      You can check logs for your submission in the Filtered panel, so you can get more information why it might have failed. Please note that installing libraries takes time and should be placed in init.ipynb file and not in strategy.ipynb. Also check for potential bugs, errors and tricky loops.

      Regards

    • G

      Three questions about the qnbt.backtest_ml used in Machine Learning on a Rolling Basis example.
      Support • backtestml • • gjhernandezp

      2
      0
      Votes
      2
      Posts
      204
      Views

      support

      @gjhernandezp Dear gjhernandezp,

      No, models are trained from scratch taking the train_period of the data that is changing depending on the processing day. No, the retraining is done from scratch, taking the whole available data up until that point in time. That is not available at the moment, but take a note that when submitting a ML strategy it should be in a single-pass mode. For example instead of using backtest_ml function that is designed for testing purposes, one should use single-pass, for example: data_train = load_data(train_period) models = train_model(data_train) data_predict = load_data(lookback_period) weights_predict = predict(models, data_predict) print_stats(data_predict, weights_predict) qnout.write(weights_predict) # To participate in the competition, save this code in a separate cell.
    • M

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

      4
      1
      Votes
      4
      Posts
      379
      Views

      V

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

    • D

      progress check froze
      Strategy help • • dark.pidgeot

      3
      0
      Votes
      3
      Posts
      184
      Views

      D

      @support Hello,

      got it, thanks for the reply,

    • illustrious.felice

      TypeError: __init__() got an unexpected keyword argument 'max_value'
      Strategy help • • illustrious.felice

      2
      0
      Votes
      2
      Posts
      265
      Views

      support

      @illustrious-felice
      Hello, sorry for late reply, can you please let us know about the progressbar2 version installed from environment you are currently using? Be sure that "progressbar2" package is installed and not "progressbar".

      Best regards,

    • B

      How to get NASDAQ100 index weights?
      Strategy help • • buyers_are_back

      2
      0
      Votes
      2
      Posts
      196
      Views

      support

      @buyers_are_back Hi, more info of course can be found here:

      https://indexes.nasdaqomx.com/docs/Nasdaq_Index_Weight_Calculations.pdf

      and here:

      https://indexes.nasdaq.com/docs/Methodology_NDX.pdf

      Pages 4 and 5 give more details on the weights and caps.

      For example, no security weight may exceed 14% of the index value.

    • M

      Error in Online Enviroment
      Support • • magenta.kabuto

      3
      0
      Votes
      3
      Posts
      210
      Views

      support

      Dear magenta.kabuto,

      It appears to be a pandas version mismatch. You can try using different pandas version but it's not documented nor supported and our library could behave in an unexpected manner.

    • illustrious.felice

      RuntimeError: expand(torch.DoubleTensor{[694, 6]}, size=[694]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)
      Strategy help • • illustrious.felice

      4
      0
      Votes
      4
      Posts
      271
      Views

      illustrious.felice

      @support Thank you so much. I have resolved this error

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