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(
|
position.TakeProfit1 = exchangeService.BuildEmptyTrade(
|
||||||
request.Ticker,
|
request.Ticker,
|
||||||
takeProfitPrice,
|
takeProfitPrice,
|
||||||
quantity,
|
position.Open.Quantity, // Use same quantity as StopLoss for consistency
|
||||||
closeDirection,
|
closeDirection,
|
||||||
request.MoneyManagement.Leverage,
|
request.MoneyManagement.Leverage,
|
||||||
TradeType.TakeProfit,
|
TradeType.TakeProfit,
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class OpenSpotPositionCommandHandler(
|
|||||||
position.TakeProfit1 = exchangeService.BuildEmptyTrade(
|
position.TakeProfit1 = exchangeService.BuildEmptyTrade(
|
||||||
request.Ticker,
|
request.Ticker,
|
||||||
takeProfitPrice,
|
takeProfitPrice,
|
||||||
quantity,
|
position.Open.Quantity, // Use same quantity as StopLoss for consistency
|
||||||
TradeDirection.Short,
|
TradeDirection.Short,
|
||||||
1, // Spot trading has no leverage
|
1, // Spot trading has no leverage
|
||||||
TradeType.TakeProfit,
|
TradeType.TakeProfit,
|
||||||
|
|||||||
Reference in New Issue
Block a user