Place OSO

### 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.

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:
expireTimestringOptionalformat: "date-time"
textstringOptional<=64 characters
activationTimestringOptionalformat: "date-time"
customTag50stringOptional<=64 characters
isAutomatedbooleanOptional
bracket2objectOptional

Response

PlaceOsoResult
failureReasonenum or null
AccountClosed, AdvancedTrailingStopUnsupported, AnotherCommandPending, BackMonthProhibited, ExecutionProviderNotConfigured, ExecutionProviderUnavailable, InvalidContract, InvalidPrice, LiquidationOnly, LiquidationOnlyBeforeExpiration, MaxOrderQtyIsNotSpecified, MaxOrderQtyLimitReached, MaxPosLimitMisconfigured, MaxPosLimitReached, MaxTotalPosLimitReached, MultipleAccountPlanRequired, NoQuote, NotEnoughLiquidity, OtherExecutionRelated, ParentRejected, RiskCheckTimeout, SessionClosed, Success, TooLate, TradingLocked, TrailingStopNonOrderQtyModify, Unauthorized, UnknownReason, Unsupported
failureTextstring or null<=8192 characters
orderIdlong or null
oso1Idlong or null
oso2Idlong or null