# Trying to Short at the open then close out the short at the close but getting error

**URL:** <https://forum.alpaca.markets/t/trying-to-short-at-the-open-then-close-out-the-short-at-the-close-but-getting-error/5928>\
**Category:** Alpaca Trading\
**Created:** [June 9, 2021, 2:59pm UTC](https://forum.alpaca.markets/t/trying-to-short-at-the-open-then-close-out-the-short-at-the-close-but-getting-error/5928 "2021-06-09T14:59:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peck](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Peck](https://forum.alpaca.markets/u/Peck)\
**Post date:** [June 9, 2021, 2:59pm UTC](https://forum.alpaca.markets/t/trying-to-short-at-the-open-then-close-out-the-short-at-the-close-but-getting-error/5928/1 "2021-06-09T14:59:00Z")

</div>

I am trying to sell at the open with a market order then close out my short with a market order at market close. If possible I would like to submit these orders the previous day (after 7:00pm EST). I am getting the ‘cannot open a long buy while a short order is open’. Is there a trigger that can be used for the buy order or a way to have both of them placed the night before?

---

<div class="post-metadata">

**Author:** ![Mallory](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/mallory/32/2684_2.png) [@Mallory](https://forum.alpaca.markets/u/Mallory)\
**Post date:** [June 9, 2021, 3:03pm UTC](https://forum.alpaca.markets/t/trying-to-short-at-the-open-then-close-out-the-short-at-the-close-but-getting-error/5928/2 "2021-06-09T15:03:43Z")

</div>

Hey @Peck - I answered a similar question yesterday and will post my answer here as well:

Looks like you’re going to want to make use of Bracket Orders, which are defined in this doc: [Understand Orders - Documentation | Alpaca](https://alpaca.markets/docs/trading-on-alpaca/orders/)

Without a bracket order, you would not be able to submit both entry and exit orders simultaneously since Alpaca’s system only accepts exit orders for existing positions. Additionally, even if you had an open position, you would not be able to submit two conditional closing orders since Alpaca’s system would view one of the two orders as exceeding the available position quantity. Bracket orders address both of these issues, as Alpaca’s system recognizes the entry and exit orders as a group and queues them for execution appropriately.

---

<div class="post-metadata">

**Author:** ![Peck](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Peck](https://forum.alpaca.markets/u/Peck)\
**Post date:** [June 9, 2021, 3:10pm UTC](https://forum.alpaca.markets/t/trying-to-short-at-the-open-then-close-out-the-short-at-the-close-but-getting-error/5928/3 "2021-06-09T15:10:35Z")

</div>

I was looking at the Bracket orders, Is it possible to use a market order, as a stop loss and take profit both require a limit?

---

<div class="post-metadata">

**Author:** ![gigglesamurai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/gigglesamurai/32/2472_2.png) [@gigglesamurai](https://forum.alpaca.markets/u/gigglesamurai)\
**Post date:** [June 9, 2021, 4:17pm UTC](https://forum.alpaca.markets/t/trying-to-short-at-the-open-then-close-out-the-short-at-the-close-but-getting-error/5928/4 "2021-06-09T16:17:33Z")

</div>

This is the problem of Alpaca, they need to fix this soon, restriction is not good for api algo order to deal with, which is Alpaca is built for. Please fix it soon.
