Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. te
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    T
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    te

    @te

    0
    Reputation
    240
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    te Unfollow Follow

    Latest posts made by te

    • RE: Benchmark observer bug?

      Hm, I found another issue in my code. I'll try to sort that out first to see if it's related somehow.

      posted in General Code/Help
      T
      te
    • RE: Benchmark observer bug?

      Sorry, here is the code.

      self.cerebro.addobserver(bt.observers.BuySell)
      self.cerebro.addobserver(bt.observers.Value)
      self.cerebro.addobserver(bt.observers.TimeReturn, timeframe=bt.TimeFrame.NoTimeFrame)
      self.cerebro.addobserver(bt.observers.Benchmark, data=self.data_benchmark, timeframe=bt.TimeFrame.NoTimeFrame)
      

      If I activate cheat-on-close the difference is even bigger.
      self.cerebro.broker.set_coc(coc=True)

      0_1502818908977_benchmark_test_coc.png

      posted in General Code/Help
      T
      te
    • Benchmark observer bug?

      Hi everyone,

      I am a novice regarding backtrader and also python but it is great fun to learn and use the platform. Great work by all involved!

      Today I tried the Benchmark observer and noticed that the return from the strategy is different than when using the TimeReturn observer. Is this a bug (missing negative sign for return of strategy in benchmark observer) or is it possible that I am missing something. See attached plot image.

      Thanks in advance!

      Best regards,
      Torbjörn
      0_1502737916178_benchmark_test.png

      posted in General Code/Help
      T
      te