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?