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