def percentOfOutperformedMonths(tradingRets, tsRets):
    monthlyTrating = tradingRets.resample('M').apply(logCumSum)
    monthlyMkt = tsRets.resample('M', how=logCumSum)
    numOutperform = 0
    for i in range(len(monthlyMkt)):
        if (monthlyTrating[i] > monthlyMkt[i]):
            numOutperform += 1
    return (100 * ((1.0 * numOutperform) / len(monthlyMkt)))
def percentOfOutperformedMonths(tradingRets, tsRets):
    monthlyTrating = tradingRets.resample('M').apply(logCumSum)
    monthlyMkt = tsRets.resample('M', how=logCumSum)
    numOutperform = 0
    for i in range(len(monthlyMkt)):
        if (monthlyTrating[i] > monthlyMkt[i]):
            numOutperform += 1
    return (100 * ((1.0 * numOutperform) / len(monthlyMkt)))