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

      How to install Python Talib
      Support • • spancham

      5
      0
      Votes
      5
      Posts
      1416
      Views

      support

      @sheikh It is fine, please just submit, check the result and let us know if you see any issue. It should work fine.

    • C

      Setup an environment at Google Colab
      Support • • cortezkwan

      5
      2
      Votes
      5
      Posts
      354
      Views

      C

      @support Great help! Thank you so much!

    • illustrious.felice

      Strategy trades illiquid instruments
      Support • • illustrious.felice

      5
      0
      Votes
      5
      Posts
      269
      Views

      V

      @illustrious-felice Hello. The reason you're still seeing a large number of tickers (e.g., around 300) even after applying the filter is that the "best" instrument by Sharpe ratio changes over time. The rank_assets_by function returns a time-dependent mask, selecting the top N assets at each time step. So the total number of unique assets that were selected at any point in time may be much larger than top_assets.

      This is expected behavior.

      To illustrate this more clearly, let's consider a minimal working example that selects only 1 top asset at each point in time and shows all the intermediate steps:

      import qnt.data as qndata import qnt.ta as qnta import qnt.stats as qnstats import qnt.output as qnout import qnt.filter as qnfilter import xarray as xr import pandas as pd top_assets = 1 data = qndata.stocks.load_spx_data(min_date="2005-06-01") weights = data.sel(field="is_liquid") stats_per_asset = qnstats.calc_stat(data, weights, per_asset=True) sharpe_ratio = stats_per_asset.sel(field="sharpe_ratio") asset_filter = qnfilter.rank_assets_by(data, sharpe_ratio, top_assets, ascending=False) weights = weights * asset_filter stats = qnstats.calc_stat(data, weights.sel(time=slice("2005-06-01", None))) display(asset_filter.to_pandas().tail()) display(stats.to_pandas().tail()) display(sharpe_ratio.to_pandas().tail()) display(weights.to_pandas().tail())

      If you want to see which asset was the best on specific dates, you can do something like this:

      dates = ["2015-01-15", "2020-01-15", "2025-01-15"] records = [] for date_str in dates: best_mask = asset_filter.sel(time=date_str) assets = best_mask.where(best_mask > 0, drop=True).asset.values srs = sharpe_ratio.sel(time=date_str, asset=assets).values for a, s in zip(assets, srs): records.append({"time": date_str, "asset": a.item(), "sharpe_ratio": float(s)}) df = pd.DataFrame(records).set_index("time") display(df) asset sharpe_ratio time 2025-05-22 NYS:HRL 1.084683 2025-05-22 NAS:KDP 1.093528 2025-05-22 NAS:AAPL 0.968039

      Or simply for a single date:

      date = "2020-05-22" best_mask = asset_filter.sel(time=date) best_assets = best_mask.where(best_mask > 0, drop=True).asset best_sr = sharpe_ratio.sel(time=date, asset=best_assets) print(best_sr.to_pandas())

      This shows clearly that only one asset is selected at each time step, but over the full time range, many different assets can appear in the top list depending on how their Sharpe ratios change.

    • C

      Multi-pass Backtesting
      Strategy help • • cyan.gloom

      5
      0
      Votes
      5
      Posts
      449
      Views

      V

      @eddiee

      Hello.

      This code looks to the future.
      It is needed to train the model.
      Pay attention to the name of the variable.

    • G

      Colab new error 'EntryPoints' object has no attribute 'get'
      Support • • gjhernandezp

      5
      0
      Votes
      5
      Posts
      459
      Views

      support

      @gjhernandezp Thank you for sharing your solution!

    • C

      What's is the next contest ?
      News and Feature Releases • • cyan.gloom

      5
      0
      Votes
      5
      Posts
      695
      Views

      support

      @yonasbo Hi, sorry for delay, we will start soon a new contest, in the next 2 weeks

    • E

      Q17 Contest
      General Discussion • • EDDIEE

      5
      0
      Votes
      5
      Posts
      424
      Views

      support

      @theflyingdutchman Yes, we are integrating new data sources for a new asset class, once we are done (next week) the data and leaderboard updates will start again.

    • L

      Fundamental data loading does not work
      Support • • lookman

      5
      0
      Votes
      5
      Posts
      396
      Views

      V

      @lookman Hello. Try cloning your strategy and running it again. It should work correctly with the new version of the qnt library.

      import qnt.data as qndata import qnt.data.secgov_fundamental as fundamental market_data = qndata.stocks.load_spx_data(min_date="2005-01-01") indicators_data = fundamental.load_indicators_for(market_data, indicator_names=['roe']) display(indicators_data.sel(field="roe").to_pandas().tail(2)) display(indicators_data.sel(asset='NAS:AAPL').to_pandas().tail(2)) display(indicators_data.sel(asset=['NAS:AAPL']).sel(field="roe").to_pandas().tail(2))

      https://quantiacs.com/documentation/en/data/fundamental.html

    • X

      Pandas and xarray
      Strategy help • • xiaolan

      5
      1
      Votes
      5
      Posts
      388
      Views

      support

      @xiaolan Ok, but please note that you can work all the time with xarray, the documentation is very good:

      http://xarray.pydata.org/en/stable/

    • news-quantiacs

      The Winners of the Q15 Futures and BTC Contests
      News and Feature Releases • • news-quantiacs

      5
      1
      Votes
      5
      Posts
      614
      Views

      support

      @algotime Hello, on 1st November allocations will start, you will receive a mail soon today!

    • O

      No error messages show why the strategies failed
      Support • • omohyoid

      5
      0
      Votes
      5
      Posts
      450
      Views

      support

      @omohyoid Dear omohyoid,

      Yes, that's right. After submitting your strategy shouldn't override environment variables.

      Regards

    • magenta.grimer

      Some clarifications
      General Discussion • • magenta.grimer

      5
      0
      Votes
      5
      Posts
      407
      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

    • N

      How to filter ticker futures by sharpe
      Support • • newbiequant96

      5
      1
      Votes
      5
      Posts
      259
      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

    • J

      Alpha Default Value of EMA function
      Strategy help • • juzambranol

      5
      0
      Votes
      5
      Posts
      373
      Views

      support

      @gjhernandezp yes, correct, 2/(n+1), sorry for the typo, thanks for correcting

    • M

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

      5
      0
      Votes
      5
      Posts
      317
      Views

      M

      @support Thank you !

    • B

      Submission failed: what's wrong??
      Support • • buyers_are_back

      5
      0
      Votes
      5
      Posts
      341
      Views

      support

      @buyers_are_back We reprocessed the submission, it is formally correct and passes all the filters. Sorry for the issue, evidently on our side.

    • S

      Pairs trading with states iterations
      Strategy help • • spancham

      4
      0
      Votes
      4
      Posts
      368
      Views

      S

      @support
      Cool, thanks very much! 👍

    • nosaai

      Local Development Problems
      General Discussion • • nosaai

      4
      1
      Votes
      4
      Posts
      356
      Views

      V

      @nosaai Hello

      Spyder should be run under conda environment

      conda activate qntdev conda install spyder spyder

      an alternative way is to clone the library from https://github.com/quantiacs/toolbox
      and develop strategies inside qnt. But I recommend using the approach from the documentation.

    • V

      Example strategy for Q19
      Support • • vg2001

      4
      0
      Votes
      4
      Posts
      270
      Views

      support

      @vg2001 Hello, the Q19 is a replica of the Q18, you ccan use the same examples.

    • nosaai

      Local Development with Notifications
      Support • • nosaai

      4
      0
      Votes
      4
      Posts
      319
      Views

      A

      It's safe to ignore these notices but if they bother you, you can set the variables together with your API key using the defaults and the messages go away:

      import os os.environ['API_KEY'] = 'YOUR-API-KEY' os.environ['DATA_BASE_URL'] = 'https://data-api.quantiacs.io/' os.environ['CACHE_RETENTION'] = '7' os.environ['CACHE_DIR'] = 'data-cache'
    • Documentation
    • About
    • Career
    • My account
    • Privacy policy
    • Terms and Conditions
    • Cookies policy
    Home
    Copyright © 2014 - 2021 Quantiacs LLC.
    Powered by NodeBB | Contributors