Summary's largest loss can no longer be negative

This commit is contained in:
Javier Rodríguez Chatruc
2020-01-23 17:50:14 -03:00
parent d6783a5fc0
commit bc3b4729af
+1 -1
View File
@@ -182,7 +182,7 @@ class Backtest:
win_number = np.sum(wins)
loss_number = total_trades - win_number
win_pct = (win_number / total_trades) * 100
largest_loss = np.max(costs)
largest_loss = max(0, np.max(costs))
avg_profit = np.mean(-costs)
avg_pl = np.mean(daily_returns)
total_pl = (df['totals']['capital'].iloc[-1] / self._strategy.initial_capital) * 100