From 1a24afef7775bc238cd0159c035e9db695c7a10a Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Jul 2018 19:55:04 +0200 Subject: [PATCH] add cumsum to backtest-results --- freqtrade/optimize/backtesting.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 16c21258f..56d9e3c63 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -88,9 +88,9 @@ class Backtesting(object): """ stake_currency = str(self.config.get('stake_currency')) - floatfmt = ('s', 'd', '.2f', '.8f', '.1f') + floatfmt = ('s', 'd', '.2f', '.2f', '.8f', '.1f') tabular_data = [] - headers = ['pair', 'buy count', 'avg profit %', + headers = ['pair', 'buy count', 'avg profit %', 'cum profit %', 'total profit ' + stake_currency, 'avg duration', 'profit', 'loss'] for pair in data: result = results[results.pair == pair] @@ -98,6 +98,7 @@ class Backtesting(object): pair, len(result.index), result.profit_percent.mean() * 100.0, + result.profit_percent.sum() * 100.0, result.profit_abs.sum(), result.trade_duration.mean(), len(result[result.profit_abs > 0]), @@ -109,6 +110,7 @@ class Backtesting(object): 'TOTAL', len(results.index), results.profit_percent.mean() * 100.0, + result.profit_percent.sum() * 100.0, results.profit_abs.sum(), results.trade_duration.mean(), len(results[results.profit_abs > 0]),