# Liquidation of open positions dont work due to "insufficient qty"

**URL:** https://forum.alpaca.markets/t/liquidation-of-open-positions-dont-work-due-to-insufficient-qty/12267
**Category:** Alpaca Trading
**Created:** [April 25, 2023, 7:36pm UTC](https://forum.alpaca.markets/t/liquidation-of-open-positions-dont-work-due-to-insufficient-qty/12267 "2023-04-25T19:36:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DocMuehle](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@DocMuehle](https://forum.alpaca.markets/u/DocMuehle)
#### Post date: [April 25, 2023, 7:36pm UTC](https://forum.alpaca.markets/t/liquidation-of-open-positions-dont-work-due-to-insufficient-qty/12267/1 "2023-04-25T19:36:19Z")

</div>

Hello 😃

I want to liquidate all of my positions before the weekend. I use stop loss order:

```
    response = api.submit_order(
        symbol='TSLA',
        qty= 1,
        side='buy',
        type='market',
        time_in_force='gtc',
        order_class= 'bracket',
        take_profit= {
            'limit_price': round(recent_data['High'] * 1.02, 2)
        },
        stop_loss= {
            'stop_price': round(recent_data['Low'] * 0.98, 2)
        }
    )
    return response

```

Although there is an open position, the function “api.close\_all\_positions()” won’t liquidate but instead returns following object:

[Position({ ‘body’: { ‘available’: ‘0’,  
‘code’: 40310000,  
‘existing\_qty’: ‘1’,  
‘held\_for\_orders’: ‘1’,  
‘message’: 'insufficient qty available for order (requested: ’  
‘1, available: 0)’,  
‘symbol’: ‘TSLA’},  
‘status’: 403,  
‘symbol’: ‘TSLA’})]

What does that mean? And how can I solve this issue?

I appreciate any kind of help.  
Thank you in advance.  
Sincerely IDv MdB Mühle

---

<div class="post-metadata">

### Author: ![paul\_kara\_alphalayer](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@paul\_kara\_alphalayer](https://forum.alpaca.markets/u/paul_kara_alphalayer)
#### Post date: [April 26, 2023, 1:20pm UTC](https://forum.alpaca.markets/t/liquidation-of-open-positions-dont-work-due-to-insufficient-qty/12267/2 "2023-04-26T13:20:46Z")

</div>

I’m definitely not an expert, but I think from what i’ve read on these forums previously, it has to do with blocking quantity from being traded that is held for another order?

You have “held\_for\_orders” = 1. Not sure why that is, but seems to be related.
