INNER CODE UNIT · Python

take_profit_price

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

														   take_profit_price=self.current_candle.open * (1 - self.take_profit_percents_list[i] / 100),
														   stop_loss_price=self.current_candle.open * (1 - self.stop_loss_percents_list[i] / 100),
														   recent_candles_list=self.important_recent_candles_list,
														   candles_index=self.candles_index)
				self.open_short_positions_list.append(current_short_position)
		self.total_first_coins = 0


	def _update_open_long_positions_statistics(self):
		open_long_positions_count = len(self.open_long_positions_list)
		for i in range(open_long_positions_count):
			self.open_long_positions_list[i].max_profit_percent = max(self.open_long_positions_list[i].max_profit_percent, 100 * (self.current_candle.close - self.open_long_positions_list[i].entry_price) / self.open_long_positions_list[i].entry_price)
			self.open_long_positions_list[i].min_profit_percent = min(self.open_long_positions_list[i].min_profit_percent, 100 * (self.current_candle.close - self.open_long_positions_list[i].entry_price) / self.open_long_positions_list[i].entry_price)


	def _update_open_short_positions_statistics(self):
		open_short_positions_count = len(self.open_short_positions_list)
		for i in range(open_short_positions_count):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…