diff --git a/src/StockBench/controllers/charting/multi/multi_charting_engine.py b/src/StockBench/controllers/charting/multi/multi_charting_engine.py index 2d3f0bf..a9559d8 100644 --- a/src/StockBench/controllers/charting/multi/multi_charting_engine.py +++ b/src/StockBench/controllers/charting/multi/multi_charting_engine.py @@ -36,9 +36,10 @@ def build_multi_overview_chart(self, results: List[dict], initial_balance: float subplot_titles=chart_titles) fig.add_trace(MultiChartingEngine.__build_overview_profit_loss_bar_subplot(results), row=1, col=1) - fig.add_trace(MultiChartingEngine.__overview_avg_effectiveness_gauge_subplot(results), row=1, col=2) + fig.add_trace(MultiChartingEngine.__build_overview_avg_effectiveness_gauge_subplot(results), row=1, col=2) fig.add_trace(MultiChartingEngine.__build_overview_trades_made_bar_subplot(results), row=2, col=1) - fig.add_trace(MultiChartingEngine.__overview_avg_profit_loss_gauge(results, initial_balance), row=2, col=2) + fig.add_trace(MultiChartingEngine.__build_overview_avg_profit_loss_gauge_subplot(results, initial_balance), + row=2, col=2) fig.update_layout(template=self.PLOTLY_THEME, title=f'Simulation Results for {len(results)} Symbols', xaxis_rangeslider_visible=False, showlegend=False) @@ -62,10 +63,12 @@ def __build_overview_profit_loss_bar_subplot(results: List[dict]) -> Bar: return plotter.Bar( x=MultiChartingEngine.__get_symbols_from_results(results), y=MultiChartingEngine.__get_total_pl_per_symbol_from_results(results), - marker_color=color_df['colors']) + marker_color=color_df['colors'], # noqa + name='PL' + ) @staticmethod - def __overview_avg_effectiveness_gauge_subplot(results: List[dict]) -> Indicator: + def __build_overview_avg_effectiveness_gauge_subplot(results: List[dict]) -> Indicator: """Builds an overview average effectiveness gauge subplot.""" indicator_value = MultiChartingEngine.__calculate_avg_effectiveness_from_results(results) @@ -84,7 +87,7 @@ def __overview_avg_effectiveness_gauge_subplot(results: List[dict]) -> Indicator {'range': [50, 100], 'color': PLOTLY_DARK_BACKGROUND}]}) @staticmethod - def __overview_avg_profit_loss_gauge(results: List[dict], initial_balance: float) -> Indicator: + def __build_overview_avg_profit_loss_gauge_subplot(results: List[dict], initial_balance: float) -> Indicator: """Builds an overview average profit/loss gauge subplot.""" indicator_value = MultiChartingEngine.__calculate_avg_pl_from_results(results) upper_bound = initial_balance @@ -110,7 +113,9 @@ def __build_overview_trades_made_bar_subplot(results: List[dict]) -> Bar: return plotter.Bar( x=MultiChartingEngine.__get_symbols_from_results(results), y=MultiChartingEngine.__get_trades_made_per_symbol_from_results(results), - marker=dict(color=OFF_BLUE)) + marker=dict(color=OFF_BLUE), + name='Trades made' + ) @staticmethod def __get_symbols_from_results(results: List[dict]) -> list: