update stats data
This commit is contained in:
@@ -40,8 +40,10 @@ public interface IPlatformSummaryGrain : IGrainWithStringKey
|
||||
Task<int> GetTotalPositionCountAsync();
|
||||
|
||||
// Event handlers for immediate updates
|
||||
Task OnStrategyDeployedAsync(StrategyDeployedEvent evt);
|
||||
Task OnStrategyStoppedAsync(StrategyStoppedEvent evt);
|
||||
/// <summary>
|
||||
/// Updates the active strategy count
|
||||
/// </summary>
|
||||
Task UpdateActiveStrategyCountAsync(int newActiveCount);
|
||||
Task OnPositionOpenedAsync(PositionOpenedEvent evt);
|
||||
Task OnPositionClosedAsync(PositionClosedEvent evt);
|
||||
Task OnTradeExecutedAsync(TradeExecutedEvent evt);
|
||||
@@ -57,37 +59,7 @@ public abstract class PlatformMetricsEvent
|
||||
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when a new strategy is deployed
|
||||
/// </summary>
|
||||
[GenerateSerializer]
|
||||
public class StrategyDeployedEvent : PlatformMetricsEvent
|
||||
{
|
||||
[Id(1)]
|
||||
public Guid StrategyId { get; set; }
|
||||
|
||||
[Id(2)]
|
||||
public string AgentName { get; set; } = string.Empty;
|
||||
|
||||
[Id(3)]
|
||||
public string StrategyName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when a strategy is stopped
|
||||
/// </summary>
|
||||
[GenerateSerializer]
|
||||
public class StrategyStoppedEvent : PlatformMetricsEvent
|
||||
{
|
||||
[Id(1)]
|
||||
public Guid StrategyId { get; set; }
|
||||
|
||||
[Id(2)]
|
||||
public string AgentName { get; set; } = string.Empty;
|
||||
|
||||
[Id(3)]
|
||||
public string StrategyName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when a new position is opened
|
||||
|
||||
Reference in New Issue
Block a user