Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Daily historical portfolio returns as a signal

Hello all,

What I am trying to do is to look at the last x days of trading for my algo and lever/un-lever based on the recent returns.

Does anyone know a way to get the historical daily portfolio returns in the backtester?

Best,
Georges

1 response

there probably is, but i just log it myself.

try:  
    context.hist.append(roi)  
except:  
    context.hist = [roi]