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

# self.get_last_day

strategies.strategy.Strategy.get_last_day(self)

  Returns the last day of the current month. In a backtest this will be the current bar’s timestamp. In live trading this will be the current timestamp on the exchange.

  Returns:

    The last day of the current month.

  Return type:

    int

  Example

      >>> # Will return the last day of the current month
      >>> last_day = self.get_last_day()
      >>> self.log_message(f"The last day of the current month is {last_day}")