Multiple Indicators Help
-
![Hello,
I have an indicator class where I am calculating a couple of indicators. The reason I have them all in one class is that they are dependent on one another. The problem is that when I plot this class it plots all of the indicators. So specifically it is plotting the beta, spread, spread moving average, and spread std upper and lower lines. The beta value is so large, however, that it is making the rest of the indicators not visible.
How do I plot all of the indicators within the same class except the beta value?
I can't just say beta = model.fit().params instead of self.beta because I use the beta in my strategy Class.
Any suggestions would be appreciated.class Beta(bt.Indicator): lines = ("beta" , "spread" , "spread_sma15" , "spread_2sd" , "spread_m2sd" ) params = ( ("period_pct", 1), ("period_beta", 15), ) def __init__(self, strat=None): """"initialize the line assign it to a variable Any operation involving lines objects during __init__ generates another lines object Whereas during next it yields regular Python types like floats and bools""" self.strategy = strat self.line0 = self.strategy.datas[0].close self.line1 = self.strategy.datas[1].close self.addminperiod(self.params.period_beta + 1) def next(self): (...) #beta self.l.beta[0] = model.fit().params #spread self.l.spread[0] = l0_pct_change[-1] - l1_pct_change[-1] * self.l.beta[0] #15 day Spread Moving Average datasum = math.fsum(self.l.spread.get(size=self.p.period_beta)) self.l.spread_sma15[0] = datasum / self.p.period_beta #15 Day Standard Deviations self.l.spread_2sd[0] = ((((datasum - self.lines.spread_sma[link text]())15) ** 2) / self.p.period_beta) ** 0.5) * 2 self.l.spread_m2sd[0] = ((((datasum - self.lines.spread_sma15) ** 2) / self.p.period_beta) ** 0.5) * -2 ```]([image url]([link url](``` ~~ *  image url)~~ ```)))
-
I apologize. I accidentally included the link to the image in the code block. Ignore that last part.
-