Bracket Order BUY with Limit type instead of Market
See original GitHub issueWhen trying to buy using Bracket order , instead of doing Market order on BUY trying to do Limit, order type I get an error. is that excepted? I have verified that orderDto.BuyPrice has value and if I change LimitOrder.Buy to MarketOrder.Buy it works
var order = await AlpacaTradingClientStrategy.GetAlpacaTradingClient().PostOrderAsync(
LimitOrder.Buy(orderDto.Symbol, orderDto.Quantity, orderDto.BuyPrice)
.WithDuration(TimeInForce.Gtc)
.Bracket(
stopLossStopPrice: orderDto.BuyPrice * orderDto.StopLossPricePercent,
takeProfitLimitPrice: orderDto.BuyPrice * orderDto.TakeProfitLimitPricePercent
));
Alpaca.Markets.RestClientErrorException: limit orders require a limit price
at Alpaca.Markets.HttpResponseMethodExtensions.DeserializeAsync[TApi,TJson](HttpResponseMessage response)
at Alpaca.Markets.HttpResponseMethodExtensions.DeserializeAsync[TApi,TJson](HttpResponseMessage response)
at Alpaca.Markets.HttpClientExtensions.callAndDeserializeAsync[TApi,TJson](HttpClient httpClient, HttpRequestMessage request, CancellationToken cancellationToken, IThrottler throttler)
at Alpaca.Markets.HttpClientExtensions.callAndDeserializeAsync[TApi,TJson,TContent](HttpClient httpClient, HttpMethod method, Uri endpointUri, TContent content, CancellationToken cancellationToken, IThrottler throttler)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Bracketed Buy Order
A bracketed order is a type of trade used by market professionals to limit potential loss and lock in profits by surrounding the...
Read more >Bracket Orders
Bracket orders are designed to help limit your loss and lock in a profit by "bracketing" an order with two opposite-side orders. A...
Read more >3 Order Types: Market, Limit and Stop Orders
A limit order is an order to buy or sell a stock with a restriction on the maximum price to be paid (with...
Read more >How to Use Bracket Orders in Day Trading - DTTW™
A bracket order is an order type that combines a market order and limit orders. The goal is to make maximum returns and...
Read more >Advanced Stock Order Types to Fine-Tune Your Market Trades
If you enter a long position, a bracket order will immediately place an OCO sell limit (take profit) and sell stop. If you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@citestaccount You can test the fix in the version 3.9.1 already available on the NuGet.
this works Thanks!!