'Returns the next parameters to use in a backtest.
If there are no more parameters to try then an empty list is returned.
:param count: The max number of parameters to return.
:type count: int
:rtype: list of Parameters.'

def getNext(self, count):

    assert (count > 0), 'Invalid    number    of    parameters'
    ret = []
    with self.__lock:
        if (self.__iter is not None):
            try:
                while (count > 0):
                    params = self.__iter.next()
                    if (not isinstance(params, Parameters)):
                        params = Parameters(*params)
                    ret.append(params)
                    count -= 1
            except StopIteration:
                self.__iter = None
    return ret
