INNER CODE UNIT · Python

_init_index_dicts

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

	def _init_index_dicts(self):
		for tf in self.all_timeframes_list:
			self.candles_open_time_to_index_dict = {}
		for tf in self.all_timeframes_list:
			self.candles_open_time_to_index_dict[tf] = {}
			for i in range(len(self.candles_list[tf])):
				self.candles_open_time_to_index_dict[tf][self.candles_list[tf][i].open_time] = i


	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):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…