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/

    Can you instantiate a Line Coupler inside an Indicator

    General Code/Help
    1
    2
    249
    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.
    • D
      deedy last edited by

      In my custom indicator I would like to do something like this:

      (...datas[0] is an hourly time scale, datas[1] is the same data resampled daily)

      self.l.daily_close = self.datas[1].close
      self.l.daily_coupler = self.l.daily_close()

      or take the SMA of datas[1] perhaps...or is this totally impossible?

      I am trying to make a MACD crossover on the daily, but if there is a sufficiently large hourly trade, I want to update the daily MACD crossover, then trade in the next hour. So I am iterating on the hourly scale

      Many thanks!

      1 Reply Last reply Reply Quote 0
      • D
        deedy last edited by

        I've found a workaround. I define the coupler in strategy then pass it in as a parameter to MyInd().

        I hope that's the way it is intended to be used

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