From 8d5da4e6ad9ffc93b7ea0b9c6b49cbfa4406ce56 Mon Sep 17 00:00:00 2001 From: creslinux Date: Mon, 16 Jul 2018 17:48:11 +0000 Subject: [PATCH] changed defaults Seperated save trades and print trades options. --- freqtrade/optimize/backtesting.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 85e42b91a..43e05d70b 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -101,7 +101,8 @@ class Backtesting(object): self.debug_vector = False # Debug vector calcs self.debug_timing_main_loop = False # print overall timing per pair - works in Backtest and Backslap - self.backslap_show_trades = True #prints trades in addition to summary report, also saves to backslap.txt + self.backslap_show_trades = False # prints trades in addition to summary report + self.backslap_save_trades = True # saves trades as a pretty table to backslap.txt @staticmethod @@ -1055,17 +1056,25 @@ class Backtesting(object): results ) ) + #optional print trades if self.backslap_show_trades: TradesFrame = results.filter(['open_time', 'pair', 'exit_type', 'profit_percent', 'profit_abs', 'buy_spend', 'sell_take', 'trade_duration', 'close_time'], axis=1) - def to_fwf(df, fname): content = tabulate(df.values.tolist(), list(df.columns), floatfmt=".8f", tablefmt='psql') print(content) - open(fname, "w").write(content) DataFrame.to_fwf = to_fwf(TradesFrame, "backslap.txt") + #optional save trades + if self.backslap_save_trades: + TradesFrame = results.filter(['open_time', 'pair', 'exit_type', 'profit_percent', 'profit_abs', + 'buy_spend', 'sell_take', 'trade_duration', 'close_time'], axis=1) + def to_fwf(df, fname): + content = tabulate(df.values.tolist(), list(df.columns), floatfmt=".8f", tablefmt='psql') + open(fname, "w").write(content) + DataFrame.to_fwf = to_fwf(TradesFrame, "backslap.txt") + else: logger.info( '\n================================================= '