Do not check signal if position open and flipping is off
This commit is contained in:
@@ -250,8 +250,14 @@ public class TradingBotBase : ITradingBot
|
|||||||
|
|
||||||
public async Task UpdateSignals(HashSet<Candle> candles = null)
|
public async Task UpdateSignals(HashSet<Candle> candles = null)
|
||||||
{
|
{
|
||||||
// If position open and not flipped, do not update signals
|
// Skip indicator checking if flipping is disabled and there's an open position
|
||||||
if (!Config.FlipPosition && Positions.Any(p => p.Value.IsOpen())) return;
|
// 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
|
// Check if we're in cooldown period for any direction
|
||||||
if (await IsInCooldownPeriodAsync())
|
if (await IsInCooldownPeriodAsync())
|
||||||
|
|||||||
Reference in New Issue
Block a user