Fix Runtime by adding TotalRuntimeInSeconds

This commit is contained in:
2025-10-05 20:51:46 +07:00
parent 976c1a6580
commit f67ee330b3
18 changed files with 3142 additions and 50 deletions

View File

@@ -498,7 +498,8 @@ public class DataController : ControllerBase
PnL = strategy.Pnl,
NetPnL = strategy.NetPnL,
ROIPercentage = strategy.Roi,
Runtime = strategy.StartupTime,
Runtime = strategy.Status == BotStatus.Running ? strategy.LastStartTime : null,
TotalRuntimeSeconds = strategy.GetTotalRuntimeSeconds(),
WinRate = winRate,
TotalVolumeTraded = totalVolume,
VolumeLast24H = volumeLast24h,

View File

@@ -33,9 +33,14 @@ namespace Managing.Api.Models.Responses
public decimal ROIPercentage { get; set; }
/// <summary>
/// Date and time when the strategy was started
/// Date and time when the strategy was started (only present when running, for live ticker)
/// </summary>
public DateTime Runtime { get; set; }
public DateTime? Runtime { get; set; }
/// <summary>
/// Total accumulated runtime in seconds (including current session if running)
/// </summary>
public long TotalRuntimeSeconds { get; set; }
/// <summary>
/// Average percentage of successful trades