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:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user