Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Up/down side volume

Is there a way to obtain the volume ratio to determine if it was up or down side for a specific equity or futures?

Thanks

2 responses

Me to, same demand :)

i found a "Volume Ratio" solution :

data.loc[data.index[:20], 'Volume Ratio'] = 0
data.loc[data.index[20:], 'Volume Ratio'] = (data.loc[:20:, 'acend'].rolling(window=20).sum() / (data.loc[:20:, 'Volume'].rolling(window=20).sum() - data.loc[:20:, 'acend'].rolling(window=20).sum()) * 100

from https://stackoverflow.com/questions/37523730/how-to-more-efficiently-calculate-a-rolling-ratio/37524739#37524739

and I'm looking to study what's a Pipeline from document page one ...