def generate_report(funds_list, graph_names, out_file, i_start_cash = 10000):
    html_file  =  open("report.html","w")
    print_header(html_file, out_file)
    html_file.write("<IMG SRC = \'./funds.png\' width = 400/>\n")
    html_file.write("<BR/>\n\n")
    i = 0
    pyplot.clf()
    #load spx for time frame
    symbol = ["$SPX"]
    start_date = 0
    end_date = 0
    for fund in funds_list:
        if(type(fund)!= type(list())):
            if(start_date == 0 or start_date>fund.index[0]):
                start_date = fund.index[0]
            if(end_date == 0 or end_date<fund.index[-1]):
                end_date = fund.index[-1]
            mult = i_start_cash/fund.values[0]
            pyplot.plot(fund.index, fund.values * mult, label = \
                                 path.basename(graph_names[i]))
        else:
            if(start_date == 0 or start_date>fund[0].index[0]):
                start_date = fund[0].index[0]
            if(end_date == 0 or end_date<fund[0].index[-1]):
                end_date = fund[0].index[-1]
            mult = i_start_cash/fund[0].values[0]
            pyplot.plot(fund[0].index, fund[0].values * mult, label = \
                                      path.basename(graph_names[i]))
        i += 1
    timeofday = dt.timedelta(hours = 16)
    timestamps = du.getNYSEdays(start_date, end_date, timeofday)
    dataobj = de.DataAccess('mysql')
    benchmark_close = dataobj.get_data(timestamps, symbol, ["close"], \
                                            verbose = False)[0]
    mult = i_start_cash/benchmark_close.values[0]
    i = 0
    for fund in funds_list:
        if(type(fund)!= type(list())):
            print_stats(fund, ["$SPX"], graph_names[i])
        else:
            print_stats( fund[0], ["$SPX"], graph_names[i])
        i += 1
    pyplot.plot(benchmark_close.index, \
                 benchmark_close.values*mult, label = "SSPX")
    pyplot.ylabel('Fund Value')
    pyplot.xlabel('Date')
    pyplot.legend()
    savefig('funds.png', format = 'png')
    print_footer(html_file)
@summary generates a report given a list of fund time series
dataset/ETHPy150Open tucker777/QSTK/Bin/report.py/generate_report