diff --git a/freqtrade/rpc/api_server/ui/fallback_file.html b/freqtrade/rpc/api_server/ui/fallback_file.html index 13bb122a5..a164dc05a 100644 --- a/freqtrade/rpc/api_server/ui/fallback_file.html +++ b/freqtrade/rpc/api_server/ui/fallback_file.html @@ -195,7 +195,7 @@
@@ -206,14 +206,14 @@
freqtrade install-ui - +

Once installed, refresh this page to access the dashboard.

-
@@ -249,9 +249,10 @@ const btn = document.querySelector('.refresh-btn'); const icon = btn.querySelector('.icon'); btn.disabled = true; + btn.setAttribute('aria-busy', 'true'); icon.style.display = 'inline-block'; icon.style.animation = 'spin 1s linear infinite'; - btn.innerHTML = '🔄 Checking...'; + btn.innerHTML = ' Checking...'; setTimeout(() => { window.location.reload(); diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 80e1ed62a..16d7dcb12 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -638,11 +638,11 @@ class Telegram(RPCHandler): if float(msg["profit_ratio"]) >= 0.05: return "\N{ROCKET}" elif float(msg["profit_ratio"]) >= 0.0: - return "\N{MONEY BAG}" + return "🟢" elif msg["exit_reason"] == "stop_loss": return "\N{OCTAGONAL SIGN}" else: - return "\N{DOWN-POINTING RED TRIANGLE}" + return "🔴" def _prepare_order_details(self, filled_orders: list, quote_currency: str, is_open: bool): """ @@ -764,6 +764,7 @@ class Telegram(RPCHandler): + f" {profit_emoji} `{format_pct(r['profit_ratio'])}` `({r['profit_abs_r']})`", f"*Amount:* `{r['amount']} ({r['stake_amount_r']})`" + (f" / `{r['max_stake_amount_r']}`" if position_adjust else ""), + " ", f"*Open:* `{round_value(r['open_rate'], 8)}`", f"*Current:* `{round_value(r['current_rate'], 8)}`" if r["is_open"] @@ -771,6 +772,7 @@ class Telegram(RPCHandler): ] if r["is_open"]: + lines.append(" ") lines.append(f"*Age:* `{r['open_date_hum']}`") if r["enter_tag"]: diff --git a/freqtrade/util/rich_tables.py b/freqtrade/util/rich_tables.py index 093c73584..2b35cd918 100644 --- a/freqtrade/util/rich_tables.py +++ b/freqtrade/util/rich_tables.py @@ -1,3 +1,4 @@ +import math from collections.abc import Sequence from typing import Any, TypeAlias @@ -19,10 +20,15 @@ def print_rich_table( justify="right", table_kwargs: dict[str, Any] | None = None, ) -> None: + if table_kwargs is None: + table_kwargs = {} + if "row_styles" not in table_kwargs: + table_kwargs["row_styles"] = ["", "dim"] + table = Table( *[c if isinstance(c, Column) else Column(c, justify=justify) for c in headers], title=summary, - **(table_kwargs or {}), + **table_kwargs, ) for row in tabular_data: @@ -43,7 +49,11 @@ def print_rich_table( def _format_value(value: Any, *, floatfmt: str) -> str: + if value is None: + return "-" if isinstance(value, float): + if math.isnan(value): + return "-" return f"{value:{floatfmt}}" return str(value) @@ -57,7 +67,12 @@ def print_df_rich_table( index_name: str | None = None, table_kwargs: dict[str, Any] | None = None, ) -> None: - table = Table(title=summary, **(table_kwargs or {})) + if table_kwargs is None: + table_kwargs = {} + if "row_styles" not in table_kwargs: + table_kwargs["row_styles"] = ["", "dim"] + + table = Table(title=summary, **table_kwargs) if show_index: index_name = str(index_name) if index_name else tabular_data.index.name diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index 0809354c1..5fbf25865 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -2787,11 +2787,11 @@ def test_send_msg_exit_notification_no_fiat( [ ({"profit_ratio": 0.201, "exit_reason": "roi"}, "\N{ROCKET}"), ({"profit_ratio": 0.051, "exit_reason": "roi"}, "\N{ROCKET}"), - ({"profit_ratio": 0.0256, "exit_reason": "roi"}, "\N{MONEY BAG}"), - ({"profit_ratio": 0.01, "exit_reason": "roi"}, "\N{MONEY BAG}"), - ({"profit_ratio": 0.0, "exit_reason": "roi"}, "\N{MONEY BAG}"), + ({"profit_ratio": 0.0256, "exit_reason": "roi"}, "🟢"), + ({"profit_ratio": 0.01, "exit_reason": "roi"}, "🟢"), + ({"profit_ratio": 0.0, "exit_reason": "roi"}, "🟢"), ({"profit_ratio": -0.05, "exit_reason": "stop_loss"}, "\N{OCTAGONAL SIGN}"), - ({"profit_ratio": -0.02, "exit_reason": "sell_signal"}, "\N{DOWN-POINTING RED TRIANGLE}"), + ({"profit_ratio": -0.02, "exit_reason": "sell_signal"}, "🔴"), ], ) def test__exit_emoji(default_conf, mocker, msg, expected):