Log exception when backtest failed for no candles

This commit is contained in:
2025-11-05 17:27:48 +07:00
parent 5afddb895e
commit c183a71bd0
2 changed files with 29 additions and 15 deletions

View File

@@ -222,7 +222,8 @@ namespace Managing.Application.Backtests
startDate, timeframe, endDate);
if (candles == null || candles.Count == 0)
throw new Exception($"No candles for {ticker} on {timeframe} timeframe");
throw new Exception(
$"No candles for {ticker} on {timeframe} timeframe for start {startDate} to end {endDate}");
return candles;
}
@@ -451,11 +452,13 @@ namespace Managing.Application.Backtests
BacktestsFilter? filter = null)
{
var (backtests, totalCount) =
await _backtestRepository.GetBacktestsByUserPaginatedAsync(user, page, pageSize, sortBy, sortOrder, filter);
await _backtestRepository.GetBacktestsByUserPaginatedAsync(user, page, pageSize, sortBy, sortOrder,
filter);
return (backtests, totalCount);
}
public async Task InsertBundleBacktestRequestForUserAsync(User user, BundleBacktestRequest bundleRequest, bool saveAsTemplate = false)
public async Task InsertBundleBacktestRequestForUserAsync(User user, BundleBacktestRequest bundleRequest,
bool saveAsTemplate = false)
{
await _backtestRepository.InsertBundleBacktestRequestForUserAsync(user, bundleRequest);