This commit is contained in:
MoonGem 2018-03-26 23:29:22 -05:00 committed by GitHub
parent f011ac19ab
commit ec535fe4f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,24 +73,14 @@ class Backtesting(object):
""" """
stake_currency = self.config.get('stake_currency') stake_currency = self.config.get('stake_currency')
floatfmt = ('.8f', '.8f', '.8f', '.8f', '.8f') floatfmt = ('.8f', '.8f', '.8f', '.8f', '.1f')
tabular_data = [] tabular_data = []
headers = ['total profit '] headers = ['total profit ' + stake_currency]
for pair in data:
result = results[results.currency == pair]
tabular_data.append([
result.profit_BTC.sum(),
])
# Append Total # Append Total
tabular_data.append([ tabular_data.append([
'TOTAL', 'TOTAL',
len(results.index),
results.profit_percent.mean() * 100.0,
results.profit_BTC.sum(), results.profit_BTC.sum(),
results.duration.mean(),
len(results[results.profit_BTC > 0]),
len(results[results.profit_BTC < 0])
]) ])
return tabulate(tabular_data, headers=headers, floatfmt=floatfmt) return tabulate(tabular_data, headers=headers, floatfmt=floatfmt)
@ -255,7 +245,7 @@ class Backtesting(object):
'record': self.config.get('export') 'record': self.config.get('export')
} }
) )
logger.info( print(
'\n==================================== ' '\n==================================== '
'BACKTESTING REPORT' 'BACKTESTING REPORT'
' ====================================\n' ' ====================================\n'