def on_closed_market_iteration

This lifecycle method runs during explicitly scheduled closed-market preparation runs (for example, pre-market research or overnight indicator/evidence staging). Order submission, cancellation, and modification APIs are blocked during closed-market preparation runs so off-hours data preparation never submits unintended trades.

class MyStrategy(Strategy):
    def on_closed_market_iteration(self):
        self.vars.overnight_notes = "Prepared before market open"

Reference

lumibot.strategies.strategy.Strategy.on_closed_market_iteration(self)

Prepare data during an explicitly scheduled closed-market run.

This lifecycle is only called for scheduled one-shot runs whose internal target event is closed_market_prepare and whose broker reports the market closed. LumiBot blocks supported broker order submission, cancellation, and modification APIs for the duration of this method. Use it to fetch data and persist a plan for a later market-open run.