self.await_market_to_open#

lumibot.strategies.strategy.Strategy.await_market_to_open(self, timedelta=None)#

Executes infinite loop until market opens

If the market is closed, pauses code execution until self.minutes_before_opening minutes before market opens again. If an input (float) is passed as parameter, pauses code execution until input minutes before market opens again.

Parameters:

timedelta (int) – Time in minutes before market will open to pause to. Overrides the self.minutes_before_opening.

Return type:

None

Example

>>> # Await market to open (on_trading_iteration will stop running until the market opens)
>>> self.await_market_to_open()