self.get_round_day

lumibot.strategies.strategy.Strategy.get_round_day(self, timeshift=0)

Returns the current day rounded to the nearest day. 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 days to shift the time.

Returns:

The current day rounded to the nearest day.

Return type:

int

Example

>>> # Will return the current day rounded to the nearest day
>>> round_day = self.get_round_day()
>>> self.log_message(f"The current day rounded to the nearest day is {round_day}")