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/

    Backtrader vs TradingView Final Portfolio Result

    General Discussion
    3
    6
    145
    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.
    • Ignasius Wahyudi
      Ignasius Wahyudi last edited by

      Hello,
      usually, i'm using tradingview to backtesting my data, now i trying backtrader to replace tradingView.

      after some attempt, i tried to replicate the same Strategy ,the MAcrossover.

      I'm using TSLA Data CSV for the testing.

      The result is for the number of trades , entry & exit price is the same. ( In my case, it's 58 trades ).

      I'm testing futures , Long & Short

      But the Final Portfolio Result is Different.
      My Backtester config is
      -not using commision fee
      -bt.sizers.FixedReverser,stake=1

      My TradingView Config is
      -Order Size: 1 contracts

      Final Result:
      Backtester -> -194.60
      TradingView -> 226.92

      My question is: It's possible to get the same final result between this two platform ? or there is some difference in TradingView Calculation, floating point, or other aspect ?

      thanks.

      1 Reply Last reply Reply Quote 0
      • Ignasius Wahyudi
        Ignasius Wahyudi last edited by

        some edit:
        Final Result:
        Backtester -> -194.60
        TradingView -> -226.92

        both is negative.

        tianjixuetu A 2 Replies Last reply Reply Quote 0
        • tianjixuetu
          tianjixuetu @Ignasius Wahyudi last edited by

          @Ignasius-Wahyudi there is something(maybe wrong) when you calculate the net value when it is a future when you have a position,but after you close the position,the results is same. so , it is not a big question.

          Ignasius Wahyudi 1 Reply Last reply Reply Quote 1
          • A
            ab_trader @Ignasius Wahyudi last edited by

            @Ignasius-Wahyudi results should be the same if the same data and same algo used. 15% difference is quite a lot if duration of the backtest is a year or 2-3 years.

            1 Reply Last reply Reply Quote 1
            • Ignasius Wahyudi
              Ignasius Wahyudi @tianjixuetu last edited by

              @tianjixuetu ahh, i see. gonna check the positions. thanks.

              @ab_trader i think so, since the number of trades is the same. gonna check it again.

              1 Reply Last reply Reply Quote 0
              • Ignasius Wahyudi
                Ignasius Wahyudi last edited by

                okay, now i know whythe result is different.
                Net Profit is calculated based on last closed position only
                backtrader current portfolio include the PNL on open positions too.

                1 Reply Last reply Reply Quote 1
                • 1 / 1
                • First post
                  Last post
                Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
                $(document).ready(function () { app.coldLoad(); }); }