# How to detect if a filled order was a short call?

**URL:** <https://forum.alpaca.markets/t/how-to-detect-if-a-filled-order-was-a-short-call/13480>\
**Category:** Alpaca Trading\
**Created:** [January 17, 2024, 4:36pm UTC](https://forum.alpaca.markets/t/how-to-detect-if-a-filled-order-was-a-short-call/13480 "2024-01-17T16:36:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bennycode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/bennycode/32/5565_2.png) [@bennycode](https://forum.alpaca.markets/u/bennycode)\
**Post date:** [January 17, 2024, 4:36pm UTC](https://forum.alpaca.markets/t/how-to-detect-if-a-filled-order-was-a-short-call/13480/1 "2024-01-17T16:36:56Z")

</div>

When [querying the balances](https://docs.alpaca.markets/reference/getallopenpositions), I get some balances returned with a negative quantity (because I am shorting these stocks). However, when I [get all orders](https://docs.alpaca.markets/reference/getallorders), my short calls are being returned with a positive quantity (“qty” & “filled\_qty”). How can I distinguish a filled sell position (where I bought the stock before) from a filled sell position where I borrowed the stock?

---

<div class="post-metadata">

**Author:** ![jschaenzle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jschaenzle/32/5582_2.png) [@jschaenzle](https://forum.alpaca.markets/u/jschaenzle)\
**Post date:** [January 24, 2024, 2:05pm UTC](https://forum.alpaca.markets/t/how-to-detect-if-a-filled-order-was-a-short-call/13480/2 "2024-01-24T14:05:06Z")

</div>

I often find myself wishing there was a tie between a position and an order (or set of orders) by id(s) but there isn’t that I am aware of…
