INNER CODE UNIT · Python
_update_plot_price_lists
Erfaniaa/crypto-trading-strategy-backtester · backtester.py:302
def _update_plot_price_lists(self):
self.plot_close_prices_list.append(self.current_candle.close)
self.plot_close_prices_datetimes_list.append(self.current_candle.close_time)
def _update_plot_deposit_lists(self):
self.plot_deposits_list.append(self.total_first_coins + self.open_positions_value)
self.plot_deposit_datetimes_list.append(self.current_candle.close_time)
def _is_it_time_to_open_long_position(self):
main_condition = self.is_price_increasing and not self.last_is_price_increasing
is_too_early = self.candles_index < self.minimum_number_of_candles_to_start_trading
is_positions_list_empty = len(self.open_long_positions_list) == 0 and len(self.open_short_positions_list) == 0
is_ontime = False
if self.open_position_timeframe == "m15":
is_ontime = self.current_candle.open_time == utils.round_down_m1_to_m15_time(self.current_candle.open_time)
if self.open_position_timeframe == "h1":