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

Method continuous_future

zipline/algorithm.py:1009–1041  ·  view source on GitHub ↗

Create a specifier for a continuous contract. Parameters ---------- root_symbol_str : str The root symbol for the future chain. offset : int, optional The distance from the primary contract. Default is 0. roll_style : str, optional

(self,
                          root_symbol_str,
                          offset=0,
                          roll='volume',
                          adjustment='mul')

Source from the content-addressed store, hash-verified

1007 @api_method
1008 @preprocess(root_symbol_str=ensure_upper_case)
1009 def continuous_future(self,
1010 root_symbol_str,
1011 offset=0,
1012 roll='volume',
1013 adjustment='mul'):
1014 """Create a specifier for a continuous contract.
1015
1016 Parameters
1017 ----------
1018 root_symbol_str : str
1019 The root symbol for the future chain.
1020
1021 offset : int, optional
1022 The distance from the primary contract. Default is 0.
1023
1024 roll_style : str, optional
1025 How rolls are determined. Default is 'volume'.
1026
1027 adjustment : str, optional
1028 Method for adjusting lookback prices between rolls. Options are
1029 'mul', 'add', and None. Default is 'mul'.
1030
1031 Returns
1032 -------
1033 continuous_future : zipline.assets.ContinuousFuture
1034 The continuous future specifier.
1035 """
1036 return self.asset_finder.create_continuous_future(
1037 root_symbol_str,
1038 offset,
1039 roll,
1040 adjustment,
1041 )
1042
1043 @api_method
1044 @preprocess(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected