INNER CODE UNIT · Python

_update_indicators

Erfaniaa/crypto-trading-strategy-backtester · backtester.py:261

	def _update_indicators(self):
		self.last_fast_ema = self.fast_ema
		self.last_slow_ema = self.slow_ema

		self.last_macd_fast_ema = self.macd_fast_ema
		self.last_macd_slow_ema = self.macd_slow_ema

		self.last_macd_line = self.macd_line
		self.last_signal_line = self.signal_line

		self.last_is_macd_increasing = self.is_macd_increasing
		self.last_is_macd_decreasing = self.is_macd_decreasing

		self.last_is_price_increasing = self.is_price_increasing
		self.last_is_price_decreasing = self.is_price_decreasing
		
		self.fast_ema = indicators.get_new_ema(self.last_fast_ema, self._get_current_candle_in_another_timeframe(timeframe=self.indicators_timeframe, index_offset=-1).close, 1 * config.MOVING_AVERAGE_SIZE)
		self.slow_ema = indicators.get_new_ema(self.last_slow_ema, self._get_current_candle_in_another_timeframe(timeframe=self.indicators_timeframe, index_offset=-1).close, 2 * config.MOVING_AVERAGE_SIZE)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…