# Fok time\_in\_force orders

**URL:** <https://forum.alpaca.markets/t/fok-time-in-force-orders/354>\
**Category:** Alpaca Integration Applications\
**Created:** [October 8, 2019, 2:09pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354 "2019-10-08T14:09:12Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rathe001](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/rathe001/32/215_2.png) [@Rathe001](https://forum.alpaca.markets/u/Rathe001)\
**Post date:** [October 8, 2019, 2:09pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/1 "2019-10-08T14:09:12Z")

</div>

Every time I try to create a new order with a time\_in\_force of fok, it is immediately cancelled. Is there something I’m missing here?

I am using the Javascript API.

alpaca.createOrder({  
symbol: ‘GOOG’,  
qty: 1,  
side: ‘buy’,  
type: ‘market’,  
time\_in\_force: ‘fok’,  
})

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [October 8, 2019, 3:41pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/2 "2019-10-08T15:41:19Z")

</div>

are you using the V2 API?

---

<div class="post-metadata">

**Author:** ![hitoshi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/hitoshi/32/69_2.png) [@hitoshi](https://forum.alpaca.markets/u/hitoshi)\
**Post date:** [October 8, 2019, 3:57pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/3 "2019-10-08T15:57:54Z")

</div>

Could be helpful if you can tell us whether it’s paper or live.

---

<div class="post-metadata">

**Author:** ![Rathe001](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/rathe001/32/215_2.png) [@Rathe001](https://forum.alpaca.markets/u/Rathe001)\
**Post date:** [October 8, 2019, 8:36pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/4 "2019-10-08T20:36:48Z")

</div>

Yes, using V2, paper. I am trying this during market hours as well.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [October 8, 2019, 8:45pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/5 "2019-10-08T20:45:51Z")

</div>

My best guess is try putting a larger % on top of your order price to see if maybe the price is out of the min bid ask spread

---

<div class="post-metadata">

**Author:** ![Rathe001](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/rathe001/32/215_2.png) [@Rathe001](https://forum.alpaca.markets/u/Rathe001)\
**Post date:** [October 11, 2019, 10:36am UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/6 "2019-10-11T10:36:13Z")

</div>

You don’t specify a price at all with a market fok order, from what I can tell. My example above should just buy 1 unit of GOOG stock at whatever the current market price is. If for some reason it cannot, the order will cancel. I’d imagine cancels should be rare, since it is only a quantity of 1. I am testing around 25 stocks, and they all just immediately cancel.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [October 12, 2019, 8:17pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/7 "2019-10-12T20:17:16Z")

</div>

Just a quick answer if your trying to order a stock with a market order and the price moves up the baseline price it would be compared to would change, my best guess is your buying a stock which price is changing rapidly that is possible to cause it to be canceled using the fok standard look into different time enforcement such as ‘day’

---

<div class="post-metadata">

**Author:** ![Jak94](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jak94](https://forum.alpaca.markets/u/Jak94)\
**Post date:** [May 5, 2020, 3:31pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/8 "2020-05-05T15:31:42Z")

</div>

I noticed the same issue with the force or kill orders on the paper trading account (api v2), however everything seems to be fine on live trading.

@kris I don’t think the issue is related to the volatility of the underlying stock after the FOK order is issued, I tried with a different stocks both long and short on the paper account and all the orders get canceled.

I was wondering if there is any plan to make FOK orders to work on paper trading, or if there is already a fix that I am missing.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [May 6, 2020, 6:15pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/9 "2020-05-06T18:15:14Z")

</div>

what % collar are you using?

---

<div class="post-metadata">

**Author:** ![Jak94](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jak94](https://forum.alpaca.markets/u/Jak94)\
**Post date:** [May 13, 2020, 1:46am UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/10 "2020-05-13T01:46:46Z")

</div>

I am not sure what you mean by % collar.

To be more precise I tried to execute a **market order** with type **FOK** , so no other parameters except the quantity of the order were asked.  
The order works fine in live trading, instead it gets canceled immediately when issued on the paper trading account.

@kris let me know if you need more information.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [May 13, 2020, 3:20am UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/11 "2020-05-13T03:20:52Z")

</div>

> **[API v2 - Documentation | Alpaca](https://alpaca.markets/docs/api-documentation/api-v2/)**
>
> Alpaca API lets you build and trade with real-time market data for free.

  
look under Notes on Orders and Positions its 3rd to last

id suggest you learn the basics or you will empty out your wallet

---

<div class="post-metadata">

**Author:** ![Jak94](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jak94](https://forum.alpaca.markets/u/Jak94)\
**Post date:** [May 13, 2020, 5:53pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/12 "2020-05-13T17:53:15Z")

</div>

Thank you for the suggestion, I did and I will take a look again.

However my answer was not related to the meaning of collar %, but to the fact that during market hours executing a market order to buy a single share of a stock with FOK time in force, the order status results canceled when using a paper trading account, instead filled when using the live trading account. I issued the same order multiple times on both the paper trading account and the live trading account on different stocks, the resulting status is always canceled on the paper trading account and filled on the live trading account.

As I wrote before, I don’t think that the stock price is changing so rapidly that the order gets canceled when using FOK as time in force, instead of DAY.

I will be happy to share more information if needed.

---

<div class="post-metadata">

**Author:** ![hitoshi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/hitoshi/32/69_2.png) [@hitoshi](https://forum.alpaca.markets/u/hitoshi)\
**Post date:** [May 19, 2020, 7:16pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/13 "2020-05-19T19:16:10Z")

</div>

IOC/FOK in paper trading has had issues as simulation. The fix is hopefully being deployed in a few days.

---

<div class="post-metadata">

**Author:** ![quarantine](https://avatars.discourse-cdn.com/v4/letter/q/cc9497/32.png) [@quarantine](https://forum.alpaca.markets/u/quarantine)\
**Post date:** [August 23, 2020, 12:51am UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/14 "2020-08-23T00:51:18Z")

</div>

> [@kris](#):
>
> look under Notes on Orders and Positions its 3rd to last

Wow, I somehow missed that when I was reading through the docs:

> [@](#):
>
> Market buy orders that would increase your position (e.g. buy order for a stock where your position in that stock is \>= 0) are converted to marketable limit orders with a 2.5% to 4% price collar.

That’s not what I want from market orders. Market orders should just buy at market. Weird.

Is there any way to override this collar behavior? It basically makes the API less useful for any stock currently held. If I wanted a limit order, then I’d specify limit order.

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [August 25, 2020, 6:18pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/15 "2020-08-25T18:18:36Z")

</div>

every broker uses a collar

---

<div class="post-metadata">

**Author:** ![jabowery](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jabowery/32/1495_2.png) [@jabowery](https://forum.alpaca.markets/u/jabowery)\
**Post date:** [November 24, 2020, 8:16pm UTC](https://forum.alpaca.markets/t/fok-time-in-force-orders/354/16 "2020-11-24T20:16:10Z")

</div>

I’m getting 3/4 rejections on paper trade short sales (only 1 share @ FOK/market). While I haven’t investigated the meaning of “At this time, you are only allowed to short easy-to-borrow assets” to see if that is causing this, I have to wonder if the phrase “easy-to-borrow” isn’t specific to the broker/trading platform.
