fix: don't filter min duration on > 0

closes #11838
This commit is contained in:
Matthias
2025-06-08 09:15:52 +02:00
parent f2569e36e8
commit 5b9c03e7e2

View File

@@ -347,7 +347,7 @@ def generate_trading_stats(results: DataFrame) -> dict[str, Any]:
else timedelta()
)
winner_holding_min = (
timedelta(minutes=round(winning_duration[winning_duration > 0].min()))
timedelta(minutes=round(winning_duration.min()))
if not winning_duration.empty
else timedelta()
)
@@ -362,7 +362,7 @@ def generate_trading_stats(results: DataFrame) -> dict[str, Any]:
else timedelta()
)
loser_holding_min = (
timedelta(minutes=round(losing_duration[losing_duration > 0].min()))
timedelta(minutes=round(losing_duration.min()))
if not losing_duration.empty
else timedelta()
)