Update OpenPositionCommandHandler and OpenSpotPositionCommandHandler to use consistent quantity for TakeProfit trades
- Modified the TakeProfit trade quantity assignment in both handlers to use position.Open.Quantity instead of the previously used quantity variable, ensuring consistency with StopLoss trades.
This commit is contained in:
@@ -123,7 +123,7 @@ namespace Managing.Application.Trading.Handlers
|
||||
position.TakeProfit1 = exchangeService.BuildEmptyTrade(
|
||||
request.Ticker,
|
||||
takeProfitPrice,
|
||||
quantity,
|
||||
position.Open.Quantity, // Use same quantity as StopLoss for consistency
|
||||
closeDirection,
|
||||
request.MoneyManagement.Leverage,
|
||||
TradeType.TakeProfit,
|
||||
|
||||
@@ -121,7 +121,7 @@ public class OpenSpotPositionCommandHandler(
|
||||
position.TakeProfit1 = exchangeService.BuildEmptyTrade(
|
||||
request.Ticker,
|
||||
takeProfitPrice,
|
||||
quantity,
|
||||
position.Open.Quantity, // Use same quantity as StopLoss for consistency
|
||||
TradeDirection.Short,
|
||||
1, // Spot trading has no leverage
|
||||
TradeType.TakeProfit,
|
||||
|
||||
Reference in New Issue
Block a user