Insufficient Balance

Under Paper trading account, I am getting this error trying to submit a sell market order on BTC.

market_order_data = MarketOrderRequest(
symbol=“BTC/USD”,
notional=25000,
side=OrderSide.SELL,
time_in_force=TimeInForce.GTC
)

market_order = trading_client.submit_order(
order_data=market_order_data
)

Error: {“available”:“0”,“balance”:“0”,“code”:40310000,“message”:“insufficient balance for BTC (requested: 0.495057308, available: 0)”,“symbol”:“USD”}

Update. Changed my order to “BUY” and was filled. Whats the problem with “sell”? I guess its looking for any long position to sell but Im trying to submit a short.

@biggerrisk You are correct. The original order was trying to sell BTC and you didn’t hold any BTC. Alpaca doesn’t support shorting crypto.

I am hitting the same error.
When I query positions query it says I have 0.071761091 . So I issue a limit sell of all the quantity available but it errors out saying available as 0.0012621. Is there a way to do a sell all without passing the notional value?

This is the response from the positions api
{
“asset_id”: “64bbff51-59d6-4b3c-9351-13ad85e3c752”,
“symbol”: “BTCUSD”,
“exchange”: “CRYPTO”,
“asset_class”: “crypto”,
“asset_marginable”: false,
“qty”: “0.071761091”,
“avg_entry_price”: “64352.274611301”,
“side”: “long”,
“market_value”: “4628.136552360516”,
“cost_basis”: “4617.989434439”,
“unrealized_pl”: “10.147117921516”,
“unrealized_plpc”: “0.0021973021085417”,
“unrealized_intraday_pl”: “10.147117921955310609”,
“unrealized_intraday_plpc”: “0.002197302108637”,
“current_price”: “64493.676”,
“lastday_price”: “64493.676”,
“change_today”: “0”,
“qty_available”: “0.0012621”
},

See error response below.
“{“available”:“0.0012621”,“balance”:“0.071761091”,“code”:40310000,“message”:“insufficient balance for BTC (requested: 0.071761091, available: 0.0012621)”,“symbol”:“USD”}”

@Vishal_C It appears you may have an existing sell order for BTC? That is why ‘available’ is only .0012621. There must be another order which is ‘reserving’ some of your position.

There are two solutions. 2) cancel the other order or 2) on the dashboard, select the position from the "Positions’ list and click “Liquidate”. You will then see a popup with the option to “cancel all open orders”. Select that and it will auto cancel any open orders for you.