Add signalr
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Managing.Domain.Backtests;
|
||||
using Managing.Domain.Bots;
|
||||
|
||||
namespace Managing.Api.Models.Requests;
|
||||
@@ -19,4 +20,28 @@ public class LightBacktestResponse
|
||||
[Required] public double? SharpeRatio { get; set; }
|
||||
[Required] public double Score { get; set; }
|
||||
[Required] public string ScoreMessage { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public static class LightBacktestResponseMapper
|
||||
{
|
||||
public static LightBacktestResponse MapFromDomain(Backtest b)
|
||||
{
|
||||
if (b == null) return null;
|
||||
return 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.Statistics?.MaxDrawdown,
|
||||
Fees = b.Fees,
|
||||
SharpeRatio = (double?)b.Statistics?.SharpeRatio,
|
||||
Score = b.Score,
|
||||
ScoreMessage = b.ScoreMessage
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user