Tradovate API

Place OCO & OSO Bracket Orders via the API

Placing OCO and OSO bracket orders through the Tradovate API isn't complicated once you see how the pieces fit together. Here's the entry, stop, and target legs with placeOSO, placeOCO, and orderStrategy, one step at a time.

Reviewed by the PickMyTrade Trading Systems Team Last updated
· 6 min read
Tradovate API access screen showing account credentials and key generation

Placing OCO and OSO bracket orders through the Tradovate API isn't complicated once you see how the pieces fit together. Whether you're wiring up a custom bot, auditing your exits, or building automation like PickMyTrade, this guide walks you through the entry, stop, and target legs with placeOSO, placeOCO, and orderStrategy, one step at a time.

What Are OCO and OSO Bracket Orders?

A bracket wraps a trade entry with a protective stop-loss and a take-profit target, so every position is risk-defined from the first tick. OSO (order-sends-other) fires the child stop and target only after the parent entry fills. OCO (one-cancels-other) links two live orders so that filling one automatically cancels the other. A complete bracket usually leans on both ideas at once.

Place OCO & OSO Bracket Orders via the API: Step-by-Step

1

Authenticate and Grab Your Account IDs

Get an access token, then note two things: your numeric accountId and your username accountSpec. Every bracket call needs both. Set isAutomated: true on bot orders, CME rules require automated orders to carry that flag, and Tradovate will reject them if it's missing.

2

Send an OSO Bracket (Entry + Stop + Target)

POST to /order/placeOSO. The top-level object is your entry order, with fields like accountSpec, accountId, action, symbol, orderQty, orderType, and isAutomated; bracket1 and bracket2 are the contingent exits that activate the instant that entry fills. Use a Limit bracket with a price for the target and a Stop bracket with a stopPrice for the loss, whether they sit in bracket1 or bracket2 makes no difference. A successful response hands you back orderId, bracket1Id, and bracket2Id. Swap the example prices for your own levels before you fire it.

3

Link Two Exits with OCO

Already in a position and just need a stop and target that cancel each other? POST to /order/placeOCO. The main object is one leg, carrying accountSpec, accountId, action, symbol, orderQty, orderType, and stopPrice; the nested other object is the second leg. When either leg fills, Tradovate cancels its sibling. Send the body as real JSON, use json=payload, not data=, or you'll hit an "Invalid JSON" error. And make sure the two legs form a valid stop/target pair, otherwise Tradovate returns "Wrong OCO combination."

4

Automate Managed Brackets with orderStrategy

For a fully server-side, ATM-style bracket, Tradovate exposes an order-strategy endpoint (startOrderStrategy). It takes a brackets array of qty, profitTarget, and stopLoss offsets and manages the exits for you once the entry fills. Route this call over a WebSocket for reliability; if it errors out, fall back to the paired placeOSO/placeOCO approach above.

5

Confirm the Bracket Legs in Tradovate

Open the Orders panel (and the Positions panel) in the Tradovate web platform and confirm your entry filled and that both the stop and target legs are working. If you close the position by hand, cancel any orphaned leg so it doesn't sit in the book waiting to fill.

Tradovate API placeOSO request showing bracket1 and bracket2 exit legsTradovate API placeOCO request showing the other object as the second legTradovate API orderStrategy request showing a brackets array with profit target and stop lossTradovate Orders panel showing the working stop and target bracket legs

Why You'd Need This

  • Ship risk-defined automation where every entry carries a stop and a target.
  • Audit or reconcile API fills against what actually shows in the platform.
  • Migrate a TradingView or custom strategy to direct order routing.
  • Guarantee an exit is in the book the instant a position opens.

Automate This with PickMyTrade

Handling bracket logic through the raw API means access tokens, device IDs, and JSON payloads you have to maintain by hand. PickMyTrade links your TradingView alerts straight to your Tradovate account and attaches the stop and target automatically, no code, no manual clicks.

Skip the Bracket Payloads

Let PickMyTrade link your TradingView alerts straight to your Tradovate account and attach the stop and target automatically.

Start Your Free 5-Day Trial

Frequently Asked Questions

OSO sends child orders that activate only after the parent entry fills. OCO links two live orders so that filling one cancels the other. A full bracket often uses both together.

Use orderType: "Limit" with a price for the take-profit and orderType: "Stop" with a stopPrice for the loss. Whether they sit in bracket1 or bracket2 doesn't change the behavior.

Send the payload as real JSON rather than a form/data string, and make sure the two legs' actions and prices form a valid stop-and-target pair.

This guide is for educational and informational purposes only and is not financial, investment, or trading advice. Trading futures and other leveraged products carries a substantial risk of loss and is not suitable for every investor. PickMyTrade is an independent third-party automation platform and is not affiliated with, endorsed by, or sponsored by Tradovate, Inc. "Tradovate" and all related names, logos, and trademarks are the property of their respective owners. Platform features and steps change over time, so always confirm the current process in the official Tradovate platform and documentation before acting.