Fix identifier for strat

This commit is contained in:
2025-05-13 15:28:27 +07:00
parent 621a5a745e
commit 503a442c6b
2 changed files with 17 additions and 15 deletions

View File

@@ -422,7 +422,8 @@ public class DataController : ControllerBase
Wins = wins,
Losses = losses,
Positions = strategy.Positions.OrderByDescending(p => p.Date)
.ToList() // Include sorted positions with most recent first
.ToList(), // Include sorted positions with most recent first
Identifier = strategy.Identifier,
};
}

View File

@@ -1,5 +1,4 @@
using Managing.Domain.Trades;
using static Managing.Common.Enums;
namespace Managing.Api.Models.Responses
{
@@ -12,65 +11,67 @@ namespace Managing.Api.Models.Responses
/// Name of the deployed strategy
/// </summary>
public string Name { get; set; }
/// <summary>
/// Strategy identifier
/// </summary>
public string StrategyName { get; set; }
/// <summary>
/// Current state of the strategy (RUNNING, STOPPED, UNUSED)
/// </summary>
public string State { get; set; }
/// <summary>
/// Total profit or loss generated by the strategy in USD
/// </summary>
public decimal PnL { get; set; }
/// <summary>
/// Return on investment percentage
/// </summary>
public decimal ROIPercentage { get; set; }
/// <summary>
/// Return on investment percentage in the last 24 hours
/// </summary>
public decimal ROILast24H { get; set; }
/// <summary>
/// Date and time when the strategy was started
/// </summary>
public DateTime Runtime { get; set; }
/// <summary>
/// Average percentage of successful trades
/// </summary>
public int WinRate { get; set; }
/// <summary>
/// Total trading volume for all trades
/// </summary>
public decimal TotalVolumeTraded { get; set; }
/// <summary>
/// Trading volume in the last 24 hours
/// </summary>
public decimal VolumeLast24H { get; set; }
/// <summary>
/// Number of winning trades
/// </summary>
public int Wins { get; set; }
/// <summary>
/// Number of losing trades
/// </summary>
public int Losses { get; set; }
/// <summary>
/// List of all positions executed by this strategy
/// </summary>
public List<Position> Positions { get; set; } = new List<Position>();
public string Identifier { get; set; }
}
}
}