Improve naming of variables
This commit is contained in:
parent
ab88217186
commit
ec03531771
@ -54,7 +54,6 @@ class Balances(BaseModel):
|
||||
starting_capital_fiat_pct: float
|
||||
|
||||
|
||||
|
||||
class Count(BaseModel):
|
||||
current: int
|
||||
max: int
|
||||
|
@ -459,7 +459,7 @@ class RPC:
|
||||
|
||||
self._freqtrade.wallets.update(require_update=False)
|
||||
starting_capital = self._freqtrade.wallets.get_starting_balance()
|
||||
starting_capital_fiat = self._fiat_converter.convert_amount(
|
||||
starting_cap_fiat = self._fiat_converter.convert_amount(
|
||||
starting_capital, stake_currency, fiat_display_currency) if self._fiat_converter else 0
|
||||
|
||||
for coin, balance in self._freqtrade.wallets.get_all_balances().items():
|
||||
@ -500,11 +500,8 @@ class RPC:
|
||||
total, stake_currency, fiat_display_currency) if self._fiat_converter else 0
|
||||
|
||||
starting_capital_ratio = 0.0
|
||||
starting_capital_fiat_ratio = 0.0
|
||||
if starting_capital:
|
||||
starting_capital_ratio = (total / starting_capital) - 1
|
||||
if starting_capital_fiat:
|
||||
starting_capital_fiat_ratio = (value / starting_capital_fiat) - 1
|
||||
starting_capital_ratio = (total / starting_capital) - 1 if starting_capital else 0.0
|
||||
starting_cap_fiat_ratio = (value / starting_cap_fiat) - 1 if starting_cap_fiat else 0.0
|
||||
|
||||
return {
|
||||
'currencies': output,
|
||||
@ -515,9 +512,9 @@ class RPC:
|
||||
'starting_capital': starting_capital,
|
||||
'starting_capital_ratio': starting_capital_ratio,
|
||||
'starting_capital_pct': round(starting_capital_ratio * 100, 2),
|
||||
'starting_capital_fiat': starting_capital_fiat,
|
||||
'starting_capital_fiat_ratio': starting_capital_fiat_ratio,
|
||||
'starting_capital_fiat_pct': round(starting_capital_fiat_ratio * 100, 2),
|
||||
'starting_capital_fiat': starting_cap_fiat,
|
||||
'starting_capital_fiat_ratio': starting_cap_fiat_ratio,
|
||||
'starting_capital_fiat_pct': round(starting_cap_fiat_ratio * 100, 2),
|
||||
'note': 'Simulated balances' if self._freqtrade.config['dry_run'] else ''
|
||||
}
|
||||
|
||||
|
@ -649,8 +649,7 @@ class Telegram(RPCHandler):
|
||||
f" `({result['starting_capital_pct']}%)`\n"
|
||||
f"\t`{result['symbol']}: "
|
||||
f"{round_coin_value(result['value'], result['symbol'], False)}`"
|
||||
f" `({result['starting_capital_fiat_pct']}%)`\n"
|
||||
)
|
||||
f" `({result['starting_capital_fiat_pct']}%)`\n")
|
||||
self._send_msg(output, reload_able=True, callback_path="update_balance",
|
||||
query=update.callback_query)
|
||||
except RPCException as e:
|
||||
|
Loading…
Reference in New Issue
Block a user