Fix Runtime

This commit is contained in:
2025-10-06 00:55:18 +07:00
parent 6cbfff38d0
commit dab4807334
8 changed files with 172 additions and 9 deletions

View File

@@ -499,6 +499,9 @@ public class DataController : ControllerBase
NetPnL = strategy.NetPnL,
ROIPercentage = strategy.Roi,
Runtime = strategy.Status == BotStatus.Running ? strategy.LastStartTime : null,
LastStartTime = strategy.LastStartTime,
LastStopTime = strategy.LastStopTime,
AccumulatedRunTimeSeconds = strategy.AccumulatedRunTimeSeconds,
TotalRuntimeSeconds = strategy.GetTotalRuntimeSeconds(),
WinRate = winRate,
TotalVolumeTraded = totalVolume,

View File

@@ -42,6 +42,21 @@ namespace Managing.Api.Models.Responses
/// </summary>
public long TotalRuntimeSeconds { get; set; }
/// <summary>
/// Time when the current or last session started
/// </summary>
public DateTime? LastStartTime { get; set; }
/// <summary>
/// Time when the last session stopped (null if currently running)
/// </summary>
public DateTime? LastStopTime { get; set; }
/// <summary>
/// Total accumulated runtime across all past sessions (seconds)
/// </summary>
public long AccumulatedRunTimeSeconds { get; set; }
/// <summary>
/// Average percentage of successful trades
/// </summary>