# Oco one cancels other orders

**URL:** <https://forum.alpaca.markets/t/oco-one-cancels-other-orders/1545>\
**Category:** Alpaca Integration Applications\
**Created:** [May 22, 2020, 10:26pm UTC](https://forum.alpaca.markets/t/oco-one-cancels-other-orders/1545 "2020-05-22T22:26:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomaswadeculbertson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/thomaswadeculbertson/32/233_2.png) [@thomaswadeculbertson](https://forum.alpaca.markets/u/thomaswadeculbertson)\
**Post date:** [May 22, 2020, 10:26pm UTC](https://forum.alpaca.markets/t/oco-one-cancels-other-orders/1545/1 "2020-05-22T22:26:30Z")

</div>

I have a system running that uses python.  
I have noticed that I can greatly simplify my code if I can get the order placed in a certain fashion.  
I want to place the first position with a simple buy, which no problem. Then I want to place a second oco order to liquidate my position at x if price increases and to buy more if it goes down  
Example I buy 10 shares at 100. I want the order to sell the 10 if the price hits 110 and to buy an additional 15 shares if it drops to 90.

Is it possible to do this with a oco order? If so can you show how the order would look in python.

Thanks

> Blockquote

---

<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 23, 2020, 4:41am UTC](https://forum.alpaca.markets/t/oco-one-cancels-other-orders/1545/2 "2020-05-23T04:41:22Z")

</div>

No, currently OCO order is to exit your position. There may be future enhancements to support something like this.

---

<div class="post-metadata">

**Author:** ![thomaswadeculbertson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/thomaswadeculbertson/32/233_2.png) [@thomaswadeculbertson](https://forum.alpaca.markets/u/thomaswadeculbertson)\
**Post date:** [May 24, 2020, 9:51pm UTC](https://forum.alpaca.markets/t/oco-one-cancels-other-orders/1545/3 "2020-05-24T21:51:08Z")

</div>

Hello again  
This code if from\>\>[https://blog.alpaca.markets/blog/oco-oto-on-alpaca](https://blog.alpaca.markets/blog/oco-oto-on-alpaca)  
“side”: “sell”,  
“symbol”: “AAPL”,  
“type”: “limit”,  
“qty”: “10”,  
“time\_in\_force”: “gtc”,  
“order\_class”: “oco”,  
“take\_profit”: {  
“limit\_price”: “325”  
},  
“stop\_loss”: {  
“stop\_price”: “250”,  
“limit\_price”: “249.5”  
}  
1.Could you please translate it to Python?  
2.Is there a call that would allow me to execute the above code from within Python?  
Thanks for your continuing help.  
Thomas
