Fix status IsFinished/IsOpen/IsForMetrics + use redis for markets on gmx.tsx instead of inmemory cache

This commit is contained in:
2025-10-08 12:13:04 +07:00
parent 67065469a6
commit 86dd6849ea
9 changed files with 209 additions and 86 deletions

View File

@@ -301,7 +301,7 @@ namespace Managing.Application.ManageBot
// Calculate ROI based on total investment
var totalInvestment = botData.Positions.Values
.Where(p => p.IsFinished())
.Where(p => p.IsValidForMetrics())
.Sum(p => p.Open.Quantity * p.Open.Price);
var netPnl = pnl - fees;
var roi = totalInvestment > 0 ? (netPnl / totalInvestment) * 100 : 0;