Improve variable wording
This commit is contained in:
@@ -283,6 +283,9 @@ class OpenTradeSchema(TradeSchema):
|
||||
stoploss_entry_dist: Optional[float]
|
||||
stoploss_entry_dist_ratio: Optional[float]
|
||||
current_rate: float
|
||||
total_profit_abs: float
|
||||
total_profit_fiat: Optional[float]
|
||||
|
||||
open_order: Optional[str]
|
||||
|
||||
|
||||
|
@@ -169,7 +169,7 @@ class RPC:
|
||||
for trade in trades:
|
||||
order: Optional[Order] = None
|
||||
current_profit_fiat: Optional[float] = None
|
||||
combined_profit_fiat: Optional[float] = None
|
||||
total_profit_fiat: Optional[float] = None
|
||||
if trade.open_order_id:
|
||||
order = trade.select_order_by_order_id(trade.open_order_id)
|
||||
# calculate profit and send message to user
|
||||
@@ -191,7 +191,7 @@ class RPC:
|
||||
current_rate = trade.close_rate
|
||||
current_profit = trade.close_profit
|
||||
current_profit_abs = trade.close_profit_abs
|
||||
combined_profit_abs = trade.realized_profit + current_profit_abs
|
||||
total_profit_abs = trade.realized_profit + current_profit_abs
|
||||
|
||||
# Calculate fiat profit
|
||||
if not isnan(current_profit_abs) and self._fiat_converter:
|
||||
@@ -200,8 +200,8 @@ class RPC:
|
||||
self._freqtrade.config['stake_currency'],
|
||||
self._freqtrade.config['fiat_display_currency']
|
||||
)
|
||||
combined_profit_fiat = self._fiat_converter.convert_amount(
|
||||
combined_profit_abs,
|
||||
total_profit_fiat = self._fiat_converter.convert_amount(
|
||||
total_profit_abs,
|
||||
self._freqtrade.config['stake_currency'],
|
||||
self._freqtrade.config['fiat_display_currency']
|
||||
)
|
||||
@@ -222,8 +222,8 @@ class RPC:
|
||||
profit_abs=current_profit_abs,
|
||||
profit_fiat=current_profit_fiat,
|
||||
|
||||
combined_profit_abs=combined_profit_abs,
|
||||
combined_profit_fiat=combined_profit_fiat,
|
||||
total_profit_abs=total_profit_abs,
|
||||
total_profit_fiat=total_profit_fiat,
|
||||
stoploss_current_dist=stoploss_current_dist,
|
||||
stoploss_current_dist_ratio=round(stoploss_current_dist_ratio, 8),
|
||||
stoploss_current_dist_pct=round(stoploss_current_dist_ratio * 100, 2),
|
||||
|
@@ -565,8 +565,8 @@ class Telegram(RPCHandler):
|
||||
r['stake_amount_r'] = round_coin_value(r['stake_amount'], r['quote_currency'])
|
||||
r['profit_abs_r'] = round_coin_value(r['profit_abs'], r['quote_currency'])
|
||||
r['realized_profit_r'] = round_coin_value(r['realized_profit'], r['quote_currency'])
|
||||
r['combined_profit_abs_r'] = round_coin_value(
|
||||
r['combined_profit_abs'], r['quote_currency'])
|
||||
r['total_profit_abs_r'] = round_coin_value(
|
||||
r['total_profit_abs'], r['quote_currency'])
|
||||
lines = [
|
||||
"*Trade ID:* `{trade_id}`" +
|
||||
(" `(since {open_date_hum})`" if r['is_open'] else ""),
|
||||
@@ -595,7 +595,7 @@ class Telegram(RPCHandler):
|
||||
if r['is_open']:
|
||||
if r.get('realized_profit'):
|
||||
lines.append("*Realized Profit:* `{realized_profit_r}`")
|
||||
lines.append("*Total Profit:* `{combined_profit_abs_r}` ")
|
||||
lines.append("*Total Profit:* `{total_profit_abs_r}` ")
|
||||
|
||||
if (r['stop_loss_abs'] != r['initial_stop_loss_abs']
|
||||
and r['initial_stop_loss_ratio'] is not None):
|
||||
|
Reference in New Issue
Block a user