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/

    Trade Analyzer

    General Code/Help
    2
    3
    584
    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.
    • E
      ElliotP last edited by

      Afternoon,

      I am not sure if I understand trade analyzer properly or not. I have done some reading of the documentation, the community and the google; but my instance is still producing results I don't understand.

      For example; a plot will show me having 5 positive trades and 8 negative trades.

      The trade analyzer will then tell me there were 11 total trades.
      My win and loss values are the same at 4.

      It's a long only strategy and the long total is 11, long_win & long_lost are both 4.

      I can provide some code but it's a bit gangly atm. My orders are buying with bracket orders where the execution type is market. If the orders don't hit the bracket in the same day, then the position is self.order = self.close in the final few mins of the day.

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        Sorry but with your information there is no diagnostic which can be made. Only a couple of comments.

        @elliotp said in Trade Analyzer:

        bracket orders where the execution type is market.

        This is for sure wrong. Because a Market order has no guaranteed execution price, which means it can land outside of the bracket. Your choice.

        @elliotp said in Trade Analyzer:

        self.order = self.close

        You probably know what you mean, but the rest of the world doesn't.

        1 Reply Last reply Reply Quote 2
        • E
          ElliotP last edited by

          This was all related to my horrible solution for only trading once a day. I'll write more details in the optimization issue thread.

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