Skip to content

Commit

Permalink
Merge pull request #2733 from Drakkar-Software/dev
Browse files Browse the repository at this point in the history
[Community] fix profit upload on multi exchange
  • Loading branch information
GuillaumeDSM authored Aug 27, 2024
2 parents 4765579 + 521ebde commit b034427
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 b034427

Please sign in to comment.