def on_parameters_updated

This lifecycle method gets called when the strategy’s parameters were updated using the self.update_parameters() function

class MyStrategy(Strategy):
    def on_parameters_updated(self, parameters):
        # Do this when the parameters are updated
        self.log_message("Parameters updated")
        self.log_message(parameters)

Reference

lumibot.strategies.strategy.Strategy.on_parameters_updated(self, parameters)

Use this lifecycle event to execute code when the parameters are updated.

Parameters:

parameters (dict) – The parameters that are being updated.

Return type:

None

Example

>>> def on_parameters_updated(self, parameters):
>>>     self.log_message(f"Parameters updated: {parameters}")