Set the benchmark asset. Parameters ---------- benchmark : zipline.assets.Asset The asset to set as the new benchmark. Notes ----- Any dividends payed out for that new benchmark asset will be automatically reinvested.
(self, benchmark)
| 987 | |
| 988 | @api_method |
| 989 | def set_benchmark(self, benchmark): |
| 990 | """Set the benchmark asset. |
| 991 | |
| 992 | Parameters |
| 993 | ---------- |
| 994 | benchmark : zipline.assets.Asset |
| 995 | The asset to set as the new benchmark. |
| 996 | |
| 997 | Notes |
| 998 | ----- |
| 999 | Any dividends payed out for that new benchmark asset will be |
| 1000 | automatically reinvested. |
| 1001 | """ |
| 1002 | if self.initialized: |
| 1003 | raise SetBenchmarkOutsideInitialize() |
| 1004 | |
| 1005 | self.benchmark_sid = benchmark |
| 1006 | |
| 1007 | @api_method |
| 1008 | @preprocess(root_symbol_str=ensure_upper_case) |