using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using FinlyticCore.Dtos.TechnicalAnalysis; namespace FinlyticTechnicals.Entities; [Table("fta_technical_setups")] public class FtaTechnicalSetupEntity { [Key] public Guid SetupId { get; set; } = Guid.NewGuid(); [Required] [MaxLength(20)] public string Isin { get; set; } = string.Empty; [MaxLength(30)] public string Symbol { get; set; } = string.Empty; [Required] [MaxLength(10)] public string Timeframe { get; set; } = "15m"; [Required] [MaxLength(50)] public string StrategyKey { get; set; } = string.Empty; [MaxLength(100)] public string StrategyName { get; set; } = string.Empty; [MaxLength(10)] public string Direction { get; set; } = "Buy"; [Column(TypeName = "decimal(6,2)")] public decimal QualityScore { get; set; } [Column(TypeName = "decimal(18,4)")] public decimal CurrentPrice { get; set; } [Column(TypeName = "decimal(18,4)")] public decimal EntryPrice { get; set; } [Column(TypeName = "decimal(18,4)")] public decimal InvalidationPrice { get; set; } [Column(TypeName = "decimal(18,4)")] public decimal CurrentAtr { get; set; } [Column(TypeName = "decimal(8,2)")] public decimal EstimatedRiskRewardRatio { get; set; } public ExitPlan ExitPlan { get; set; } = null!; public string TechnicalRationale { get; set; } = string.Empty; public List TriggeringPatterns { get; set; } = []; public Dictionary IndicatorSnapshot { get; set; } = []; public bool IsTopPick { get; set; } [MaxLength(5)] public string Rating { get; set; } = "B"; public bool IsActive { get; set; } = true; [Required] public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow; [Required] public DateTime ExpiresAtUtc { get; set; } /// /// String form of the UniverseSource this ISIN was being monitored under when this setup was /// computed (favorite/discovery/sentiment-spike), or for an ad hoc analysis (e.g. a /// manual "Analyze now" call for an ISIN not currently in the scan universe). See /// FinlyticCore.Dtos.TechnicalAnalysis.StrategyResultDto.UniverseSource. /// [MaxLength(20)] public string? UniverseSource { get; set; } /// When the ISIN above entered that scan universe, alongside . public DateTime? UniverseEnteredAtUtc { get; set; } /// String form of the MarketRegime at analysis time. See StrategyResultDto.Regime. [MaxLength(30)] public string? Regime { get; set; } }