Log internal positions
This commit is contained in:
@@ -187,8 +187,12 @@ public class TradingBotBase : ITradingBot
|
|||||||
ExecutionCount++;
|
ExecutionCount++;
|
||||||
|
|
||||||
Logger.LogInformation(
|
Logger.LogInformation(
|
||||||
"Bot Status {Identifier} - ServerDate: {ServerDate}, LastCandleDate: {LastCandleDate}, Signals: {SignalCount}, Executions: {ExecutionCount}, Positions: {PositionCount}",
|
"Bot Status {Name} - ServerDate: {ServerDate}, LastCandleDate: {LastCandleDate}, Signals: {SignalCount}, Executions: {ExecutionCount}, Positions: {PositionCount}",
|
||||||
Identifier, DateTime.UtcNow, LastCandle?.Date, Signals.Count, ExecutionCount, Positions.Count);
|
Config.Name, DateTime.UtcNow, LastCandle?.Date, Signals.Count, ExecutionCount, Positions.Count);
|
||||||
|
|
||||||
|
Logger.LogInformation("[{Name}] Internal Positions : {Position}", Config.Name,
|
||||||
|
string.Join(", ",
|
||||||
|
Positions.Values.Select(p => $"{p.SignalIdentifier} - Status: {p.Status}")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1802,7 +1806,8 @@ public class TradingBotBase : ITradingBot
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await LogWarning($"Failed to update position status for signal {signalIdentifier}: {ex.Message} {ex.StackTrace}");
|
await LogWarning(
|
||||||
|
$"Failed to update position status for signal {signalIdentifier}: {ex.Message} {ex.StackTrace}");
|
||||||
SentrySdk.CaptureException(ex);
|
SentrySdk.CaptureException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user