diff --git a/src/Managing.Application/ManageBot/StartBotCommandHandler.cs b/src/Managing.Application/ManageBot/StartBotCommandHandler.cs index 1cd4fd79..e9365aa6 100644 --- a/src/Managing.Application/ManageBot/StartBotCommandHandler.cs +++ b/src/Managing.Application/ManageBot/StartBotCommandHandler.cs @@ -29,20 +29,23 @@ namespace Managing.Application.ManageBot public async Task Handle(StartBotCommand request, CancellationToken cancellationToken) { - // Check if trading_future feature flag is enabled - var isTradingFutureEnabled = await _flagsmithService.IsFeatureEnabledAsync(request.User.Name, "trading_future"); - if (!isTradingFutureEnabled) - { - throw new InvalidOperationException( - "Futures trading is not enabled for your account. Please contact support to enable this feature."); - } - // Validate the configuration if (request.Config == null) { throw new ArgumentException("Bot configuration is required"); } + // Check if trading_future feature flag is enabled (only for Futures trading types) + if (request.Config.TradingType == TradingType.Futures || request.Config.TradingType == TradingType.BacktestFutures) + { + var isTradingFutureEnabled = await _flagsmithService.IsFeatureEnabledAsync(request.User.Name, "trading_future"); + if (!isTradingFutureEnabled) + { + throw new InvalidOperationException( + "Futures trading is not enabled for your account. Please contact support to enable this feature."); + } + } + if (request.Config.Scenario == null || !request.Config.Scenario.Indicators.Any()) { throw new InvalidOperationException(