|
@@ -62,7 +62,7 @@ class PerformanceCalculator:
|
|
|
total_entry_volume = 0.0
|
|
|
total_exit_volume = 0.0
|
|
|
largest_win = 0.0
|
|
|
- largest_loss = float('-inf') # Initialize to negative infinity
|
|
|
+ largest_loss = 0.0 # Initialize to 0
|
|
|
largest_win_token = "N/A"
|
|
|
largest_loss_token = "N/A"
|
|
|
largest_win_pct = 0.0
|
|
@@ -96,7 +96,7 @@ class PerformanceCalculator:
|
|
|
largest_win_pct = (token_largest_win / token.get('largest_winning_cycle_entry_volume', 1)) * 100
|
|
|
|
|
|
# For losses, we want the most negative number
|
|
|
- if token_largest_loss < largest_loss:
|
|
|
+ if token_largest_loss < 0 and (largest_loss == 0 or token_largest_loss < largest_loss):
|
|
|
largest_loss = token_largest_loss
|
|
|
largest_loss_token = token['token']
|
|
|
largest_loss_pct = (token_largest_loss / token.get('largest_losing_cycle_entry_volume', 1)) * 100
|