Add backtest light
This commit is contained in:
@@ -179,7 +179,21 @@ public class BacktestController : BaseController
|
||||
|
||||
var response = new PaginatedBacktestsResponse
|
||||
{
|
||||
Backtests = backtests,
|
||||
Backtests = backtests.Select(b => new LightBacktestResponse
|
||||
{
|
||||
Id = b.Id,
|
||||
Config = b.Config,
|
||||
FinalPnl = b.FinalPnl,
|
||||
WinRate = b.WinRate,
|
||||
GrowthPercentage = b.GrowthPercentage,
|
||||
HodlPercentage = b.HodlPercentage,
|
||||
StartDate = b.StartDate,
|
||||
EndDate = b.EndDate,
|
||||
MaxDrawdown = b.MaxDrawdown,
|
||||
Fees = b.Fees,
|
||||
SharpeRatio = b.SharpeRatio,
|
||||
Score = b.Score
|
||||
}),
|
||||
TotalCount = totalCount,
|
||||
CurrentPage = page,
|
||||
PageSize = pageSize,
|
||||
@@ -229,7 +243,21 @@ public class BacktestController : BaseController
|
||||
|
||||
var response = new PaginatedBacktestsResponse
|
||||
{
|
||||
Backtests = backtests,
|
||||
Backtests = backtests.Select(b => new LightBacktestResponse
|
||||
{
|
||||
Id = b.Id,
|
||||
Config = b.Config,
|
||||
FinalPnl = b.FinalPnl,
|
||||
WinRate = b.WinRate,
|
||||
GrowthPercentage = b.GrowthPercentage,
|
||||
HodlPercentage = b.HodlPercentage,
|
||||
StartDate = b.StartDate,
|
||||
EndDate = b.EndDate,
|
||||
MaxDrawdown = b.MaxDrawdown,
|
||||
Fees = b.Fees,
|
||||
SharpeRatio = b.SharpeRatio,
|
||||
Score = b.Score
|
||||
}),
|
||||
TotalCount = totalCount,
|
||||
CurrentPage = page,
|
||||
PageSize = pageSize,
|
||||
|
||||
19
src/Managing.Api/Models/Requests/LightBacktestResponse.cs
Normal file
19
src/Managing.Api/Models/Requests/LightBacktestResponse.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Managing.Domain.Bots;
|
||||
|
||||
namespace Managing.Api.Models.Requests;
|
||||
|
||||
public class LightBacktestResponse
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
public TradingBotConfig Config { get; set; } = new();
|
||||
public decimal FinalPnl { get; set; }
|
||||
public int WinRate { get; set; }
|
||||
public decimal GrowthPercentage { get; set; }
|
||||
public decimal HodlPercentage { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public decimal? MaxDrawdown { get; set; }
|
||||
public decimal Fees { get; set; }
|
||||
public double? SharpeRatio { get; set; }
|
||||
public double Score { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using Managing.Domain.Backtests;
|
||||
|
||||
namespace Managing.Api.Models.Requests;
|
||||
|
||||
/// <summary>
|
||||
@@ -10,7 +8,7 @@ public class PaginatedBacktestsResponse
|
||||
/// <summary>
|
||||
/// The list of backtests for the current page
|
||||
/// </summary>
|
||||
public IEnumerable<Backtest> Backtests { get; set; } = new List<Backtest>();
|
||||
public IEnumerable<LightBacktestResponse> Backtests { get; set; } = new List<LightBacktestResponse>();
|
||||
|
||||
/// <summary>
|
||||
/// Total number of backtests across all pages
|
||||
|
||||
Reference in New Issue
Block a user