'Fail if the leverage is greater than the allowed leverage.'

def validate(self, _portfolio, _account, _algo_datetime, _algo_current_data):

    if (_account.leverage > self.max_leverage):
        self.fail()
