Skip to content

Commit

Permalink
[Community] handle None max values
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Nov 26, 2024
1 parent 05f0248 commit 20596fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions octobot/community/models/strategy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ def _get_max(self):
max_unit = next(iter(self.reference_market_profitability))
max_value = self.reference_market_profitability[max_unit]
for unit, value in self.reference_market_profitability.items():
if value is None:
continue
if max_value is None:
max_value = value
if value > max_value:
max_unit = unit
max_value = value
if max_value is None:
max_value = 0
return max_value, max_unit

def get_max_value(self):
Expand Down

0 comments on commit 20596fb

Please sign in to comment.