Thanks Alan -
Your "B" above might be the preferred approach, but my understanding is that Pipeline does not neatly support output of a trailing window of values (if I'm wrong, someone please correct me). One can only output a Pandas DataFrame with row labels corresponding to the current universe, and column labels applied within Pipeline. I suppose one could create a column for each trailing day. For example, for 2 alpha factors and 5 days, I would have columns with labels:
alpha00, alpha01, alpha02, alpha03, alpha04,
alpha10, alpha11, alpha12, alpha13, alpha14
In a similar fashion, I would add columns for returns:
ret00, ret01, ret02, ret03, ret04,
ret10, ret11, ret12, ret13, ret14
Then, in before_trading_start
I would do the alpha combination. Alternatively, the alpha combination step could be postponed until during the trading day, if it could be done within ~50 seconds, and it were advantageous (e.g. generally, the alpha combination computation could include mid-day minutely OHLCV data).
This seems workable (and would seem to be the only data structure supported by Pandas anyway, since Pandas Panel has been deprecated...although I see that the non-Pandas xarray has developed an alternative).
Doing the potentially computationally expensive alpha combination within before_trading_start
(with a full 5 minutes allocated per day) would seem to be the way to go, versus the chunked computations within Pipeline, over a 10 minute limit (where, for back testing, one gets nowhere near 5 minutes per trading day for computations).
Another potential approach would be to create a separate Pipeline for each trailing day, but this seems very awkward, and my understanding is that one could bump into overhead issues, since each Pipeline runs independently with respect to fetching chunks of data (I think).