Use pct instead of _perc

This commit is contained in:
Matthias 2020-05-26 19:25:03 +02:00
parent 18d2587800
commit 3e3cce4559
5 changed files with 12 additions and 12 deletions

View File

@ -136,10 +136,10 @@ class RPC:
trade_dict.update(dict(
base_currency=self._freqtrade.config['stake_currency'],
close_profit=trade.close_profit or None,
close_profit_perc=fmt_close_profit,
close_profit_pct=fmt_close_profit,
current_rate=current_rate,
current_profit=current_profit,
current_profit_perc=round(current_profit * 100, 2),
current_profit_pct=round(current_profit * 100, 2),
open_order='({} {} rem={:.8f})'.format(
order['type'], order['side'], order['remaining']
) if order else None,

View File

@ -215,8 +215,8 @@ class Telegram(RPC):
"*Open Rate:* `{open_rate:.8f}`",
"*Close Rate:* `{close_rate}`" if r['close_rate'] else "",
"*Current Rate:* `{current_rate:.8f}`",
"*Close Profit:* `{close_profit_perc}`" if r['close_profit_perc'] else "",
"*Current Profit:* `{current_profit_perc:.2f}%`",
"*Close Profit:* `{close_profit_pct}`" if r['close_profit_pct'] else "",
"*Current Profit:* `{current_profit_pct:.2f}%`",
# Adding initial stoploss only if it is different from stoploss
"*Initial Stoploss:* `{initial_stop_loss:.8f}` " +

View File

@ -76,9 +76,9 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'amount': 91.07468124,
'stake_amount': 0.001,
'close_profit': None,
'close_profit_perc': None,
'close_profit_pct': None,
'current_profit': -0.00408133,
'current_profit_perc': -0.41,
'current_profit_pct': -0.41,
'stop_loss': 0.0,
'initial_stop_loss': 0.0,
'initial_stop_loss_pct': None,
@ -124,9 +124,9 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'amount': 91.07468124,
'stake_amount': 0.001,
'close_profit': None,
'close_profit_perc': None,
'close_profit_pct': None,
'current_profit': ANY,
'current_profit_perc': ANY,
'current_profit_pct': ANY,
'stop_loss': 0.0,
'initial_stop_loss': 0.0,
'initial_stop_loss_pct': None,

View File

@ -501,10 +501,10 @@ def test_api_status(botclient, mocker, ticker, fee, markets):
'close_date_hum': None,
'close_timestamp': None,
'close_profit': None,
'close_profit_perc': None,
'close_profit_pct': None,
'close_rate': None,
'current_profit': -0.00408133,
'current_profit_perc': -0.41,
'current_profit_pct': -0.41,
'current_rate': 1.099e-05,
'initial_stop_loss': 0.0,
'initial_stop_loss_pct': None,

View File

@ -166,9 +166,9 @@ def test_status(default_conf, update, mocker, fee, ticker,) -> None:
'current_rate': 1.098e-05,
'amount': 90.99181074,
'stake_amount': 90.99181074,
'close_profit_perc': None,
'close_profit_pct': None,
'current_profit': -0.0059,
'current_profit_perc': -0.59,
'current_profit_pct': -0.59,
'initial_stop_loss': 1.098e-05,
'stop_loss': 1.099e-05,
'sell_order_status': None,