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

Place OSO

POST
https://demo-d.tradovateapi.com/v1/order/placeoso
POST
/v1/order/placeoso
1const url = 'https://demo-d.tradovateapi.com/v1/order/placeoso';
2const options = {
3 method: 'POST',
4 headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
5 body: '{"action":"Buy","symbol":"string","orderQty":1,"orderType":"Limit","bracket1":{"action":"Buy","orderType":"Limit"}}'
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 "failureReason": "AccountClosed",
3 "failureText": "string",
4 "orderId": 1,
5 "oso1Id": 1,
6 "oso2Id": 1
7}
### Place an Order Sends Order order strategy. In the Trader application, the details of OSO orders can be viewed by adding the Order Ticket module to your workspace and selecting the Advanced workspace options with Brackets enabled. OSO orders allow for the most complex multi-bracket trading strategies. As an example, imagine MESM1 is trading around 4175.00 points. You want to place a Buy order for 4150.00 points, buying below market. We place an OSO to take profits at 4200.00 points. If the initial order is filled, the `bracket1` order will be sent. Below is an example in JavaScript: ```js const URL = 'demo.tradovateapi.com/v1' const oso = { action: 'Sell', orderType: 'Limit', price: 4200.00, } const initial = { accountSpec: yourUserName, accountId: yourAcctId, action: "Buy", symbol: "MESM1", orderQty: 1, orderType: "Limit", price: 4150.00, isAutomated: true //must be true if this isn't an order made directly by a human bracket1: oso } const response = await fetch(URL + '/order/placeOSO', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': `Bearer ${myAccessToken}`, }, body: JSON.stringify(initial) }) const json = await response.json() // { orderId: 0000000 } ``` >*Note:* If you specify both `bracket1` and `bracket2` the two orders will be linked as an OCO, where filling one will cancel the other.
Was this page helpful?
Previous

Place Order

Next
Built with

Place an Order Sends Order order strategy.

In the Trader application, the details of OSO orders can be viewed by adding the Order Ticket module to your workspace and selecting the Advanced workspace options with Brackets enabled. OSO orders allow for the most complex multi-bracket trading strategies. As an example, imagine MESM1 is trading around 4175.00 points. You want to place a Buy order for 4150.00 points, buying below market. We place an OSO to take profits at 4200.00 points. If the initial order is filled, the bracket1 order will be sent. Below is an example in JavaScript:

1const URL = 'demo.tradovateapi.com/v1'
2
3const oso = {
4 action: 'Sell',
5 orderType: 'Limit',
6 price: 4200.00,
7}
8
9const initial = {
10 accountSpec: yourUserName,
11 accountId: yourAcctId,
12 action: "Buy",
13 symbol: "MESM1",
14 orderQty: 1,
15 orderType: "Limit",
16 price: 4150.00,
17 isAutomated: true //must be true if this isn't an order made directly by a human
18 bracket1: oso
19}
20
21const response = await fetch(URL + '/order/placeOSO', {
22 method: 'POST',
23 headers: {
24 'Accept': 'application/json',
25 'Authorization': `Bearer ${myAccessToken}`,
26 },
27 body: JSON.stringify(initial)
28})
29
30const json = await response.json() // { orderId: 0000000 }

Note: If you specify both bracket1 and bracket2 the two orders will be linked as an OCO, where filling one will cancel the other.

Authentication

AuthorizationBearer

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

Request

This endpoint expects an object.
actionenumRequired
Buy, Sell
Allowed values:
symbolstringRequired<=64 characters
orderQtyintegerRequired>=0
orderTypeenumRequired
Limit, MIT, Market, QTS, Stop, StopLimit, TrailingStop, TrailingStopLimit
bracket1objectRequired
accountSpecstringOptional<=64 characters
accountIdlongOptional
clOrdIdstringOptional<=64 characters
pricedoubleOptional
stopPricedoubleOptional
maxShowintegerOptional>=0
pegDifferencedoubleOptional
timeInForceenumOptional
Day, FOK, GTC, GTD, IOC
Allowed values:
expireTimedatetimeOptional
textstringOptional<=64 characters
activationTimedatetimeOptional
customTag50stringOptional<=64 characters
isAutomatedbooleanOptional
bracket2objectOptional

Response

PlaceOsoResult
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
failureTextstring<=8192 characters
orderIdlong
oso1Idlong
oso2Idlong