Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How can we have the estimation of Sharpe submitted ?

    Support
    3
    3
    187
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      multi_byte.wildebeest last edited by

      Hi, how can we know the IS Sharpe will be when develop my strategy ?

      For example, the backtest_ml prints Sharpe at the end, but as I know, it is the Sharpe of the last day of trading.

      Many strategies developed locally have Sharpe > 1.0 but when submitted are filtered by IS Sharpe.

      support V 2 Replies Last reply Reply Quote 2
      • support
        support @multi_byte.wildebeest last edited by

        @multi_byte-wildebeest Dear multi_byte-wildebeest,

        The sharpe ratio is calculated for a specific period, so the sharpe ratio that you see in the end is one for period of when you started your calculation up until when you stopped it. To get some estimation for STOCKS_NASDAQ100 competition type that has in-sample start date set to 1.1.2006., you should set parameters in your strategy that you backtest to also start from that same date. If it happens that sharpe ratio is significantly lower after submission for the same period, that means that you could have forward looking somewhere in your strategy (you look for data in the future to calculate weights for those days).

        Regards

        1 Reply Last reply Reply Quote 0
        • V
          Vyacheslav_B @multi_byte.wildebeest last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB | Contributors
          • Documentation
          • About
          • Career
          • My account
          • Privacy policy
          • Terms and Conditions
          • Cookies policy
          Home
          Copyright © 2014 - 2021 Quantiacs LLC.
          Powered by NodeBB | Contributors