Add netpnl and initialBalance to backtests

This commit is contained in:
2025-10-16 17:19:22 +07:00
parent 661f91f537
commit 472c507801
9 changed files with 50 additions and 10 deletions

View File

@@ -120,4 +120,12 @@ public class BacktestEntity
[Required]
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
[Required]
[Column(TypeName = "decimal(18,8)")]
public decimal InitialBalance { get; set; }
[Required]
[Column(TypeName = "decimal(18,8)")]
public decimal NetPnl { get; set; }
}

View File

@@ -313,7 +313,9 @@ public static class PostgreSqlMappers
Score = entity.Score,
ScoreMessage = entity.ScoreMessage,
RequestId = entity.RequestId,
Metadata = entity.Metadata
Metadata = entity.Metadata,
InitialBalance = entity.InitialBalance,
NetPnl = entity.NetPnl
};
return backtest;
@@ -353,7 +355,9 @@ public static class PostgreSqlMappers
ScoreMessage = backtest.ScoreMessage ?? string.Empty,
Metadata = backtest.Metadata?.ToString(),
CreatedAt = DateTime.UtcNow,
UpdatedAt = DateTime.UtcNow
UpdatedAt = DateTime.UtcNow,
InitialBalance = backtest.InitialBalance,
NetPnl = backtest.NetPnl
};
}