Fix status and filtered positions for metrics
This commit is contained in:
@@ -454,11 +454,11 @@ public static class TradingBox
|
||||
/// </summary>
|
||||
/// <param name="positions">List of positions to analyze</param>
|
||||
/// <returns>The total volume traded in decimal</returns>
|
||||
public static decimal GetTotalVolumeTraded(Dictionary<Guid, Position> positions)
|
||||
public static decimal GetTotalVolumeTraded(List<Position> positions)
|
||||
{
|
||||
decimal totalVolume = 0;
|
||||
|
||||
foreach (var position in positions.Values)
|
||||
foreach (var position in positions)
|
||||
{
|
||||
// Add entry volume
|
||||
totalVolume += position.Open.Quantity * position.Open.Price;
|
||||
@@ -530,12 +530,12 @@ public static class TradingBox
|
||||
/// </summary>
|
||||
/// <param name="positions">List of positions to analyze</param>
|
||||
/// <returns>A tuple containing (wins, losses)</returns>
|
||||
public static (int Wins, int Losses) GetWinLossCount(Dictionary<Guid, Position> positions)
|
||||
public static (int Wins, int Losses) GetWinLossCount(List<Position> positions)
|
||||
{
|
||||
int wins = 0;
|
||||
int losses = 0;
|
||||
|
||||
foreach (var position in positions.Values)
|
||||
foreach (var position in positions)
|
||||
{
|
||||
if (position.ProfitAndLoss != null && position.ProfitAndLoss.Realized > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user