Do not check signal if position open and flipping is off

This commit is contained in:
2025-11-05 10:56:07 +07:00
parent 1079f38ed7
commit db6e06ad5d

View File

@@ -250,8 +250,14 @@ public class TradingBotBase : ITradingBot
public async Task UpdateSignals(HashSet<Candle> candles = null)
{
// If position open and not flipped, do not update signals
if (!Config.FlipPosition && Positions.Any(p => p.Value.IsOpen())) return;
// Skip indicator checking if flipping is disabled and there's an open position
// This prevents unnecessary indicator calculations when we can't act on signals anyway
if (!Config.FlipPosition && Positions.Any(p => p.Value.IsOpen()))
{
Logger.LogDebug(
$"Skipping signal update: Position open and flip disabled. Open positions: {Positions.Count(p => p.Value.IsOpen())}");
return;
}
// Check if we're in cooldown period for any direction
if (await IsInCooldownPeriodAsync())