def _add_ret_distribution_and_similarity(self): grid = GridElement(mode=PlottingMode.PDF, figsize=self.half_image_size, dpi=self.dpi) title = "Distribution of Monthly Returns - Strategy" chart_strategy = create_returns_distribution(self.strategy_series, title=title) grid.add_chart(chart_strategy) chart = RegressionChart(self.benchmark_series, self.strategy_series) grid.add_chart(chart) title = "Distribution of Monthly Returns - Benchmark" chart_benchmark = create_returns_distribution(self.benchmark_series, title=title) grid.add_chart(chart_benchmark) chart = RegressionChart(self.strategy_series, self.benchmark_series) grid.add_chart(chart) # put the same x axis range on both histograms min_x = min( [chart_strategy.series.min(), chart_benchmark.series.min()]) max_x = max( [chart_strategy.series.max(), chart_benchmark.series.max()]) chart_strategy.set_x_range(min_x, max_x) chart_benchmark.set_x_range(min_x, max_x) self.document.add_element(grid)
def _add_ret_distribution_and_similarity(self): grid = GridElement(mode=PlottingMode.PDF, figsize=self.half_image_size, dpi=self.dpi) # Distribution of Monthly Returns chart = create_returns_distribution(self.strategy_series) grid.add_chart(chart) # Regression chart chart = RegressionChart(self.benchmark_series, self.strategy_series) grid.add_chart(chart) # Distribution of Monthly Returns chart = create_returns_distribution(self.benchmark_series) grid.add_chart(chart) # Regression chart chart = RegressionChart(self.strategy_series, self.benchmark_series) grid.add_chart(chart) self.document.add_element(grid)
def _add_ret_distribution_and_qq(self): grid = GridElement(mode=PlottingMode.PDF, figsize=self.half_image_size, dpi=self.dpi) # Distribution of Monthly Returns chart = create_returns_distribution(self.strategy_series) grid.add_chart(chart) # QQ chart chart = create_qq_chart(self.strategy_series) grid.add_chart(chart) self.document.add_element(grid)