Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
how to get pipeline to output a log returns matrix for Markowitz optimization?

There was a great post by Thomas Wiecki about how to do a Markowitz optimization here:https://www.quantopian.com/posts/the-efficient-frontier-markowitz-portfolio-optimization-using-cvxopt-repost-cloning-of-nb-now-enabled

But the "addhistory" part of that is no longer supported on quantopian, so I tried using pipeline instead. It needs a matrix of log returns to compute the covariance, i.e.
stock1 stock 2 stock 3 ...
today 0.001 0.003 0.002
1 day ago 0.001 0.003 0.002
2 days ago 0.001 0.003 0.002
... ... ... ...

But I cant figure out how to get Pipeline to give such a thing. It seems to only want to give
stock1 stock 2 stock 3 ...
today 0.001 0.003 0.002

any suggestions?

Thanks!