def sum_value(values, period=None):
    """Returns the final sum.

    :param values: list of values to iterate.
    :param period: (optional) # of values to include in computation.
        * None - includes all values in computation.
    :rtype: the final sum.

    Examples:
    >>> values = [34, 30, 29, 34, 38, 25, 35]
    >>> result = sum_value(values, 3)  #using 3 period window.
    >>> print "%.2f" % result
    98.00
    """
    if not values:
        return None

    maxbar = len(values)

    beg = 0
    if period:
        if period < 1:
            raise ValueError("period must be 1 or greater")

        beg = maxbar - int(period)
        if beg < 0:
            beg = 0

    return sum(values[beg:])