help with line coupling
momentum last edited by
I am trying to couple some data passed to the indicator i.e. coupling based on the clock created from the first data passed. The following works in the sense that signal2 is the coupled version to the clock based on datas. However, I guess there must be a better way to achieve this i.e. without creating signal1 that is not needed.
class NaiveIndicator(bt.Indicator): lines = ('signal1','signal2',) def __init__(self): self.lines.signal1 = self.datas self.lines.signal2 = self.lines.signal1() ... cerebro.addindicator(NaiveIndicator, cerebro.datasbyname["Data0"], cerebro.datasbyname["Data1"], cerebro.datasbyname["Data2"])