Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. newbiequant96
    3. Topics
    N
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 10
    • Best 2
    • Groups 0
    • Blog

    Topics created by newbiequant96

    • N

      How to submit stateful long short
      Strategy help • • newbiequant96

      2
      0
      Votes
      2
      Posts
      312
      Views

      support

      @newbiequant96 Hi, the template is a "working code" still to be finalized and published among the templates in the account area, however the logic behind is strictly multi-pass and a conversion to single pass is not really so straightforward.

    • N

      KeyError: "cannot represent labeled-based slice indexer for coordinate 'time' with a slice over integer positions; the index is unsorted or non-unique"
      Support • • newbiequant96

      5
      0
      Votes
      5
      Posts
      220
      Views

      M

      @newbiequant96 no problem.
      I think the issue now is unrelated to the the previous issue. If you can show what is written above return code 1, I can maybe help.
      It seems to be an issue in the code.
      Regards

    • N

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

      3
      1
      Votes
      3
      Posts
      156
      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

    • N

      How to filter ticker futures by sharpe
      Support • • newbiequant96

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

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