# Error with take\_profit.limit\_price

**URL:** https://forum.alpaca.markets/t/error-with-take-profit-limit-price/14263
**Category:** Alpaca Trading
**Created:** [May 23, 2024, 3:53am UTC](https://forum.alpaca.markets/t/error-with-take-profit-limit-price/14263 "2024-05-23T03:53:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Artic](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/artic/32/7205_2.png) [@Artic](https://forum.alpaca.markets/u/Artic)
#### Post date: [May 23, 2024, 3:53am UTC](https://forum.alpaca.markets/t/error-with-take-profit-limit-price/14263/1 "2024-05-23T03:53:24Z")

</div>

I’m using a bracket order and quite frequently receive the following error:

take\_profit.limit\_price must be \>= base\_price + 0.01

How can I know what the base price is? It obviously depends on the market and is not something you can specify in a bracket order.

It seems sometimes my take\_profit.limit\_price is _below_ the “expected fill price”. But I don’t want to set my limit\_price and stop\_price to arbitrarily huge values just to ensure they meet the requirements of whatever the base\_price might be.

Can I query somehow to get the base\_price? Or how do I overcome this error?

```
    market_order_data = MarketOrderRequest(
                symbol="SPY",
                qty=10,
                side=OrderSide.BUY,
                time_in_force=TimeInForce.DAY,
                order_class=OrderClass.BRACKET,
                take_profit=TakeProfitRequest(limit_price=?),
                stop_loss=StopLossRequest(stop_price=?)

```

---

<div class="post-metadata">

### Author: ![Artic](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/artic/32/7205_2.png) [@Artic](https://forum.alpaca.markets/u/Artic)
#### Post date: [May 24, 2024, 6:20pm UTC](https://forum.alpaca.markets/t/error-with-take-profit-limit-price/14263/2 "2024-05-24T18:20:56Z")

</div>

Any help on this would be appreciated. What’s a good strategy to get around this?

---

<div class="post-metadata">

### Author: ![KelE](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@KelE](https://forum.alpaca.markets/u/KelE)
#### Post date: [June 12, 2024, 12:30pm UTC](https://forum.alpaca.markets/t/error-with-take-profit-limit-price/14263/3 "2024-06-12T12:30:38Z")

</div>

I believe this happens when you are setting your limit\_price too close to the buy price. Alpaca doesn’t play with sub-penny increments for most positions. Include some logic to either not trade a security when your limit and predicted buy are that close, or use a max function like:

limit\_p=max(predicted\_limit\_price, buy\_price+0.01)#might want to check your model if it’s constantly generating so close to null

take\_profit=TakeProfitRequest(limit\_price=limit\_p)
