|
|
|
|
@ -540,8 +540,8 @@ class RPC:
|
|
|
|
|
fiat_display_currency
|
|
|
|
|
) if self._fiat_converter else 0
|
|
|
|
|
|
|
|
|
|
first_date = trades[0].open_date if trades else None
|
|
|
|
|
last_date = trades[-1].open_date if trades else None
|
|
|
|
|
first_date = trades[0].open_date_utc if trades else None
|
|
|
|
|
last_date = trades[-1].open_date_utc if trades else None
|
|
|
|
|
num = float(len(durations) or 1)
|
|
|
|
|
bot_start = KeyValueStore.get_datetime_value(KeyStoreKeys.BOT_START_TIME)
|
|
|
|
|
return {
|
|
|
|
|
@ -563,9 +563,11 @@ class RPC:
|
|
|
|
|
'profit_all_fiat': profit_all_fiat,
|
|
|
|
|
'trade_count': len(trades),
|
|
|
|
|
'closed_trade_count': len([t for t in trades if not t.is_open]),
|
|
|
|
|
'first_trade_date': arrow.get(first_date).humanize() if first_date else '',
|
|
|
|
|
'first_trade_date': first_date.strftime(DATETIME_PRINT_FORMAT) if first_date else '',
|
|
|
|
|
'first_trade_humanized': arrow.get(first_date).humanize() if first_date else '',
|
|
|
|
|
'first_trade_timestamp': int(first_date.timestamp() * 1000) if first_date else 0,
|
|
|
|
|
'latest_trade_date': arrow.get(last_date).humanize() if last_date else '',
|
|
|
|
|
'latest_trade_date': last_date.strftime(DATETIME_PRINT_FORMAT) if last_date else '',
|
|
|
|
|
'latest_trade_humanized': arrow.get(last_date).humanize() if last_date else '',
|
|
|
|
|
'latest_trade_timestamp': int(last_date.timestamp() * 1000) if last_date else 0,
|
|
|
|
|
'avg_duration': str(timedelta(seconds=sum(durations) / num)).split('.')[0],
|
|
|
|
|
'best_pair': best_pair[0] if best_pair else '',
|
|
|
|
|
|