Remove candle from backtest return + fix message when good backtest

This commit is contained in:
2025-11-14 20:49:02 +07:00
parent b4005a2d1e
commit 6d661f459e
7 changed files with 30 additions and 69 deletions

View File

@@ -85,7 +85,7 @@ public class BacktestTradingBotGrain : Grain, IBacktestTradingBotGrain
var lastYieldTime = DateTime.UtcNow;
const int yieldIntervalMs = 5000; // Yield control every 5 seconds to prevent timeout
const int candlesPerBatch = 100; // Process in batches to allow Orleans to check for cancellation
// Process all candles following the exact pattern from GetBacktestingResult
foreach (var candle in candles)
{
@@ -164,8 +164,7 @@ public class BacktestTradingBotGrain : Grain, IBacktestTradingBotGrain
var finalRequestId = requestId != null ? Guid.Parse(requestId) : Guid.NewGuid();
// Create backtest result with conditional candles and indicators values
var result = new Backtest(config, tradingBot.Positions, tradingBot.Signals,
withCandles ? candles : new HashSet<Candle>())
var result = new Backtest(config, tradingBot.Positions, tradingBot.Signals)
{
FinalPnl = finalPnl,
WinRate = winRate,