Navigation

    Quantiacs Community

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

    What is forward looking and why it's effective badly to strategy?

    Strategy help
    3
    8
    448
    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

      Hello, I am making a simple strategy as follows:

      close = data.sel(field="close")
      price_future = qnta.shift(close, -1)
      target_price_up = xr.where((price_future < close), 1, -1)

      As I understand it, this is forward-looking, resulting in a very high Sharpe (>2), however after avoiding forward-looking, Sharpe is < 0. Why does this cause such a serious decrease in sharpness?

      Please explain to me. Thank you.

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

        @illustrious-felice

        The sharp decrease in Sharpe ratio after removing forward-looking bias is because the original strategy artificially inflated performance by using future data, which isn't possible in real trading. Once you eliminate this bias, the strategy's true risk and lower performance are revealed, leading to a more realistic but lower Sharpe ratio.

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

          @vyacheslav_b Thank you for responding.

          I realize that even now I have a strategy that is not forward-looking

          close = data.sel(field="close")
          price_yesterday = qnta.shift(close, 1)
          target_price_up = xr.where((price_yesterday < close), 1, 0)

          Why is Sharpe worse after the strategy goes through training-testing by ML/DL models compared to when using a single backtest?

          I have tried many different strategies and changed different feature trains, but they all showed that after going through a certain model, the sharpness decreased compared to when using a single backtest. Please answer. Thank you so much.

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

            @illustrious-felice Hi, most likely because when you use a "single backtest" you are using all the data at your disposal.

            When you use a ML model and split training and validation sets, then you have a set (the validation one) which is blind to the existing data.

            In the end, what matters is the live performance.

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

              @support Oh, I see. Thank you for your quality feedback. Hopefully, Quantiacs can produce more examples of strategies whose input is not forward-looking (close.shift(time=-1)) so that everyone can more conveniently apply ML models to build strategies. Thank you

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

                @illustrious-felice Hello. Sometimes an error can occur at the data preprocessing stage. It's possible to inadvertently use future data.

                Quantiacs has an excellent mechanism for quickly checking such errors.

                In any strategy, there is a file:
                https://github.com/quantiacs/toolbox/blob/main/qnt/precheck.ipynb

                Run it on 3-5 splits and compare the statistics. If there are discrepancies, then it is likely that the strategy is peeking into the future.

                If you set a very large number of splits, it will be an example of how the online check of submitted strategies in the contest works.

                Intermediate results can be viewed in HTML format in the folder.
                e38dbf63-d2a4-4a82-ae36-cc6077c1485e-image.png

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

                  @vyacheslav_b Thank you very much.

                  I would like to ask why when I add a - sign or 1/weight (inverse, reverse) to the strategy's weight, I cannot reverse the PnL chart? On other platforms, I still use this technique to reverse the chart. Thank you

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

                    @illustrious-felice Hi, that is not automatic as all trades are punished by slippage, and that is a subtraction from profits irrespective on the sign of the weights.

                    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