def add_indicators(self): self.candles = self.candles.drop(['Open_time', 'Close_time'], axis=1) self.candles['EMA - 15'] = ema(self.candles['Close'].tolist(), 15) self.candles['aaron down'] = aroon_down(self.candles['Close'].tolist(), 25) self.candles['aaron up'] = aroon_up(self.candles['Close'].tolist(), 25) self.candles['tenkansen'] = tenkansen(self.candles['Close'].tolist()) self.candles['kijunsen'] = kijunsen(self.candles['Close'].tolist()) self.candles['momentun'] = momentum(self.candles['Close'], 15) return self.candles
def test_tenkansen_default_period(self): ts = ichimoku_cloud.tenkansen(self.close_data) np.testing.assert_array_equal(ts, self.tenkansen_default_expected)
def next_calculation(self, candle): if self.get_datawindow() is not None: if self.params['indicator'] == 'tenkansen': self.value = indicator.tenkansen(self.get_close(), self.periods)[-1]