Refactor TradingBotBase to remove unnecessary debug logging and streamline position recovery checks. Improved clarity in position management by eliminating redundant code.

This commit is contained in:
2025-11-12 00:58:33 +07:00
parent 8d97fce41c
commit e8a21a03d9

View File

@@ -403,8 +403,6 @@ public class TradingBotBase : ITradingBot
if (!hasOpenPositions && !hasWaitingSignals)
return;
// First, process all existing positions that are not finished
// Optimized: Inline the filter to avoid LINQ overhead
foreach (var position in Positions.Values)
@@ -2941,8 +2939,6 @@ public class TradingBotBase : ITradingBot
// Only attempt recovery if the last position is cancelled
if (lastPosition.Status != PositionStatus.Canceled)
{
await LogDebug(
$"❌ Recovery Skipped\nLast position `{lastPosition.Identifier}` is not cancelled (Status: {lastPosition.Status})\nNo recovery needed");
return;
}