Navigation

    Quantiacs Community

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

    WARNING: some dates are missed in the portfolio_history

    Support
    4
    7
    364
    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, I am starting with Examples: Q18 : Supervised learning (Ridge Classifier).

      I encountered the error : some dates are missed in the portfolio_history when run the precheck.ipynb file, whereas running the strategy.ipynb file is fine.

      The resulting outcome is Sharpe in precheck is 0.25 << Sharpe in strategy.ipynb.

      I think there is no forward looking, because: weights = qnbt.backtest_ml.

      1. Can you give me the possible reasons ?
      2. Can you please give me temporary way to resolve it ? (Assign some weights to missed dates)
      support 1 Reply Last reply Reply Quote 0
      • support
        support @multi_byte.wildebeest last edited by

        @multi_byte-wildebeest Hi, the qnbt.backtest_ml is designed to avoid forward-looking as it processes the algorithm day-by-day (we call that multi-pass). That is safer than a full-time processing at once (single-pass) where all the time series is available to the user.

        Let us see a concrete example: a user can define in the algorithm a global mean (in other words, the mean over all the time series). A single-pass processing will be forward-looking by construction, as at any point in time the global result of the mean will be available. That is bad.

        A multi-pass processing mitigates the issue, as at point in time "t" only the mean on previous points in time is available. No forward-looking takes place.

        qnbt.backtest_ml avoids this kind of forward looking.

        However forward-looking is still possible, if for example the user uses a target in the future (the tomorrow price) to train the algorithm. This will be visible after the notebook processing. But precheck.ipynb will take care of this, and match the result after submission.

        Is it possible that your algorithm uses unintentionally data points from the future? Normally is is very dangerous to use the shift function with negative arguments.

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

          @support thank you so much for your very clear explaination !

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

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • M
              multi_byte.wildebeest @support last edited by

              @support Hi, but how about some dates are missed in the portfolio history when run the precheck ?

              M V 2 Replies Last reply Reply Quote 0
              • M
                machesterdragon @multi_byte.wildebeest last edited by

                @multi_byte-wildebeest I also encountered the situation that some dates are missed in the portfolio_history when running precheck and sharpe which are very small compared to when working on strategy. Looking forward to your help. thank you very much

                @support @Vyacheslav_B

                Screenshot 2024-05-09 101653.png

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

                  @multi_byte-wildebeest Hi. Without an example, it's unclear what the problem might be.

                  If you use a state and a function that returns the prediction for one day, you will not get correct results with precheck.

                  This was discussed here: https://quantiacs.com/community/topic/555/access-previous-weights/18

                  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