'Set a limit on the maximum leverage of the algorithm.
Parameters
max_leverage : float
The maximum leverage for the algorithm. If not provided there will
be no maximum.'

@api_method
def set_max_leverage(self, max_leverage):

    control = MaxLeverage(max_leverage)
    self.register_account_control(control)
