Placing oso order only getting filled as limit orders

order/placeorder
3

{“accountSpec”:“xxx”,“accountId”:000,“action”:“Sell”,“timeInForce”:“Day”,“symbol”:2396936,“orderQty”:1,“orderType”:“Limit”,“price”:4268.0,“bracket1”:{“action”:“Buy”,“orderType”:“Limit”,“price”:4267.75},“isAutomated”:true}

i’ve also tried encoding the bracket order but that doesn’t work.
order/placeorder
3

{"accountSpec":"xxx","accountId":000,"action":"Sell","timeInForce":"Day","symbol":2396936,"orderQty":1,"orderType":"Limit","price":4268.0,"bracket1":"{\"action\":\"Buy\",\"orderType\":\"Limit\",\"price\":4267.75}","isAutomated":true}

These will get filled as limit orders, the brackets never fires.

I can send the same commands via separate calls and they work but doing it in a single order like above and only the first limit order is ever filled.

Can you assist in why only the first limit order is being filled?

I also tried to use the startorderstrategy endpoint but I am getting 404 errors.

bm-mesh2
SINGLE -- got stats [{'s': 200, 'i': 2, 'd': {'orderId': 3423875598}}]

The above code bm = buy_market-{symbol}
doing that, I get filled immediately, I am using the same api-websocket session to make the call below.
I notice that the startorderstrategy has a few different spellings so I copied the endpoint url from the github example

API – TEST ORDER STRATEGY

orderStrategy/startOrderStrategy
3

{"accountSpec":"xxx","accountId":000,"symbol":"MESH2","action":"Buy","orderStrategyTypeId":2,"params":"{\"entryVersion\":{\"orderQty\":1,\"orderType\":\"Market\"},\"brackets\":[{\"qty\":1,\"profitTarget\":1,\"stopLoss\":-2,\"trailingStop\":false}]}"}
SINGLE -- got stats [{'s': 404, 'i': 3, 'd': ''}]

I am getting a 404 error every time. Is the issue the endpoint spelling or the way the order is formatted?

These were wrong, the endpoint is order/placeoso but this isn’t doing what I expected.
I want to point out that the placeoso documentation has the wrong endpoint

const response = await fetch(URL + '/order/placeorder', {
    method: 'POST',
    headers: {
        'Accept': 'application/json',
        'Authorization': `Bearer ${myAccessToken}`,
    },
    body: JSON.stringify(initial)
})

The endpoint above should be order/placeoso

Can I get clarification on this orderstrategy endpoint?

I would like to send 1 order:
          if price passes X send order Y
          else
          if price passes W send order Z

I think that would work better with orderstrategy, but i am having issues with the 404 error.

> API -- TEST ORDER STRATEGY
> orderstrategy/startorderstrategy
> 2
> 
> {"accountSpec":"xxx","accountId":000,"symbol":"MESH2","action":"Buy","orderStrategyTypeId":2,"params":"{\"entryVersion\":{\"orderQty\":1,\"orderType\":\"Market\"},\"brackets\":[{\"qty\":1,\"profitTarget\":1,\"stopLoss\":-2,\"trailingStop\":false}]}"}
> SINGLE -- got stats [{'s': 404, 'i': 2, 'd': ''}]

I took the example code from here

put it in javascript console to see what valid output should look like.

bracket:

{
    "qty": 1,
    "profitTarget": 2,
    "stopLoss": -4,
    "trailingStop": true
}

order data

{
    "entryVersion": {
        "orderQty": 1,
        "orderType": "Market"
    },
    "brackets": [
        {
            "qty": 1,
            "profitTarget": 2,
            "stopLoss": -4,
            "trailingStop": true
        }
    ]
}

order object

{
    "accountId": 1221,
    "accountSpec": "name",
    "symbol": "MESH2",
    "action": "Buy",
    "orderStrategyTypeId": 2,
    "params": "{\"entryVersion\":{\"orderQty\":1,\"orderType\":\"Market\"},\"brackets\":[{\"qty\":1,\"profitTarget\":2,\"stopLoss\":-4,\"trailingStop\":true}]}"
}

my object

orderStrategy/startOrderStrategy
3

{ 
    "accountSpec":"xxx",
    "accountId":000,
    "symbol":"MESH2",
    "action":"Buy",
    "orderStrategyTypeId":2,
    "params":"{\"entryVersion\":{\"orderQty\":1,\"orderType\":\"Market\"},\"brackets\":[{\"qty\":1,\"profitTarget\":-30,\"stopLoss\":15,\"trailingStop\":false}]}"
}

Other than the order of a few variables, both objects look fine. Why am i getting 404

{'s': 404, 'i': 3, 'd': ''}

I just realized that this is an ongoing bug

The main issue I have with the placing order, oso and oco orders is the fact that after I route an order; if the price moves too fast, i’ll get order rejected because the price has already moved.

Hopefully there’s an update on this soon…