Sum volume of advancing stocks

I am making custom breadth indicators for some tickers on a watchlist. Althought i've managed to get advances, decliners, new highs..., i'm still not able to get the sum of the volumes of all advancing stocks for each day, and the same for the declining ones, and i haven't fin any help on the internet. Do you have any ideas?. Thanks.