Fix status IsFinished/IsOpen/IsForMetrics + use redis for markets on gmx.tsx instead of inmemory cache
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user