For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Support Center
OverviewAPIResources
OverviewAPIResources
  • REST API Endpoints
    • GETGet Timestamp
    • GETO IDC User Info
      • POSTCancel Order
      • GETCommand Dependents
      • GETCommand Item
      • GETCommand Items
      • GETCommand L Dependents
      • GETCommand List
      • GETCommand Report Dependents
      • GETCommand Report Item
      • GETCommand Report Items
      • GETCommand Report L Dependents
      • GETCommand Report List
      • POSTDry Run
      • GETExecution Report Dependents
      • GETExecution Report Item
      • GETExecution Report Items
      • GETExecution Report L Dependents
      • GETExecution Report List
      • GETFill Dependents
      • GETFill Fee Dependents
      • GETFill Fee Item
      • GETFill Fee Items
      • GETFill Fee L Dependents
      • GETFill Fee List
      • GETFill Item
      • GETFill Items
      • GETFill L Dependents
      • GETFill List
      • POSTInterrupt Order Strategy
      • POSTLiquidate Position
      • POSTLiquidate Positions
      • POSTModify Order
      • POSTModify Order Strategy
      • GETOrder Dependents
      • GETOrder Item
      • GETOrder Items
      • GETOrder L Dependents
      • GETOrder List
      • GETOrder Strategy Dependents
      • GETOrder Strategy Item
      • GETOrder Strategy Items
      • GETOrder Strategy L Dependents
      • GETOrder Strategy Link Dependents
      • GETOrder Strategy Link Item
      • GETOrder Strategy Link Items
      • GETOrder Strategy Link L Dependents
      • GETOrder Strategy Link List
      • GETOrder Strategy List
      • GETOrder Version Dependents
      • GETOrder Version Item
      • GETOrder Version Items
      • GETOrder Version L Dependents
      • GETOrder Version List
      • POSTPlace OCO
      • POSTPlace OSO
      • POSTPlace Order
      • POSTStart Order Strategy
Support Center
LogoLogo
REST API EndpointsOrders

Start Order Strategy

POST
https://demo-d.tradovateapi.com/v1/orderStrategy/startorderstrategy
POST
/v1/orderStrategy/startorderstrategy
1const url = 'https://demo-d.tradovateapi.com/v1/orderStrategy/startorderstrategy';
2const options = {
3 method: 'POST',
4 headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
5 body: '{"symbol":"string","orderStrategyTypeId":1,"action":"Buy"}'
6};
7
8try {
9 const response = await fetch(url, options);
10 const data = await response.json();
11 console.log(data);
12} catch (error) {
13 console.error(error);
14}
200Successful
1{
2 "errorText": "string",
3 "failureReason": "AccountClosed",
4 "orderStrategy": {
5 "accountId": 1,
6 "timestamp": "2024-01-15T09:30:00Z",
7 "contractId": 1,
8 "orderStrategyTypeId": 1,
9 "action": "Buy",
10 "status": "ActiveStrategy",
11 "id": 1,
12 "initiatorId": 1,
13 "params": "string",
14 "uuid": "string",
15 "failureMessage": "string",
16 "senderId": 1,
17 "customTag50": "string",
18 "userSessionId": 1
19 }
20}
### 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).
Was this page helpful?
Previous

Contract Dependents

Next
Built with

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.

1const URL = 'wss://demo.tradovateapi.com/v1/websocket'
2
3const params = {
4 entryVersion: {
5 orderQty: 1,
6 orderType: "Market"
7 },
8 brackets: [{
9 qty: 1,
10 profitTarget: -30,
11 stopLoss: 15,
12 trailingStop: false
13 }]
14}
15
16const body = {
17 accountId: myAcctId,
18 accountSpec: name,
19 symbol: 'MESM1',
20 action: 'Sell',
21 orderStrategyTypeId: 2, //2 is 'multibracket', we currently only offer this strategy but more may exist in the future.
22 params: JSON.stringify(params)
23}
24
25const mySocket = new WebSocket(URL)
26
27//authorize socket using your access token
28mySocket.onopen = function() {
29 mySocket.send(`authorize\n0\n\n${accessToken}`)
30}
31
32mySocket.send(`orderstrategy/startorderstrategy\n4\n\n${JSON.stringify(body)}`)

For more details about working with advanced order types, see placeOrder, placeOCO, and 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
isAutomatedbooleanOptional

Response

OrderStrategyStatusResponse
errorTextstring<=8192 characters

Non-empty if the request failed

failureReasonenum
AccountClosed, AdvancedTrailingStopUnsupported, AnotherCommandPending, BackMonthProhibited, ExecutionProviderNotConfigured, ExecutionProviderUnavailable, InvalidContract, InvalidPrice, KeyInformationDocumentRequired, LiquidationOnly, LiquidationOnlyBeforeExpiration, MaxOrderQtyIsNotSpecified, MaxOrderQtyLimitReached, MaxPosLimitMisconfigured, MaxPosLimitReached, MaxTotalPosLimitReached, MultipleAccountPlanRequired, NoQuote, NotEnoughLiquidity, OtherExecutionRelated, ParentRejected, RiskCheckTimeout, SSFRiskDisclosureAcknowledgmentRequired, SessionClosed, Success, TooLate, TradingLocked, TrailingStopNonOrderQtyModify, Unauthorized, UnknownReason, Unsupported
orderStrategyobject