Skip to content

Commit

Permalink
[Community] fix profit upload on multi exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Aug 27, 2024
1 parent 4d5dc0c commit 521ebde
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions octobot/community/community_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit 521ebde

Please sign in to comment.