Refactor BacktestSpotBot signal generation to utilize base implementation for optimizations; update BacktestExecutorTests with revised metrics reflecting recent backtest results; add new performance benchmark entries for improved tracking.

This commit is contained in:
2025-12-19 18:00:37 +07:00
parent b52f00a450
commit 415845ed5a
4 changed files with 16 additions and 14 deletions

View File

@@ -163,13 +163,11 @@ public class BacktestSpotBot : TradingBotBase, ITradingBot
protected override async Task UpdateSignalsCore(IReadOnlyList<Candle> candles,
Dictionary<IndicatorType, IndicatorsResultBase> preCalculatedIndicatorValues = null)
{
// For spot trading, always fetch signals regardless of open positions
// Check if we're in cooldown period
if (await IsInCooldownPeriodAsync())
{
// Still in cooldown period, skip signal generation
return;
}
// Call base implementation for common optimizations (flip check, cooldown check)
// This will return early if:
// - FlipPosition is disabled AND there's an open position
// - Bot is in cooldown period
await base.UpdateSignalsCore(candles, preCalculatedIndicatorValues);
// For backtest, if no candles provided (called from Run()), skip signal generation
// Signals are generated in BacktestExecutor with rolling window candles