I'd like to be able to drop all missing bars (for which no trade data exists) for a set of stocks. I've attached be beginnings of an algorithm, using the batch transform to return minutely data:
@batch_transform(refresh_period=R_P, window_length=W_L, clean_nans=False) # set globals R_P & W_L above
def get_data(datapanel,sids):
p = datapanel['price']
v = datapanel['volume']
return [p,v]
I want to effectively create price and volume vectors for each security, with no NaNs in the vectors. The vectors could be of unequal length.
Any ideas on how to best handle this? I could write a bunch of code to manage it, but perhaps there is an elegant solution with pandas.
Grant