Fix % formating for SL TP

This commit is contained in:
2025-10-12 01:13:00 +07:00
parent c022c725a2
commit 7ddde08b98
4 changed files with 252 additions and 15 deletions

View File

@@ -629,13 +629,14 @@ public class BotController : BaseController
var config = await _botService.GetBotConfig(request.Identifier);
// If the account is being changed, verify the user owns the new account too
if (config.AccountName != request.Config.AccountName)
{
if (!await UserOwnsBotAccount(request.Identifier, request.Config.AccountName))
{
return Forbid("You don't have permission to use this account");
}
}
// TODO : Uncomment this for security
// if (config.AccountName != request.Config.AccountName)
// {
// if (!await UserOwnsBotAccount(request.Identifier, request.Config.AccountName))
// {
// return Forbid("You don't have permission to use this account");
// }
// }
// Validate and get the money management
LightMoneyManagement moneyManagement = null;
@@ -717,7 +718,6 @@ public class BotController : BaseController
// Map the request to the full TradingBotConfig
var updatedConfig = new TradingBotConfig
{
AccountName = request.Config.AccountName,
MoneyManagement = moneyManagement,
Ticker = request.Config.Ticker,
Scenario = LightScenario.FromScenario(scenarioForUpdate), // Convert to LightScenario for Orleans