Merge branch 'develop' into mypy_typecheck

This commit is contained in:
xmatthias
2018-06-03 10:35:56 +02:00
15 changed files with 140 additions and 59 deletions

View File

@@ -103,7 +103,12 @@ def load_data(datadir: str,
if pairdata:
result[pair] = pairdata
else:
logger.warn('No data for pair %s, use --update-pairs-cached to download the data', pair)
logger.warning(
'No data for pair: "%s", Interval: %s. '
'Use --refresh-pairs-cached to download the data',
pair,
ticker_interval
)
return result

View File

@@ -94,7 +94,7 @@ class Backtesting(object):
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, tablefmt="pipe")
def _get_sell_trade_entry(
self, pair: str, buy_row: DataFrame,

View File

@@ -455,6 +455,7 @@ class Hyperopt(Backtesting):
if trade_count == 0 or trade_duration > self.max_accepted_trade_duration:
print('.', end='')
sys.stdout.flush()
return {
'status': STATUS_FAIL,
'loss': float('inf')
@@ -479,16 +480,16 @@ class Hyperopt(Backtesting):
'result': result_explanation,
}
@staticmethod
def format_results(results: DataFrame) -> str:
def format_results(self, results: DataFrame) -> str:
"""
Return the format result in a string
"""
return ('{:6d} trades. Avg profit {: 5.2f}%. '
'Total profit {: 11.8f} BTC ({:.4f}Σ%). Avg duration {:5.1f} mins.').format(
'Total profit {: 11.8f} {} ({:.4f}Σ%). Avg duration {:5.1f} mins.').format(
len(results.index),
results.profit_percent.mean() * 100.0,
results.profit_BTC.sum(),
self.config['stake_currency'],
results.profit_percent.sum(),
results.duration.mean(),
)