Add filters and sorting for backtests
This commit is contained in:
@@ -156,10 +156,19 @@ public class ManagingDbContext : DbContext
|
||||
entity.Property(e => e.HodlPercentage).HasColumnType("decimal(18,8)");
|
||||
entity.Property(e => e.Fees).HasColumnType("decimal(18,8)");
|
||||
entity.Property(e => e.ConfigJson).HasColumnType("jsonb");
|
||||
entity.Property(e => e.Name).IsRequired().HasMaxLength(255);
|
||||
entity.Property(e => e.Ticker).HasMaxLength(32);
|
||||
entity.Property(e => e.Timeframe).IsRequired();
|
||||
entity.Property(e => e.IndicatorsCsv).HasColumnType("text");
|
||||
entity.Property(e => e.IndicatorsCount).IsRequired();
|
||||
entity.Property(e => e.PositionsJson).HasColumnType("jsonb");
|
||||
entity.Property(e => e.SignalsJson).HasColumnType("jsonb");
|
||||
entity.Property(e => e.MoneyManagementJson).HasColumnType("jsonb");
|
||||
entity.Property(e => e.StatisticsJson).HasColumnType("jsonb");
|
||||
entity.Property(e => e.SharpeRatio).HasColumnType("decimal(18,8)").HasDefaultValue(0m);
|
||||
entity.Property(e => e.MaxDrawdown).HasColumnType("decimal(18,8)").HasDefaultValue(0m);
|
||||
entity.Property(e => e.MaxDrawdownRecoveryTime).HasDefaultValue(TimeSpan.Zero);
|
||||
entity.Property(e => e.Duration).HasDefaultValue(TimeSpan.Zero);
|
||||
entity.Property(e => e.ScoreMessage).HasMaxLength(1000);
|
||||
entity.Property(e => e.Metadata).HasColumnType("text");
|
||||
|
||||
@@ -177,7 +186,10 @@ public class ManagingDbContext : DbContext
|
||||
|
||||
// Composite indexes for efficient pagination and filtering
|
||||
entity.HasIndex(e => new { e.UserId, e.Score });
|
||||
entity.HasIndex(e => new { e.UserId, e.Name });
|
||||
entity.HasIndex(e => new { e.RequestId, e.Score });
|
||||
entity.HasIndex(e => new { e.UserId, e.Ticker });
|
||||
entity.HasIndex(e => new { e.UserId, e.Timeframe });
|
||||
});
|
||||
|
||||
// Configure BundleBacktestRequest entity
|
||||
|
||||
Reference in New Issue
Block a user