Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Benchmark performance does not take % invested in account

I was looking at at the benchmark performance and why a simple buy and hold would be better while I know my algorithm would at least in a bull market overperform.

Then I discovered my algorithm was only invested 50% of the time and the SPY benchmark is invested 100% of the time for the full amount. I would be great to be able to adjust the benchmark to follow the invested dollars, or at least have the option.... any opinions?

PB

1 response

Hello Peter,

It would be interesting to be able to define the benchmark as a buy-and-hold portfolio rather than as a single security. On the surface, this would seem to be a trivial change, such as:

set_benchmark(sids, weights)  

The sids parameter would be a list of securities making up the benchmark portfolio, and weights would be the fixed buy-and-hold weightings.

In your case, you could use SPY plus an ETF that is a proxy for cash, in 50/50 proportion, or just set SPY as the single benchmark, but apply a weight of 0.5.

Grant