From 8d5768f3fd96f1a4b462f265619c09dfa9681f2e Mon Sep 17 00:00:00 2001 From: mx57 <38256814+mx57@users.noreply.github.com> Date: Sun, 30 Aug 2026 20:12:23 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20UI/UX:=20Add=20minimum=20USDT=20tra?= =?UTF-8?q?de=20notification=20threshold=20setting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added minimum trade size input (in USDT) to Dashboard and Settings views - Filtered visual toast pop-ups and sound notifications based on realtime_min_trade_size - Bidirectionally persisted notification settings in localStorage - Marked web-dashboard-custom-alerts as completed in agent_tasks.json and replenished todo tasks --- IntelliTrader.Web/Views/Home/Dashboard.cshtml | 33 +++++++-- IntelliTrader.Web/Views/Home/Settings.cshtml | 68 +++++++++++++++++++ magda_agent_system/agent_tasks.json | 32 ++++++++- 3 files changed, 125 insertions(+), 8 deletions(-) diff --git a/IntelliTrader.Web/Views/Home/Dashboard.cshtml b/IntelliTrader.Web/Views/Home/Dashboard.cshtml index ce9e3fe..226fb72 100644 --- a/IntelliTrader.Web/Views/Home/Dashboard.cshtml +++ b/IntelliTrader.Web/Views/Home/Dashboard.cshtml @@ -27,15 +27,15 @@ - +
-
+
Громкость: 50%
-
+
Профиль звука:
-
- Настройки звука +
+ + Мин. сделка (USDT): +
@@ -59,6 +61,7 @@ const soundVolumeSlider = document.getElementById("soundVolumeSlider"); const soundVolumeValue = document.getElementById("soundVolumeValue"); const soundProfileSelect = document.getElementById("soundProfileSelect"); + const minTradeSizeInput = document.getElementById("minTradeSizeInput"); const notificationContainer = document.getElementById("notificationContainer"); let isSoundEnabled = localStorage.getItem("realtime_sound_enabled") !== "false"; @@ -74,10 +77,15 @@ // Load sound profile with fallback to 'chime' let soundProfile = localStorage.getItem("realtime_sound_profile") || "chime"; + // Load minimum USDT trade size filter + let minTradeSize = parseFloat(localStorage.getItem("realtime_min_trade_size") || "0"); + if (isNaN(minTradeSize)) minTradeSize = 0; + // Sync UI controls with values soundVolumeSlider.value = soundVolume; soundVolumeValue.textContent = Math.round(soundVolume * 100) + "%"; soundProfileSelect.value = soundProfile; + minTradeSizeInput.value = minTradeSize; updateSoundButtonUI(); @@ -206,6 +214,14 @@ playNotificationSound(); }); + // Min trade size threshold input handling + minTradeSizeInput.addEventListener("input", function () { + let val = parseFloat(minTradeSizeInput.value); + if (isNaN(val) || val < 0) val = 0; + minTradeSize = val; + localStorage.setItem("realtime_min_trade_size", minTradeSize); + }); + // Sound profile select handling soundProfileSelect.addEventListener("change", function () { soundProfile = soundProfileSelect.value; @@ -332,8 +348,11 @@ knownTrades.add(tradeId); if (!isFirstLoad) { - hasNewTrade = true; - showToastNotification(trade); + const tradeCost = Number(trade.Amount) * Number(trade.AveragePrice); + if (minTradeSize <= 0 || tradeCost >= minTradeSize) { + hasNewTrade = true; + showToastNotification(trade); + } } } }); diff --git a/IntelliTrader.Web/Views/Home/Settings.cshtml b/IntelliTrader.Web/Views/Home/Settings.cshtml index 88c654d..bbf1b86 100644 --- a/IntelliTrader.Web/Views/Home/Settings.cshtml +++ b/IntelliTrader.Web/Views/Home/Settings.cshtml @@ -49,6 +49,32 @@
+
+

Уведомления и звуковые сигналы

+
+ + +
+
+ + + 50% +
+
+ + +
+
+ + + (0 = показывать все сделки) +
+
+ diff --git a/magda_agent_system/agent_tasks.json b/magda_agent_system/agent_tasks.json index 7d53bc6..ed68cf7 100644 --- a/magda_agent_system/agent_tasks.json +++ b/magda_agent_system/agent_tasks.json @@ -446,7 +446,7 @@ }, { "id": "web-dashboard-custom-alerts", - "status": "todo", + "status": "done", "area": "web", "risk": "low", "title": "Add custom notification threshold settings on Dashboard", @@ -473,6 +473,36 @@ "acceptance": [ "Order caching mechanism is integrated and avoids frequent disk reads for historical trade logs." ] + }, + { + "id": "trading-trailing-buy-spread-guard", + "status": "todo", + "area": "trading", + "risk": "low", + "title": "Enhance BuyProcessor with dynamic trailing buy pause on extreme spread volatility", + "description": "Add dynamic spread volatility guard in BuyProcessor to postpone initial buy entries when market bid/ask spread exceeds safe thresholds.", + "allowed_paths": [ + "IntelliTrader.Trading/Processors/BuyProcessor.cs", + "magda_agent_system/agent_tasks.json" + ], + "acceptance": [ + "BuyProcessor evaluates spread threshold before executing trailing buy orders." + ] + }, + { + "id": "web-dashboard-trade-export-csv", + "status": "todo", + "area": "web", + "risk": "low", + "title": "Add CSV export button for trade history on Trades view", + "description": "Add an export button on Trades view to download historical executed trade logs as a CSV file.", + "allowed_paths": [ + "IntelliTrader.Web/Views/**", + "magda_agent_system/agent_tasks.json" + ], + "acceptance": [ + "Trades view includes a Download CSV button that returns formatted trade records." + ] } ] }