Refactor user settings management to remove IsGmxEnabled and DefaultExchange from updatable fields, introducing GmxSlippage instead. Update UserController, UserService, and related DTOs to reflect these changes, ensuring proper handling of user settings. Adjust database schema and migrations to accommodate the new GmxSlippage property, enhancing user customization options for trading configurations.

This commit is contained in:
2025-12-30 07:19:08 +07:00
parent aa3b06bbe4
commit 21d87efeee
23 changed files with 1908 additions and 32 deletions

View File

@@ -73,6 +73,10 @@ namespace Managing.Application.Trading.Handlers
var stopLossPrice = RiskHelpers.GetStopLossPrice(request.Direction, openPrice, request.MoneyManagement);
var takeProfitPrice = RiskHelpers.GetTakeProfitPrice(request.Direction, openPrice, request.MoneyManagement);
// Get user's slippage setting from IndicatorComboConfig
var config = TradingBox.CreateConfigFromUserSettings(request.User);
var allowedSlippage = request.User.GmxSlippage ?? config.GmxSlippage;
var trade = await exchangeService.OpenTrade(
account,
request.Ticker,
@@ -84,7 +88,8 @@ namespace Managing.Application.Trading.Handlers
isForPaperTrading: request.IsForPaperTrading,
currentDate: request.Date,
stopLossPrice: stopLossPrice,
takeProfitPrice: takeProfitPrice);
takeProfitPrice: takeProfitPrice,
allowedSlippage: allowedSlippage);
position.Open = trade;