feat(analyzer): update MQTT handler, active trade monitoring, and dynamic settings

This commit is contained in:
2026-08-14 23:55:52 +02:00
parent 4d5ab09bbd
commit c496651dd1
8 changed files with 778 additions and 45 deletions
@@ -211,8 +211,8 @@ public class ActiveTradeMonitorWorker : BackgroundService
},
MarketContext = new MarketContextInfo
{
Vix = (double)vixService.CurrentVix,
MarketRegime = vixService.CurrentRegime.ToString()
Vix = vixService.GetCurrentVix(),
MarketRegime = vixService.GetCurrentRegime().ToString()
},
UserPreferences = new UserPreferencesInfo
{
@@ -14,7 +14,11 @@ public class N8nEvaluationService : IN8nEvaluationService
{
_httpClient = httpClient;
_logger = logger;
_webhookUrl = configuration["N8N:WebhookUrl"] ?? configuration["N8N__WebhookUrl"] ?? "https://n8n.kleidukos.me/webhook/gemini/analysis/auto";
_webhookUrl = configuration["N8N:WebhookUrl"] ?? configuration["N8N__WebhookUrl"] ?? string.Empty;
if (string.IsNullOrWhiteSpace(_webhookUrl))
{
_logger.LogWarning("[{Channel}] N8N:WebhookUrl configuration is missing or empty.", "AnalyzerChannel");
}
// Timeout auf 45 Sekunden erhöht für komplexere LLM/Gemini Chains in n8n
_httpClient.Timeout = TimeSpan.FromSeconds(45);
@@ -25,6 +29,12 @@ public class N8nEvaluationService : IN8nEvaluationService
/// </summary>
public async Task<N8nAnalysisResponseDto?> EvaluateAssetAsync(N8nAnalysisRequestDto request, CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(_webhookUrl))
{
_logger.LogError("[{Channel}] Cannot execute AI evaluation for {Symbol}: N8N:WebhookUrl is not configured.", "AnalyzerChannel", request.TargetAsset.Symbol);
return null;
}
try
{
_logger.LogInformation("[{Channel}] Sending n8n AI Evaluation request {RequestId} for Asset {Symbol} (ISIN: {Isin}) to {Url}...",