create_rolling_chart¶
-
qf_lib.plotting.helpers.create_rolling_chart.
create_rolling_chart
(series: Union[qf_lib.containers.series.qf_series.QFSeries, List[qf_lib.containers.series.qf_series.QFSeries]], func: Callable[[Union[qf_lib.containers.series.qf_series.QFSeries, numpy.ndarray]], float], func_name: str, window_size: int = 126, step: int = 20, oos_date: str = None) → qf_lib.plotting.charts.line_chart.LineChart[source]¶ Creates a new line chart and adds the rolling window for each of the specified series to it. The func function is fed data for each window and whatever it returns is added to the resulting rolled series.
For example:
- Parameters
series (QFSeries, List[QFSeries]) – One or more series to apply the rolling window transformation on add to the resulting chart.
func (Callable[[Union[QFSeries, numpy.ndarray]], float]) – Called for each window. Takes one argument which is part of a series corresponding to a window. Returns a float.
func_name (str) – Used in the title to specify the function that was called.
window_size (int) –
step (int) –
oos_date (str) – only the OOS date of the first series in the list will be taken into account
- Returns
- Return type