mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Fix telegram output
This commit is contained in:
parent
1fd2a2532d
commit
79f7f82c59
|
@ -628,6 +628,7 @@ class RPC:
|
||||||
def __calc_expectancy(
|
def __calc_expectancy(
|
||||||
self, mean_winning_profit: float, mean_losing_profit: float,
|
self, mean_winning_profit: float, mean_losing_profit: float,
|
||||||
winrate: float, loserate: float) -> Tuple[float, float]:
|
winrate: float, loserate: float) -> Tuple[float, float]:
|
||||||
|
|
||||||
expectancy = 1.0
|
expectancy = 1.0
|
||||||
if mean_winning_profit > 0 and abs(mean_losing_profit) > 0:
|
if mean_winning_profit > 0 and abs(mean_losing_profit) > 0:
|
||||||
expectancy = (
|
expectancy = (
|
||||||
|
|
|
@ -852,6 +852,7 @@ class Telegram(RPCHandler):
|
||||||
winrate = stats['winrate']
|
winrate = stats['winrate']
|
||||||
expectancy = stats['expectancy']
|
expectancy = stats['expectancy']
|
||||||
expectancy_rate = stats['expectancy_rate']
|
expectancy_rate = stats['expectancy_rate']
|
||||||
|
|
||||||
if stats['trade_count'] == 0:
|
if stats['trade_count'] == 0:
|
||||||
markdown_msg = f"No trades yet.\n*Bot started:* `{stats['bot_start_date']}`"
|
markdown_msg = f"No trades yet.\n*Bot started:* `{stats['bot_start_date']}`"
|
||||||
else:
|
else:
|
||||||
|
@ -876,9 +877,9 @@ class Telegram(RPCHandler):
|
||||||
f"*{'First Trade opened' if not timescale else 'Showing Profit since'}:* "
|
f"*{'First Trade opened' if not timescale else 'Showing Profit since'}:* "
|
||||||
f"`{first_trade_date}`\n"
|
f"`{first_trade_date}`\n"
|
||||||
f"*Latest Trade opened:* `{latest_trade_date}`\n"
|
f"*Latest Trade opened:* `{latest_trade_date}`\n"
|
||||||
f"*Win / Loss:* `{stats['winning_trades']} / {stats['losing_trades']}\n"
|
f"*Win / Loss:* `{stats['winning_trades']} / {stats['losing_trades']}`\n"
|
||||||
f"*Winrate:* `({winrate:.2f}%)`\n"
|
f"*Winrate:* `{winrate:.2f}%`\n"
|
||||||
f"*Expectancy (Rate):* `{expectancy:.2f} ({expectancy_rate:.2f})`\n"
|
f"*Expectancy (Rate):* `{expectancy:.2f} ({expectancy_rate:.2f})`"
|
||||||
)
|
)
|
||||||
if stats['closed_trade_count'] > 0:
|
if stats['closed_trade_count'] > 0:
|
||||||
markdown_msg += (
|
markdown_msg += (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user