コード例 #1
0
def monthly(funds):
    funds2 = []
    years = dateutil.getYears(funds)
    for year in years:
        months = dateutil.getMonths(funds, year)
        for month in months:
            funds2.append(funds[dateutil.getFirstDay(funds, year, month)])
    return daily(funds2)
コード例 #2
0
def monthly(funds):
    funds2 = []
    years = dateutil.getYears(funds)
    for year in years:
        months = dateutil.getMonths(funds, year)
        for month in months:
            funds2.append(funds[dateutil.getFirstDay(funds, year, month)])
    return (daily(funds2))
コード例 #3
0
def averageMonthly(funds):
    rets = daily(funds)
    x = 0
    years = dateutil.getYears(funds)
    averages = []
    for year in years:
        months = dateutil.getMonths(funds, year)
        for month in months:
            avg = 0
            count = 0
            days = dateutil.getDays(funds, year, month)
            for day in days:
                avg += rets[x]
                x += 1
                count += 1
            averages.append(float(avg) / count)
    return averages
コード例 #4
0
def averageMonthly(funds):
    rets = daily(funds)
    x = 0
    years = dateutil.getYears(funds)
    averages = []
    for year in years:
        months = dateutil.getMonths(funds, year)
        for month in months:
            avg = 0
            count = 0
            days = dateutil.getDays(funds, year, month)
            for day in days:
                avg += rets[x]
                x += 1
                count += 1
            averages.append(float(avg) / count)
    return (averages)