Hello Thomas,
Thanks for your tips. Attached, please find an update to my "multi-sid batch transform moving average" effort. I'm trying to sort out what these functions return and why I'd want to use one of them versus returning a vector of the average sid prices:
@batch_transform(refresh_period=R_P, window_length=W_L)
def get_avgs_3(datapanel, sids):
return datapanel.price.mean()
@batch_transform(refresh_period=R_P, window_length=W_L)
def get_avgs_4(datapanel):
avgs = np.average(datapanel.price.values, axis=0)
return pd.Series(avgs, index=datapanel.minor_axis)
As I mentioned above, once I get the basic framework down for doing the moving average via the batch transform, I plan to add weights.
Also, I'm still sorta confused about the Quantopian thinking regarding moving averages and the batch transform. It seems that the trailing window length is not actually a fixed number of ticks under the full/minutely backtest.