Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# self.get_round_minute

strategies.strategy.Strategy.get_round_minute(self, timeshift=0)

  Returns the current minute rounded to the nearest minute. In a backtest this will be the current bar’s timestamp. In live trading this will be the current timestamp on the exchange.

  Parameters:

    timeshift (int) – The number of minutes to shift the time.

  Returns:

    The current minute rounded to the nearest minute.

  Return type:

    int

  Example

      >>> # Will return the current minute rounded to the nearest minute
      >>> round_minute = self.get_round_minute()
      >>> self.log_message(f"The current minute rounded to the nearest minute is {round_minute}")