Files
Finlytic/FinlyticAnalyzer/Entities/TradeProposalEntity.cs
T

95 lines
2.7 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FinlyticCore.Models.Analyzer;
using FinlyticCore.Models.Assets;
namespace FinlyticAnalyzer.Entities;
[Table("trade_proposals")]
public class TradeProposalEntity
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
[MaxLength(100)]
public string AnalysisId { get; set; } = string.Empty;
[Required]
[MaxLength(100)]
public string EventId { get; set; } = string.Empty;
[Required]
[MaxLength(30)]
public string Isin { get; set; } = string.Empty;
[MaxLength(30)]
public string Symbol { get; set; } = string.Empty;
[MaxLength(150)]
public string Name { get; set; } = string.Empty;
[MaxLength(50)]
public string Sector { get; set; } = "General";
public AssetType Type { get; set; } = AssetType.Stock;
/// <summary>
/// KI-Entscheidung ("BUY", "SELL", "HOLD", "REJECTED")
/// </summary>
[MaxLength(20)]
public string ProposedAction { get; set; } = "BUY";
public double ConfidenceScore { get; set; }
// --- KI Execution Plan (Vorgeschlagene Preismarken) ---
[Column(TypeName = "decimal(18,4)")]
public decimal EntryPrice { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal StopLoss { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal TakeProfit { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? EntryZoneMin { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? EntryZoneMax { get; set; }
public string? TakeProfitTargets { get; set; } // Comma-separated or JSON
[Column(TypeName = "decimal(18,4)")]
public decimal? RiskRewardRatio { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? MaxLeverage { get; set; }
// --- Kontext aus Request & KI ---
public string ReasonSummary { get; set; } = string.Empty;
public string TechnicalRationale { get; set; } = string.Empty;
public string FundamentalRationale { get; set; } = string.Empty;
public string RiskWarning { get; set; } = string.Empty;
[MaxLength(30)]
public string RiskTolerance { get; set; } = "Balanced";
[MaxLength(20)]
public string Timeframe { get; set; } = "1-7 Tage";
[MaxLength(30)]
public string InstrumentType { get; set; } = "KnockOut";
public VixMarketRegime VixRegime { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal VixValue { get; set; }
public double WinRate { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime ExpiresAt { get; set; } = DateTime.UtcNow.AddHours(3);
}