@benmercerdev I am new to Backtrader and tried your code to limit strategy to certain times of day, however, it is not giving desire output. Can we use following without using params?

def next(self): if not (start_date <= self.datas[0].datetime.datetime(0) <= end_date): perform_some_thing

start_date and end_date are variables, defined outside of class TestStrategy(bt.Strategy)

Is there a better way to achieve this?

Prompt response very much appreciated.