# modifyOrderStrategy command schema

**URL:** <https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529>\
**Category:** API Developers\
**Created:** [April 26, 2022, 7:37pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529 "2022-04-26T19:37:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://community.tradovate.com/u/Arthur)\
**Post date:** [April 26, 2022, 7:37pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/1 "2022-04-26T19:37:56Z")

</div>

Now that API bracket orders are working 🙌, can someone provide an example of what a command body string typically looks like? The documentation is extremely vague!

---

<div class="post-metadata">

**Author:** ![Howard](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@Howard](https://community.tradovate.com/u/Howard)\
**Post date:** [May 19, 2022, 7:55pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/2 "2022-05-19T19:55:50Z")

</div>

bump post I would like to know as well

---

<div class="post-metadata">

**Author:** ![Long\_Nguyen](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@Long\_Nguyen](https://community.tradovate.com/u/Long_Nguyen)\
**Post date:** [May 21, 2022, 2:01pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/3 "2022-05-21T14:01:46Z")

</div>

+1 I would love to see an example of this as well

---

<div class="post-metadata">

**Author:** ![Epictetzu](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Epictetzu](https://community.tradovate.com/u/Epictetzu)\
**Post date:** [May 26, 2022, 3:10am UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/4 "2022-05-26T03:10:01Z")

</div>

This is how I send it to the websocket. The user data comes from a user sync from the websocket.

```auto
fn place_bracket_limit_order(&mut self, user_data: &UserSyncData, qty: i64, price: f64,
    take_profit: f64, stop_loss: f64, trailing_stop: bool, symbol: &str, action: &str){
    
        let params = json!({
        "entryVersion": {
            "orderQty": qty,
            "orderType": "Limit",
            "price": price
        },
        "brackets": [{
            "qty": qty,
            "profitTarget": take_profit,
            "stopLoss": stop_loss,
            "trailingStop": trailing_stop
        }]
    });
    let body = json!({
        "accountId": user_data.accounts[0].id,
        "accountSpec": user_data.accounts[0].name,
        "symbol": symbol,
        "action": action,
        "orderStrategyTypeId": 2,
        "is_automated": true,
        "params": params.to_string()
        
    });
    let endpoint: &str = "orderStrategy/startOrderStrategy";
    let body_string: String = format!("\n{}", body.to_string());//This endpoint requires an extra newline before body because it's a POST endpoint
    self.socket_request(endpoint, body_string, None);
}

```

---

<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:** [May 27, 2022, 2:36pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/5 "2022-05-27T14:36:43Z")

</div>

Nice work @Epictetzu. You might be our first Rustacean!

---

<div class="post-metadata">

**Author:** ![Epictetzu](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Epictetzu](https://community.tradovate.com/u/Epictetzu)\
**Post date:** [May 27, 2022, 4:39pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/6 "2022-05-27T16:39:55Z")

</div>

👍It helped me understand it better if I just did it in rust. And thanks for all your tutorials and forum posts. They were enough that I didn’t have any questions without answers already on the forum.

---

<div class="post-metadata">

**Author:** ![Juan\_Marquez](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@Juan\_Marquez](https://community.tradovate.com/u/Juan_Marquez)\
**Post date:** [May 31, 2022, 5:21am UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/7 "2022-05-31T05:21:37Z")

</div>

> **[GitHub - numberjuani/tradovate-api](https://github.com/numberjuani/tradovate-api)**
>
> Contribute to numberjuani/tradovate-api development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://community.tradovate.com/u/Arthur)\
**Post date:** [June 1, 2022, 2:55am UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/8 "2022-06-01T02:55:08Z")

</div>

Wow, very cool to see everyone’s implementations!

One thing I _will_ say is that the original question was asking about the `modifyOrderStrategy` command body, not `startOrderStrategy`.

This (from the API documentation) is not very instructive:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/tradingforum/original/2X/1/12998335a09bcae83d2e457809c846798f59d739.png)

However, I will share what I learned about submitting bracket orders.

When you send an order via `startOrderStrategy`, it reserves a contiguous block of order ids and assigns them to separate orders. If you want to modify the strategy, you need to dissect how the API is reserving each of the order ids and use `modifyOrder` to modify that specific order.

It is a lot more opaque than using individual orders – it still suffers from p-time delays (without telling you), and honestly, it is not very reliable (many order blocks are assigned inconsistently). After playing around with `startOrderStrategy` for a couple weeks, I decided to scrap using it altogether and go back to manually recreating brackets using individual orders.

---

<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:** [September 29, 2022, 12:23pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/9 "2022-09-29T12:23:30Z")

</div>

but the quetion is modifyorderstrategy,the api doc schema demo is

```auto
{
  "orderStrategyId": 60783294,
  "command": "tempor reprehenderit",
  "customTag50": "nulla id"
}

```

but who knows the command formate or demo? @Alexander

---

<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:** [September 29, 2022, 12:39pm UTC](https://community.tradovate.com/t/modifyorderstrategy-command-schema/4529/10 "2022-09-29T12:39:41Z")

</div>

I use this method to soft this problem  
1: the strategy main order is not filed:  
you can cancel first and send a new strategy order  
2:the strategy main order is filed:  
you can recored the bracket order and one by one modify modify them use the API modifyorder

```auto
{
  "orderId": 111111,
  "orderQty": 1,
  "orderType": "Stop",
  "stopPrice": 3700.00,
  "timeInForce": "Day",
  "isAutomated": true
}

```
