# Limit sell order fails with insufficient quantity even when the quantity is correct

**URL:** <https://forum.alpaca.markets/t/limit-sell-order-fails-with-insufficient-quantity-even-when-the-quantity-is-correct/2251>\
**Category:** Alpaca Trading\
**Created:** [August 3, 2020, 7:38pm UTC](https://forum.alpaca.markets/t/limit-sell-order-fails-with-insufficient-quantity-even-when-the-quantity-is-correct/2251 "2020-08-03T19:38:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudaAlpacaForum](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rudaAlpacaForum](https://forum.alpaca.markets/u/rudaAlpacaForum)\
**Post date:** [August 3, 2020, 7:38pm UTC](https://forum.alpaca.markets/t/limit-sell-order-fails-with-insufficient-quantity-even-when-the-quantity-is-correct/2251/1 "2020-08-03T19:38:09Z")

</div>

Here is the log from my program:

_Latest position symbol NAIL filled orders._  
_8/3/2020 7:29:46 PM: 75f2b966-f3c9-4f5d-8b40-36f6a78ed20f: FilledAtUtc: 8/3/2020 7:19:12 PM, FilledAt: 43.31 (Filled Market 23 Buy)_  
_NAIL: AverageEntryPrice: $43.31, UnrealizedProfitLossPercent: -0.2770722696836758, Quantity: 23_  
_Attempting to place limit sell order for NAIL for quantity: 23 at price 43.19 (Place time: 8/3/2020 7:29:46 PM)._  
_**Exception: Alpaca.Markets.RestClientErrorException: insufficient qty available for order (requested: 23, available: 0)**_

As can be seen above, the buy order was filled successfully at 8/3/2020 7:19:12 PM (UTC) for a quantity of 23. The \_tradingClient.GetPositionAsync(symbol) API call correctly reports the quantity as 23. However when the limit order is placed at 8/3/2020 7:29:46 PM (UTC) for the same quantity, the API reports that the available quantity is 0.

What is going on?

---

<div class="post-metadata">

**Author:** ![Shlomik](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/shlomik/32/793_2.png) [@Shlomik](https://forum.alpaca.markets/u/Shlomik)\
**Post date:** [August 5, 2020, 2:24pm UTC](https://forum.alpaca.markets/t/limit-sell-order-fails-with-insufficient-quantity-even-when-the-quantity-is-correct/2251/2 "2020-08-05T14:24:04Z")

</div>

Hi,  
I’ve seen this happen when you have another opened order for the same amount on the same position (e.g you used a bracket order, and then tried to close the position manually without cancelling the stop\_loos / take\_profit orders)

make sure you don’t have any other orders, and then try close your position.
