Start Order Strategy

### Start a multi-bracket trading strategy. This endpoint is used with a WebSocket. You can create any number of brackets and add them to `brackets` field on the `params` object as a JSON string. ```js const URL = 'wss://demo.tradovateapi.com/v1/websocket' const params = { entryVersion: { orderQty: 1, orderType: "Market" }, brackets: [{ qty: 1, profitTarget: -30, stopLoss: 15, trailingStop: false }] } const body = { accountId: myAcctId, accountSpec: name, symbol: 'MESM1', action: 'Sell', orderStrategyTypeId: 2, //2 is 'multibracket', we currently only offer this strategy but more may exist in the future. params: JSON.stringify(params) } const mySocket = new WebSocket(URL) //authorize socket using your access token mySocket.onopen = function() { mySocket.send(`authorize\n0\n\n${accessToken}`) } mySocket.send(`orderstrategy/startorderstrategy\n4\n\n${JSON.stringify(body)}`) ``` For more details about working with advanced order types, see [placeOrder](/#operation/placeOrder), [placeOCO](/#operation/placeOCO), and [placeOSO](/#operation/placeOSO).

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
symbolstringRequired<=64 characters
orderStrategyTypeIdlongRequired
actionenumRequired
Buy, Sell
Allowed values:
accountIdlongOptional
accountSpecstringOptional<=64 characters
paramsstringOptional<=8192 characters
uuidstringOptional<=64 characters
customTag50stringOptional<=64 characters

Response

OrderStrategyStatusResponse
errorTextstring or null<=8192 characters

Non-empty if the request failed

orderStrategyobject or null