MCPcopy Create free account
hub / github.com/quantopian/zipline / set_benchmark

Method set_benchmark

zipline/algorithm.py:989–1005  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)

Callers 2

initializeMethod · 0.80
initializeMethod · 0.80

Calls 1

Tested by 2

initializeMethod · 0.64
initializeMethod · 0.64