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