Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Queries on Drawdown Calculation

    General Discussion
    3
    9
    366
    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.
    • kian hong Tan
      kian hong Tan last edited by

      Hello community! I have trouble understanding the drawdown calculation. Appreciate if someone can enlighten me. Below is the result of a strategy for BTC, from Jan 01 to Jan 31 2018. I did my own calculations and the max DD 1.19%, occurs on the closure of 2nd trade, dated Jan 11.

      1cb1a853-f08f-45c0-bd48-c25313f5835d-image.png

      Then, I also check the log from the drawdown observer. The max DD after 2nd trade is 3.83%. How is this figure being calculated? Also, from the log, I notice that the drawdown amount changes sometimes when there is no trade being opened or closed. Hope you are able to shed some light on this please. thank you.

      a14ec8a0-dbd9-440b-b5c6-4ba9a123ace9-image.png

      1 Reply Last reply Reply Quote 0
      • run-out
        run-out last edited by

        The calculation method is here.

        RunBacktest.com

        1 Reply Last reply Reply Quote 0
        • kian hong Tan
          kian hong Tan last edited by

          @run-out Tks for your response. I did read the documentation and work out the calculations myself as shown in the first screenshot. But the results from drawdown observer seem to be different from my calculations. My MDD is 1.19% vs the observer's MDD of 3.83%. Hence wanna know if I miss out anything or something is wrong with my calculations.

          1 Reply Last reply Reply Quote 0
          • kian hong Tan
            kian hong Tan last edited by

            @run-out oh ya, I'm testing data of 30min timeframe. Does it affect the drawdown calculations? I saw another observer named TimeDrawdown, but not quite sure how it's being used.

            1 Reply Last reply Reply Quote 0
            • kian hong Tan
              kian hong Tan last edited by

              Hello @ab_trader , I'm trying to understand drawdown calculations and saw your response on similar query here - https://community.backtrader.com/topic/1270/drawdown-analysis-appears-to-be-incorrect .

              So based on what you comment, our drawdown calculations are based on closed trade, without considering in-trade drawdown. In-trade drawdown refers to unrealized loss/drawdown, when the trade is still open. Is my understanding correct?

              1 Reply Last reply Reply Quote 0
              • A
                ab_trader last edited by

                bt calculates draw down based on the equity (broker value) peaks and troughs. If you use different method, than don't be surprised that your results are different. If you use the same method, but your results are still different, than post the script, bt results, your results and data.

                • If my answer helped, hit reputation up arrow at lower right corner of the post.
                • Python Debugging With Pdb
                • New to python and bt - check this out
                1 Reply Last reply Reply Quote 1
                • kian hong Tan
                  kian hong Tan last edited by

                  @ab_trader Both screenshots are results from bt. The only thing is that i manually calculate the peak, trough and drawdown after trade closure (1st screenshot), and use them to compare against the log in the 2nd screenshot (drawdown log from drawdown analyzer, only show till 2nd trade). So I wanna know if the equity (broker value) peaks and troughs in bt consider unrealized loss/drawdown in the calculation? tks.

                  ee07ce23-b9ff-4e82-80d0-153d4ff07256-image.png

                  7f4ffb0a-7c16-420a-bb8c-b683bb20a8fb-image.png

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    ab_trader @kian hong Tan last edited by

                    @kian-hong-Tan said in Queries on Drawdown Calculation:

                    So I wanna know if the equity (broker value) peaks and troughs in bt consider unrealized loss/drawdown in the calculation?

                    This should be evident from the bt outputs.

                    • If my answer helped, hit reputation up arrow at lower right corner of the post.
                    • Python Debugging With Pdb
                    • New to python and bt - check this out
                    1 Reply Last reply Reply Quote 1
                    • kian hong Tan
                      kian hong Tan last edited by

                      @ab_trader tks for the confirmation.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors