Exemplo n.º 1
0
def __dollar_bars(data, units):
    # Dollar metric
    data['CumDollars'] = data['Transaction'].cumsum()
    col_names = data.columns

    # Set the relevant group for each row
    data = cython_loops.set_row_groups(units, np.array(data))
    data = pd.DataFrame(data, columns=col_names)
    data = __extract_data(data)

    return data
Exemplo n.º 2
0
def __volume_bars(data, units):
    # Volume metric
    data['CumVol'] = data['Volume'].cumsum()
    col_names = data.columns

    # Set the relevant group for each row
    data = cython_loops.set_row_groups(units, np.array(data))
    data = pd.DataFrame(data, columns=col_names)
    data = __extract_data(data)

    # Todo: Add 1/50 of the daily traded volume
    return data