Files

64 lines
1.6 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FinlyticCore.Dtos.Simulation;
namespace FinlyticSimulation.Database.Entities;
[Table("simulation_runs")]
public class SimulationRunEntity
{
[Key]
public Guid Id { 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(50)]
public string StrategyKey { get; set; } = string.Empty;
[Required]
[MaxLength(10)]
public string Timeframe { get; set; } = "15m";
public DateTime StartDateUtc { get; set; }
public DateTime EndDateUtc { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal StartingCapital { get; set; }
public int TotalTrades { get; set; }
public int WinningTrades { get; set; }
public int LosingTrades { get; set; }
[Column(TypeName = "decimal(6,2)")]
public decimal WinRatePercent { get; set; }
[Column(TypeName = "decimal(8,4)")]
public decimal ProfitFactor { get; set; }
[Column(TypeName = "decimal(6,2)")]
public decimal MaxDrawdownPercent { get; set; }
[Column(TypeName = "decimal(8,2)")]
public decimal TotalReturnPercent { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal ExpectancyEur { get; set; }
[Column(TypeName = "decimal(8,4)")]
public decimal SharpeRatio { get; set; }
public BacktestReportDto ReportJson { get; set; } = null!;
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
}