|
|
|
|
@ -510,14 +510,14 @@ class Telegram(RPCHandler):
|
|
|
|
|
if prev_avg_price:
|
|
|
|
|
minus_on_entry = (cur_entry_average - prev_avg_price) / prev_avg_price
|
|
|
|
|
|
|
|
|
|
lines.append(f"*{wording} #{order_nr}:* at {minus_on_entry:.2%} avg profit")
|
|
|
|
|
lines.append(f"*{wording} #{order_nr}:* at {minus_on_entry:.2%} avg Profit")
|
|
|
|
|
if is_open:
|
|
|
|
|
lines.append("({})".format(cur_entry_datetime
|
|
|
|
|
.humanize(granularity=["day", "hour", "minute"])))
|
|
|
|
|
lines.append(f"*Amount:* {cur_entry_amount} "
|
|
|
|
|
f"({round_coin_value(order['cost'], quote_currency)})")
|
|
|
|
|
lines.append(f"*Average {wording} Price:* {cur_entry_average} "
|
|
|
|
|
f"({price_to_1st_entry:.2%} from 1st entry rate)")
|
|
|
|
|
f"({price_to_1st_entry:.2%} from 1st entry Rate)")
|
|
|
|
|
lines.append(f"*Order filled:* {order['order_filled_date']}")
|
|
|
|
|
|
|
|
|
|
# TODO: is this really useful?
|
|
|
|
|
@ -569,6 +569,8 @@ class Telegram(RPCHandler):
|
|
|
|
|
and not o['ft_order_side'] == 'stoploss'])
|
|
|
|
|
r['exit_reason'] = r.get('exit_reason', "")
|
|
|
|
|
r['stake_amount_r'] = round_coin_value(r['stake_amount'], r['quote_currency'])
|
|
|
|
|
r['max_stake_amount_r'] = round_coin_value(
|
|
|
|
|
r['max_stake_amount'] or 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['total_profit_abs_r'] = round_coin_value(
|
|
|
|
|
@ -580,31 +582,37 @@ class Telegram(RPCHandler):
|
|
|
|
|
f"*Direction:* {'`Short`' if r.get('is_short') else '`Long`'}"
|
|
|
|
|
+ " ` ({leverage}x)`" if r.get('leverage') else "",
|
|
|
|
|
"*Amount:* `{amount} ({stake_amount_r})`",
|
|
|
|
|
"*Total invested:* `{max_stake_amount_r}`" if position_adjust else "",
|
|
|
|
|
"*Enter Tag:* `{enter_tag}`" if r['enter_tag'] else "",
|
|
|
|
|
"*Exit Reason:* `{exit_reason}`" if r['exit_reason'] else "",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if position_adjust:
|
|
|
|
|
max_buy_str = (f"/{max_entries + 1}" if (max_entries > 0) else "")
|
|
|
|
|
lines.append("*Number of Entries:* `{num_entries}" + max_buy_str + "`")
|
|
|
|
|
lines.append("*Number of Exits:* `{num_exits}`")
|
|
|
|
|
lines.extend([
|
|
|
|
|
"*Number of Entries:* `{num_entries}" + max_buy_str + "`",
|
|
|
|
|
"*Number of Exits:* `{num_exits}`"
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
lines.extend([
|
|
|
|
|
"*Open Rate:* `{open_rate:.8f}`",
|
|
|
|
|
"*Close Rate:* `{close_rate:.8f}`" if r['close_rate'] else "",
|
|
|
|
|
"*Open Date:* `{open_date}`",
|
|
|
|
|
"*Close Date:* `{close_date}`" if r['close_date'] else "",
|
|
|
|
|
"*Current Rate:* `{current_rate:.8f}`" if r['is_open'] else "",
|
|
|
|
|
" \n*Current Rate:* `{current_rate:.8f}`" if r['is_open'] else "",
|
|
|
|
|
("*Unrealized Profit:* " if r['is_open'] else "*Close Profit: *")
|
|
|
|
|
+ "`{profit_ratio:.2%}` `({profit_abs_r})`",
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
if r['is_open']:
|
|
|
|
|
if r.get('realized_profit'):
|
|
|
|
|
lines.append(
|
|
|
|
|
"*Realized Profit:* `{realized_profit_r} {realized_profit_ratio:.2%}`")
|
|
|
|
|
lines.append("*Total Profit:* `{total_profit_abs_r}` ")
|
|
|
|
|
lines.extend([
|
|
|
|
|
"*Realized Profit:* `{realized_profit_ratio:.2%} ({realized_profit_r})`",
|
|
|
|
|
"*Total Profit:* `{total_profit_ratio:.2%} ({total_profit_abs_r})`"
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
# Append empty line to improve readability
|
|
|
|
|
lines.append(" ")
|
|
|
|
|
if (r['stop_loss_abs'] != r['initial_stop_loss_abs']
|
|
|
|
|
and r['initial_stop_loss_ratio'] is not None):
|
|
|
|
|
# Adding initial stoploss only if it is different from stoploss
|
|
|
|
|
|