From 521ebde790845fe0f734eb8af35b61b0c6c423ae Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Tue, 27 Aug 2024 16:58:34 +0200 Subject: [PATCH] [Community] fix profit upload on multi exchange --- octobot/community/community_manager.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/octobot/community/community_manager.py b/octobot/community/community_manager.py index 1c227c8d0..bf7a7e0b8 100644 --- a/octobot/community/community_manager.py +++ b/octobot/community/community_manager.py @@ -195,11 +195,12 @@ def _get_profitability(self): total_profitability = 0 for exchange_manager in self.exchange_managers: - profitability, _, _, _, _ = trading_api.get_profitability_stats(exchange_manager) - total_profitability += float(profitability) - total_origin_values += float(trading_api.get_origin_portfolio_value(exchange_manager)) + if trading_api.is_exchange_trading(exchange_manager): + profitability, _, _, _, _ = trading_api.get_profitability_stats(exchange_manager) + total_profitability += float(profitability) + total_origin_values += float(trading_api.get_origin_portfolio_value(exchange_manager)) - return total_profitability * 100 / total_origin_values if total_origin_values > 0 else 0 + return (total_profitability * 100 / total_origin_values) if total_origin_values > 0 else 0 def _get_traded_volumes(self): volume_by_currency = {}