Add balance tracking on bot start/restart; implement TrackBalanceOnBotStartAsync in IAgentGrain and AgentGrain, and trigger it in LiveTradingBotGrain. Enhance logging for balance tracking operations.

This commit is contained in:
2025-12-26 15:43:46 +07:00
parent f884cb2362
commit 7a3ede03ca
4 changed files with 117 additions and 9 deletions

View File

@@ -109,18 +109,11 @@ public abstract class TradingBotBase : ITradingBot
break;
case BotStatus.Running:
case BotStatus.Stopped:
return;
case BotStatus.Stopped:
// If status was Stopped we log a message to inform the user that the bot is restarting
await LogInformationAsync($"🔄 Bot Restarted\n" +
$"📊 Resuming operations with {Signals.Count} signals and {Positions.Count} positions\n" +
$"✅ Ready to continue trading");
break;
default:
// Handle any other status if needed
break;
return;
}
}
catch (Exception ex)