C# sdk takeprofit order

Hi there, i’m new to testing out this c# sdk and trying to test putting in a market order with a stoploss and a take profit amount all in one request, is this possible?

I’ve tried this way below by providing just the amount of the profit to take and it never closes out taking the profit. I’ve also tried adding 0.1M to the price value and that didnt work either. Does anyone know how to put in an order while supplying the profit amount to close out the order on and also a stop loss?

var order = await alpacaTradingClient.PostOrderAsync(
new NewOrderRequest(
symbol, quantity, side, OrderType.Limit, TimeInForce.Day)
LimitPrice = price,
TakeProfitLimitPrice = 0.1M,
StopLossStopPrice = 0.1M

Solution was to include Bracket type as Bracket then it went through.

1 Like

Glad to know it is resolved. We are going to add more code snippets in our docs.