diff --git a/src/Managing.Application/Bots/TradingBotBase.cs b/src/Managing.Application/Bots/TradingBotBase.cs index a1f3b8c9..03f5c6b8 100644 --- a/src/Managing.Application/Bots/TradingBotBase.cs +++ b/src/Managing.Application/Bots/TradingBotBase.cs @@ -2650,6 +2650,9 @@ public class TradingBotBase : ITradingBot UseForSignalFiltering = Config.UseForSignalFiltering, UseForDynamicStopLoss = Config.UseForDynamicStopLoss, RiskManagement = Config.RiskManagement, + IsForCopyTrading = Config.IsForCopyTrading, + MasterBotIdentifier = Config.MasterBotIdentifier, + MasterBotUserId = Config.MasterBotUserId, }; } diff --git a/src/Managing.Application/ManageBot/RestartBotCommandHandler.cs b/src/Managing.Application/ManageBot/RestartBotCommandHandler.cs index 8586a944..342fb5e3 100644 --- a/src/Managing.Application/ManageBot/RestartBotCommandHandler.cs +++ b/src/Managing.Application/ManageBot/RestartBotCommandHandler.cs @@ -50,6 +50,12 @@ namespace Managing.Application.ManageBot throw new InvalidOperationException($"Could not retrieve configuration for bot {request.Identifier}"); } + // Ensure MasterBotUserId is preserved from the database bot + if (bot.MasterBotUserId.HasValue && botConfig.MasterBotUserId != bot.MasterBotUserId.Value) + { + botConfig.MasterBotUserId = bot.MasterBotUserId.Value; + } + // Get account to check GMX initialization status Account account; if (string.IsNullOrEmpty(botConfig.AccountName))