feat(simulation): add quant simulation microservice with virtual backtest broker and replay engine

This commit is contained in:
2026-08-24 21:36:20 +02:00
parent f43ce2b7e9
commit a4959658a2
22 changed files with 2600 additions and 0 deletions
@@ -0,0 +1,210 @@
// <auto-generated />
using System;
using FinlyticSimulation.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FinlyticSimulation.Migrations
{
[DbContext(typeof(SimulationDbContext))]
partial class SimulationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("FinlyticCore.Entities.Settings.SettingEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<DateTime>("LastUpdatedUtc")
.HasColumnType("timestamp with time zone");
b.Property<string>("ServiceIdentifier")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("ValueJson")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("DynamicSettings");
});
modelBuilder.Entity("FinlyticSimulation.Database.Entities.SimulationRunEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("EndDateUtc")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("ExpectancyEur")
.HasColumnType("decimal(18,4)");
b.Property<string>("Isin")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<int>("LosingTrades")
.HasColumnType("integer");
b.Property<decimal>("MaxDrawdownPercent")
.HasColumnType("decimal(6,2)");
b.Property<decimal>("ProfitFactor")
.HasColumnType("decimal(8,4)");
b.Property<string>("ReportJson")
.IsRequired()
.HasColumnType("jsonb");
b.Property<decimal>("SharpeRatio")
.HasColumnType("decimal(8,4)");
b.Property<DateTime>("StartDateUtc")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("StartingCapital")
.HasColumnType("decimal(18,4)");
b.Property<string>("StrategyKey")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Symbol")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("Timeframe")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<decimal>("TotalReturnPercent")
.HasColumnType("decimal(8,2)");
b.Property<int>("TotalTrades")
.HasColumnType("integer");
b.Property<decimal>("WinRatePercent")
.HasColumnType("decimal(6,2)");
b.Property<int>("WinningTrades")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CreatedAtUtc");
b.HasIndex("Isin", "StrategyKey", "Timeframe");
b.ToTable("simulation_runs");
});
modelBuilder.Entity("FinlyticSimulation.Database.Entities.SimulationStrategyMatrixEntity", b =>
{
b.Property<string>("Isin")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("StrategyKey")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Timeframe")
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<bool>("IsApproved")
.HasColumnType("boolean");
b.Property<Guid?>("LastBacktestRunId")
.HasColumnType("uuid");
b.Property<decimal>("MaxDrawdownPercent")
.HasColumnType("decimal(6,2)");
b.Property<decimal>("ProfitFactor")
.HasColumnType("decimal(8,4)");
b.Property<string>("RecommendedAction")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<decimal>("ReliabilityScore")
.HasColumnType("decimal(5,2)");
b.Property<int>("SampleTradesCount")
.HasColumnType("integer");
b.Property<DateTime>("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("WinRatePercent")
.HasColumnType("decimal(6,2)");
b.HasKey("Isin", "StrategyKey", "Timeframe");
b.HasIndex("ReliabilityScore");
b.HasIndex("Isin", "IsApproved");
b.ToTable("simulation_strategy_matrix");
});
modelBuilder.Entity("FinlyticSimulation.Database.Entities.SimulationStrategyParameterEntity", b =>
{
b.Property<string>("Isin")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("StrategyKey")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Parameters")
.IsRequired()
.HasColumnType("jsonb");
b.Property<DateTime>("UpdatedAtUtc")
.HasColumnType("timestamp with time zone");
b.HasKey("Isin", "StrategyKey");
b.ToTable("simulation_strategy_parameters");
});
#pragma warning restore 612, 618
}
}
}