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



  • 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!



  • 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