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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user