Add PositionCount property to Backtest models and responses

- Introduced PositionCount to Backtest, LightBacktest, and their respective response models.
- Updated BacktestController and BacktestExecutor to include PositionCount in responses.
- Modified database schema to accommodate new PositionCount field in relevant entities.
This commit is contained in:
2025-11-18 22:23:20 +07:00
parent 0ee190786e
commit 68e9b2348c
9 changed files with 1776 additions and 4 deletions

View File

@@ -316,7 +316,8 @@ public class BacktestController : BaseController
Score = b.Score,
ScoreMessage = b.ScoreMessage,
InitialBalance = b.InitialBalance,
NetPnl = b.NetPnl
NetPnl = b.NetPnl,
PositionCount = b.PositionCount
}),
TotalCount = totalCount,
CurrentPage = page,
@@ -457,7 +458,8 @@ public class BacktestController : BaseController
Score = b.Score,
ScoreMessage = b.ScoreMessage,
InitialBalance = b.InitialBalance,
NetPnl = b.NetPnl
NetPnl = b.NetPnl,
PositionCount = b.PositionCount
}),
TotalCount = totalCount,
CurrentPage = page,

View File

@@ -22,6 +22,7 @@ public class LightBacktestResponse
[Required] public string ScoreMessage { get; set; } = string.Empty;
[Required] public decimal InitialBalance { get; set; }
[Required] public decimal NetPnl { get; set; }
[Required] public int PositionCount { get; set; }
}
public static class LightBacktestResponseMapper
@@ -45,7 +46,8 @@ public static class LightBacktestResponseMapper
Score = b.Score,
ScoreMessage = b.ScoreMessage,
InitialBalance = b.InitialBalance,
NetPnl = b.NetPnl
NetPnl = b.NetPnl,
PositionCount = b.PositionCount
};
}
}