Orders

Place OSO

Place an OSO (order-sends-order) order strategy.

Available to: All authenticated users

Environments: Demo, Live

Rate Limit: 1,500 requests per hour, 1-second back-off, counts all requests

An OSO strategy places a primary order that, once filled, automatically submits one or two bracket orders — for example, an entry order that sends a take-profit when it fills. Provide the primary order's fields plus bracket1 (required) and, optionally, bracket2. If you specify both brackets, they're linked to each other as an OCO, so filling one cancels the other. On success, the response includes the primary order's orderId.

// Demo environment; for Live use https://live.tradovateapi.com/v1
const URL = 'https://demo.tradovateapi.com/v1'

const oso = {
    accountSpec: yourUserName,
    accountId: yourAccountId,
    action: "Buy",
    symbol: "MESM1",
    orderType: "Limit",
    price: 4150.00,
    orderQty: 1,
    isAutomated: true,
    bracket1: {
        action: "Sell",
        orderType: "Limit",
        price: 4200.00
    }
}

const result = await fetch(`${URL}/order/placeoso`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${myAccessToken}`
    },
    body: JSON.stringify(oso)
}).then(res => res.json()) // { orderId } on success
<Warning> Set `isAutomated` to `true` for any order placed by code or an automated process, and `false` only for an order a human places directly. Misreporting this can violate exchange policies. </Warning>

As with any order, acceptance is subject to market, exchange, and risk-management rules. When rejected, the response carries a failureReason and failureText.

Common Failure Scenarios

  • A risk limit blocks the primary order (for example, MaxPosLimitReached).
  • A contract or price is invalid for the primary order or a bracket (InvalidContract, InvalidPrice).
  • The trading session is closed (SessionClosed).

Error Messages

failureReasonTrigger
InvalidPriceA price is missing or invalid for the primary order or a bracket.
MaxPosLimitReachedThe order would exceed the account's position limit.
SessionClosedThe trading session is closed.

See the failureReason enum in the response schema for the complete list of values.

post/order/placeoso

Request

  • Base URL: https://demo.tradovateapi.com/v1
  • URL: https://demo.tradovateapi.com/v1/order/placeoso
  • Auth: HTTP bearer

Request body

accountSpecstring
accountIdinteger
clOrdIdstring
action'Buy' | 'Sell' required

Buy, Sell

symbolstring required
orderQtyinteger required
orderType'Limit' | 'LimitIfTouched' | 'MIT' | 'Market' | 'MarketLimit' | 'MarketStopWithProtection' | 'MarketWithProtection' | 'QTS' | 'Stop' | 'StopLimit' | 'TrailingStop' | 'TrailingStopLimit' required

Limit, LimitIfTouched, MIT, Market, MarketLimit, MarketStopWithProtection, MarketWithProtection, QTS, Stop, StopLimit, TrailingStop, TrailingStopLimit

pricenumber double
stopPricenumber double
limitIfTouchedPricenumber double
maxShowinteger
pegDifferencenumber double
timeInForce'Day' | 'FOK' | 'GTC' | 'GTD' | 'IOC'

Day, FOK, GTC, GTD, IOC

expireTimestring date-time
textstring
activationTimestring date-time
customTag50string
isAutomatedboolean

Response

PlaceOsoResult

failureReason'AccountClosed' | 'AdvancedTrailingStopUnsupported' | 'AnotherCommandPending' | 'BackMonthProhibited' | 'ExecutionProviderNotConfigured' | 'ExecutionProviderUnavailable' | 'HomeStateRestricted' | 'InvalidContract' | 'InvalidPrice' | 'KeyInformationDocumentRequired' | 'LiquidationOnly' | 'LiquidationOnlyBeforeExpiration' | 'MaxOrderQtyIsNotSpecified' | 'MaxOrderQtyLimitReached' | 'MaxPosLimitMisconfigured' | 'MaxPosLimitReached' | 'MaxTotalPosLimitReached' | 'MinTradeDurationNotElapsed' | 'MultipleAccountPlanRequired' | 'NoQuote' | 'NotEnoughLiquidity' | 'OtherExecutionRelated' | 'ParentRejected' | 'RiskCheckTimeout' | 'SSFNFAComplianceRequired' | 'SSFNFAComplianceRequiredJointOnly' | 'SSFRiskDisclosureAcknowledgmentRequired' | 'SessionClosed' | 'Success' | 'TooLate' | 'TradingLocked' | 'TrailingStopNonOrderQtyModify' | 'Unauthorized' | 'UnknownReason' | 'Unsupported'

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

failureTextstring
orderIdinteger
oso1Idinteger
oso2Idinteger

Changes

No recorded changes to this operation across all 1 revision of this API.