Fix genetic backend

This commit is contained in:
2025-07-11 14:11:41 +07:00
parent d04d8f310d
commit e43a1af5ef
15 changed files with 542 additions and 205 deletions

View File

@@ -103,6 +103,25 @@ public class BacktestController : BaseController
return Ok(_backtester.DeleteBacktestByUser(user, id));
}
/// <summary>
/// Retrieves all backtests for a specific genetic request ID.
/// This endpoint is used to view the results of a genetic algorithm optimization.
/// </summary>
/// <param name="requestId">The request ID to filter backtests by.</param>
/// <returns>A list of backtests associated with the specified request ID.</returns>
[HttpGet]
[Route("ByRequestId/{requestId}")]
public async Task<ActionResult<IEnumerable<Backtest>>> GetBacktestsByRequestId(string requestId)
{
if (string.IsNullOrEmpty(requestId))
{
return BadRequest("Request ID is required");
}
var backtests = _backtester.GetBacktestsByRequestId(requestId);
return Ok(backtests);
}
/// <summary>
/// Runs a backtest with the specified configuration.
/// The returned backtest includes a complete TradingBotConfig that preserves all