Fix spot bot
This commit is contained in:
@@ -255,7 +255,7 @@ public class BotController : BaseController
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error stopping bot {Identifier}", identifier);
|
||||
|
||||
|
||||
// Check if this is an Orleans exception that wasn't caught earlier
|
||||
if (OrleansExceptionHelper.IsOrleansException(ex))
|
||||
{
|
||||
@@ -265,7 +265,7 @@ public class BotController : BaseController
|
||||
identifier, ex.GetType().Name);
|
||||
return StatusCode(503, userMessage);
|
||||
}
|
||||
|
||||
|
||||
return StatusCode(500, $"Error stopping bot: {ex.Message}");
|
||||
}
|
||||
}
|
||||
@@ -814,7 +814,7 @@ public class BotController : BaseController
|
||||
UseForSignalFiltering = request.Config.UseForSignalFiltering,
|
||||
UseForDynamicStopLoss = request.Config.UseForDynamicStopLoss,
|
||||
// Set computed/default properties
|
||||
TradingType = TradingType.Futures,
|
||||
TradingType = request.Config.TradingType,
|
||||
FlipPosition = request.Config.FlipPosition,
|
||||
Name = request.Config.Name
|
||||
};
|
||||
@@ -955,6 +955,13 @@ public class BotController : BaseController
|
||||
}
|
||||
}
|
||||
|
||||
var tradingType = request.Config.TradingType switch
|
||||
{
|
||||
TradingType.BacktestFutures => TradingType.Futures,
|
||||
TradingType.BacktestSpot => TradingType.Spot,
|
||||
_ => TradingType.Futures
|
||||
};
|
||||
|
||||
// Map the request to the full TradingBotConfig
|
||||
var config = new TradingBotConfig
|
||||
{
|
||||
@@ -976,9 +983,9 @@ public class BotController : BaseController
|
||||
UseForSignalFiltering = request.Config.UseForSignalFiltering,
|
||||
UseForDynamicStopLoss = request.Config.UseForDynamicStopLoss,
|
||||
// Set computed/default properties
|
||||
TradingType = TradingType.Futures,
|
||||
FlipPosition = request.Config.FlipPosition,
|
||||
Name = request.Config.Name
|
||||
Name = request.Config.Name,
|
||||
TradingType = tradingType
|
||||
};
|
||||
|
||||
return (config, user);
|
||||
|
||||
Reference in New Issue
Block a user