# Can I send 2 OSO order ,if one filled then cancel other

**URL:** <https://community.tradovate.com/t/can-i-send-2-oso-order-if-one-filled-then-cancel-other/4446>\
**Category:** API Developers\
**Created:** [April 14, 2022, 4:01am UTC](https://community.tradovate.com/t/can-i-send-2-oso-order-if-one-filled-then-cancel-other/4446 "2022-04-14T04:01:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangdc007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/zhangdc007/32/1792_2.png) [@zhangdc007](https://community.tradovate.com/u/zhangdc007)\
**Post date:** [April 14, 2022, 4:01am UTC](https://community.tradovate.com/t/can-i-send-2-oso-order-if-one-filled-then-cancel-other/4446/1 "2022-04-14T04:01:42Z")

</div>

I want put 2 OSO order in one time,for example,8:00 am ，now mnq is 14500,  
place first OSO:  
buy stop 14510 , bracket1 Sell 14520 limit ,bracket2 Sell stop 14490,  
place second OSO:  
sell stop 14490 , bracket1 buy 14480 limit ,bracket2 buy stop 14500

I need cancel one order when other order is filled,

does it can use OCO with 2 OSO ? or I need sub the order filled event ,cancel orther order?  
how can I sub the order filled event?

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [April 14, 2022, 1:19pm UTC](https://community.tradovate.com/t/can-i-send-2-oso-order-if-one-filled-then-cancel-other/4446/2 "2022-04-14T13:19:59Z")

</div>

You could watch for a few things. You’ll need to use a realtime data websocket. Once you’ve established a real-time data synchronization, these events will come through the socket like this:

```auto
[
  {
    e: 'props',
    d: {
      eventType: 'Created' | 'Updated',
      entityType: string, //there are a lot of options. I'll include a link for more info
      entity: Object //one of our Tradovate Entities. entityType determines its shape.
    }
  },
  //maybe more than one prop per response, make sure to process each item
]

```

You start the subscription to these events by calling the `user/syncrequest` endpoint on the WebSocket you want to listen to these events through.

One entity that you could look for is your Position (`entityType === 'position')`. When you have an open position, the position related to the contract that you’re trading will have a `netPos !== 0` (could be positive or negative). When that position becomes 0 again, it’s been flattened. You can watch to see if your netPos has flattened and then send the next order.

ExecutionReports (`entityType === 'executionReport'`) are useful for finding out what actions (`Commands`) you took that made it to execution. If an ExecutionReport has to do with an order, it will have `execType === 'OrderStatus'`. Then it will also have another field, `ordStatus`. This will tell you what happened to the order, including if it was filled (`ordStatus === 'Filled'`)

You can look at a good list of the possible entity types [in the docs for SyncRequest](https://api.tradovate.com/#operation/syncRequest). Expand the Sync Response object below the definition for a good reference on what types of entities there can be.

---

<div class="post-metadata">

**Author:** ![zhangdc007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/zhangdc007/32/1792_2.png) [@zhangdc007](https://community.tradovate.com/u/zhangdc007)\
**Post date:** [April 17, 2022, 6:56pm UTC](https://community.tradovate.com/t/can-i-send-2-oso-order-if-one-filled-then-cancel-other/4446/3 "2022-04-17T18:56:55Z")

</div>

Thank alex,OK ,now I can send 2 OSO order in up and down piont,and sub the fill prop event of one OSO order, to cancel other OSO order,but there has 3 order Id in one OSO request: orderId ,oso1Id, oso2Id  
,my question is Does I only need cancel the orderId is OK,TR server will cancel the oso1Id and oso2Id,  
or I need cancel all the 3 Id?

---

<div class="post-metadata">

**Author:** ![zhangdc007](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/zhangdc007/32/1792_2.png) [@zhangdc007](https://community.tradovate.com/u/zhangdc007)\
**Post date:** [April 19, 2022, 1:56am UTC](https://community.tradovate.com/t/can-i-send-2-oso-order-if-one-filled-then-cancel-other/4446/4 "2022-04-19T01:56:05Z")

</div>

OK，I tested,just need cancel the pending order,

---

<div class="post-metadata">

**Author:** ![Clayhams](https://avatars.discourse-cdn.com/v4/letter/c/4af34b/32.png) [@Clayhams](https://community.tradovate.com/u/Clayhams)\
**Post date:** [September 25, 2024, 3:22am UTC](https://community.tradovate.com/t/can-i-send-2-oso-order-if-one-filled-then-cancel-other/4446/5 "2024-09-25T03:22:00Z")

</div>

Did you ever figure this out? This is my current issue, is having pending orders cleared properly, without having to liqudate
