Back to Community
Computing Excess Returns (relative to SPY) in Pipeline

I would like to use excess returns (relative to the market) in my pipeline. I compute returns for each ticker similar to the very first tutorial using 'al.utils.compute_forward_returns'. Is it possible to add a column with the returns for SPY for each row, over the same time period? Then I could just take the difference between the two columns.

2 responses

This is close to what I had in mind, but I am actually looking to get the forward looking returns for my notebook (not the trading IDE), so the compute forward returns is probably necessary.