update position count to open position only

This commit is contained in:
2025-09-28 22:44:03 +07:00
parent f041c1e8e8
commit 57b3603302
2 changed files with 30 additions and 76 deletions

View File

@@ -159,13 +159,16 @@ public class PlatformSummaryGrain : Grain, IPlatformSummaryGrain, IRemindable
_state.State.PositionCountByAsset[ticker]++;
// Position count breakdown by direction - update state directly
if (!_state.State.PositionCountByDirection.ContainsKey(direction))
// Position count breakdown by direction - only count finished positions
if (!position.IsFinished())
{
_state.State.PositionCountByDirection[direction] = 0;
}
if (!_state.State.PositionCountByDirection.ContainsKey(direction))
{
_state.State.PositionCountByDirection[direction] = 0;
}
_state.State.PositionCountByDirection[direction]++;
_state.State.PositionCountByDirection[direction]++;
}
}
_state.State.TotalPlatformVolume = totalVolume;