INNER CODE UNIT · Python

_is_it_time_to_update_indicators

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

	def _is_it_time_to_update_indicators(self):
		if self.timeframe == "m1" and self.indicators_timeframe == "m15":
			return self.current_candle.open_time == utils.round_down_m1_to_m15_time(self.current_candle.open_time)
		else:
			return True


	def _update_important_recent_candles(self, important_recent_candles_timeframe):

		if important_recent_candles_timeframe == "m15":
			try:
				self.important_recent_candles_list = self.candles_list["m15"][max(self.candles_open_time_to_index_dict["m15"][utils.round_down_m1_to_m15_time(self.current_candle.open_time)] - self.important_recent_candles_count, 0):self.candles_open_time_to_index_dict["m15"][utils.round_down_m1_to_m15_time(self.current_candle.open_time)]]
			except:
				print("ERROR in update_important_recent_candles")
				self.important_recent_candles_list = []

		if important_recent_candles_timeframe == "h1":
			try:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…