Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. anshul96go
    3. Topics
    A
    • Profile
    • Following 3
    • Followers 0
    • Topics 13
    • Posts 22
    • Best 2
    • Groups 0
    • Blog

    Topics created by anshul96go

    • A

      Taking long time and no status update
      Support • • anshul96go

      4
      0
      Votes
      4
      Posts
      273
      Views

      support

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

    • A

      Weights different in testing and submission
      Support • • anshul96go

      6
      0
      Votes
      6
      Posts
      378
      Views

      support

      @antinomy thanks!

    • A

      Clarification regarding execution time
      Support • • anshul96go

      3
      0
      Votes
      3
      Posts
      219
      Views

      support

      @anshul96go Dear Anshul, it means that the weights for each day have to be generated in less than 10 minutes of time per day.

      Note that all submissions are processed on the server after submission using a muti-pass approach (not single-pass).

      10 minutes per day, times 250 days, times 10 years, that is more than 400 hours of running time.

    • A

      Output the results in an excel or other format file
      Support • • anshul96go

      3
      1
      Votes
      3
      Posts
      298
      Views

      A

      @anshul96go
      To get the actual statistics you currently have to calculate them like so:

      import qnt.stats as qns data = qndata.cryptodaily_load_data(min_date="2014-01-01") # or whenever your backtest started stats = qns.calc_stat(data, weights)

      And if you really need them as xls file you can do:

      stats.to_pandas().to_excel('stats.xls') # I got a ModuleNotFoundError the first time - pip install did the trick.

      Allthough I can't recommend xls because at least LibreOffice becomes very slow / unresponsive when handling such a file.

      Getting the statistics after a backtest could be a little simpler, which brings me to a feature request:
      @support
      Do you think you could add a parameter to the backtester which makes it return the statistics? They get calculated anyway by default, but we only see a truncated printout or the plots and can't use them for further analysis.
      .
      In my local environment I did it like this in qnt.backtester.py:

      Add the parameter return_stats: bool = False to the parameters of the backtest function From line 353 onward my backtester now looks like this: qnout.write(result) qnstate.write(state) if return_stats: analyze = True out = [result] if analyze: log_info("---") stats = analyze_results(result, data, competition_type, build_plots, start_date) if return_stats: out.append(stats) if args_count > 1: out.append(state) if len(out) == 1: out = out[0] return out finally: qndc.set_max_datetime(None) And of course I made analyze_results return the statistics like so (line 458 in the original): if not build_plots: log_info(stat_global.to_pandas().tail()) return stat_global # here log_info("---") log_info("Calc stats per asset...") stat_per_asset = qnstat.calc_stat(data, output, per_asset=True) stat_per_asset = stat_per_asset.loc[output.time.values[0]:] if is_notebook(): build_plots_jupyter(output, stat_global, stat_per_asset) else: build_plots_dash(output, stat_global, stat_per_asset) return stat_global # and there

      This might not be the most elegant solution but you get the idea.
      Now I can get the statistics immediately after the backtest with

      weights, stats = backtest(...return_stats=True)

      and can do further analysis.
      For instance, I started to calculate the correlations between my strategies to avoid uploading more of the same to the contest.

      It would be nice to have this feature in a future version, so I don't have to mess with the backtester after each update 😉

      Best regards

    • A

      Should I care about this?
      Support • • anshul96go

      2
      0
      Votes
      2
      Posts
      152
      Views

      support

      @anshul96go Sorry for delayed answer, we missed your question, but yes, you should make sure, as the message says, that your strategy has an in-sample Sharpe ratio larger than 1, or it win not be eligible for taking part to the contest.

    • A

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

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

    • A

      Unable to untick the strategy
      Support • • anshul96go

      3
      0
      Votes
      3
      Posts
      195
      Views

      support

      We managed to reproduce this issue and we fixed it.

    • A

      Issue with Future and Crypto Spot data
      Support • • anshul96go

      8
      0
      Votes
      8
      Posts
      455
      Views

      A

      @support Thanks, mailing you!

    • A

      Bitcoin Futures strategy in Futues Competition
      Support • • anshul96go

      3
      0
      Votes
      3
      Posts
      169
      Views

      J

      @anshul96go Hello, when you submit, you have to select the competition type.

      If you want to submit a Bitcoin system, you have to select "Cryptofutures".

      If you want to submit a Futures system not including Bitcoin at all, you have to select "Futures".

    • A

      Clarifications
      Support • • anshul96go

      2
      1
      Votes
      2
      Posts
      160
      Views

      support

      @anshul96go Hi, sorry for the confusion:

      the competition is still formally a "cryptofutures" one, you should get the data using qndata.cryptofutures.load_data(tail=period), as the timestamp are matched to the futures ones;

      in connection to 1), data are daily level.

    • A

      Trading System Optimisation Code
      Support • • anshul96go

      2
      0
      Votes
      2
      Posts
      178
      Views

      support

      Hello.

      If you open the source code qnt/optimizer.py, you can find that the optimizer uses these functions for optimization:

      def standard_stats_function(data, output): """ Calculates statistics for the iteration output. :param data: market data :param output: weights :return: dict """ start_date = qns.get_default_is_start_date_for_type(data.name) stat = qns.calc_stat(data, output.sel(time=slice(start_date, None))) return stat.isel(time=-1).to_pandas().to_dict() def standard_stats_to_weight(stat): """ Converts the statistics to weight. :param stat: dict :return: """ res = stat.get('sharpe_ratio', float('-inf')) if math.isfinite(res): return res else: return float('-inf')

      You can use other functions if you want. Just specify stats_function and stats_to_weight when you call optimize_strategy.

      It is ok that you use your own optimization algorithm. This one is the simplest implementation and it may not suit you perfectly. You can just reuse some code from optimizer.py which relates to workers. It may be useful if you want to speed up your optimizer.

      Regards.

    • A

      Using Volume/OI data
      Strategy help • • anshul96go

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

    • A

      Expected Time to Run Strategy
      Support • • anshul96go

      4
      0
      Votes
      4
      Posts
      347
      Views

      A

      @support Got it, thanks a lot!

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