'Compute the expected data (without adjustments) for the given
window, k, and closes array.
This uses talib.BBANDS to generate the expected data.'

def expected_bbands(self, window_length, k, closes):

    lower_cols = []
    middle_cols = []
    upper_cols = []
    (ndates, nassets) = closes.shape
    for n in range(nassets):
        close_col = closes[:, n]
        if np.isnan(close_col).all():
            (upper, middle, lower) = ([np.full(ndates, np.nan)] * 3)
        else:
            (upper, middle, lower) = talib.BBANDS(close_col, window_length, k, k)
        upper_cols.append(upper)
        middle_cols.append(middle)
        lower_cols.append(lower)
    where = np.s_[(window_length - 1):]
    uppers = np.column_stack(upper_cols)[where]
    middles = np.column_stack(middle_cols)[where]
    lowers = np.column_stack(lower_cols)[where]
    return (uppers, middles, lowers)
