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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user