Navigation

    Quantiacs Community

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

    Translating code from Quantiacs Legacy

    Support
    2
    6
    214
    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.
    • illustrious.felice
      illustrious.felice last edited by

      Hi, I have a question that needs to be answered
      For example, if I have a strategy from Quantiac Legacy as follows
      3438115e-3060-4293-a9eb-f9b52961a7b1-image.png
      So how do I transform the above strategy into a new strategy using a single backtest?
      a1e3741b-ccd0-40f6-a5bc-1987d632656d-image.png
      What I mean is, will I have to convert this strategy manually or will I have a tool to convert the code? (like converting a doc file into pdf,...). We hope to have your questions answered. Thank you.

      V 1 Reply Last reply Reply Quote 0
      • V
        Vyacheslav_B @illustrious.felice last edited by

        @illustrious-felice You will have to do this manually. But if I were you, I would take this example of transformation for a conversation with ChatGPT, then I would ask ChatGPT to convert the code of the old strategy into the new one by analogy.

        illustrious.felice 2 Replies Last reply Reply Quote 1
        • illustrious.felice
          illustrious.felice @Vyacheslav_B last edited by

          @vyacheslav_b Ohhh I see. Thank you so much. I will use ChatGPT to convert faster.

          1 Reply Last reply Reply Quote 0
          • illustrious.felice
            illustrious.felice @Vyacheslav_B last edited by

            @vyacheslav_b I would like to ask, is there any way for me to remove the correlation check in the backtest? Because this takes a long time (for backtest_ml). Thank you very much
            57e5573e-621b-4580-b69e-feb5684eca7a-image.png

            V 1 Reply Last reply Reply Quote 0
            • V
              Vyacheslav_B @illustrious.felice last edited by

              @illustrious-felice Hello. There are several ways to do this.

              The simplest one is to specify the parameter

              analyze = False
              

              and add the code in the following cell:

              import qnt.data as qndata
              import qnt.stats as qns
              import qnt.graph as qngraph
              
              data = qndata.stocks.load_ndx_data(min_date="2006-01-01")
              stats = qns.calc_stat(data, weights.sel(time=slice("2006-01-01", None)))
              display(stats.to_pandas().tail())
              
              performance = stats.to_pandas()["equity"]
              qngraph.make_plot_filled(performance.index, performance, name="PnL (Equity)", type="log")
              

              Another way is to modify the source code of the library /qnt/backtester.py by commenting out the line with the correlation check, then save the changes, and then restart the kernel.

              illustrious.felice 1 Reply Last reply Reply Quote 0
              • illustrious.felice
                illustrious.felice @Vyacheslav_B last edited by

                @vyacheslav_b Thank you so much

                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