Don't use profit_percent for backtesting results anymore

This commit is contained in:
Matthias
2021-01-23 13:02:48 +01:00
parent 48977493bb
commit 8ee264bc59
17 changed files with 78 additions and 101 deletions

View File

@@ -39,8 +39,8 @@ class SampleHyperOptLoss(IHyperOptLoss):
"""
Objective function, returns smaller number for better results
"""
total_profit = results.profit_percent.sum()
trade_duration = results.trade_duration.mean()
total_profit = results['profit_ratio'].sum()
trade_duration = results['trade_duration'].mean()
trade_loss = 1 - 0.25 * exp(-(trade_count - TARGET_TRADES) ** 2 / 10 ** 5.8)
profit_loss = max(0, 1 - total_profit / EXPECTED_MAX_PROFIT)