Tradovate command reference

Autoview · Reference

This is the full reference for writing Tradovate orders from an Autoview alert. It goes parameter by parameter and order type by order type, and for each order type it shows the exact order Tradovate resolves, not just the command you type. If you want the short version, the Tradovate cheat sheet has a copy-ready line for each order type. This page is the one you keep open when you need the detail behind those lines.

Every command here was emitted by our command builder, round-tripped through the same parser the trading engine uses, and then fired against Tradovate Simulation. The resolved-order fields you see are the values the platform returned. Nothing is hand-typed or assumed.

How Autoview reads a command

A command is a single line of key=value tokens separated by spaces. e=TRADOVATESIM s=ESM6 b=buy t=market q=1 is five tokens. The order you write them in does not matter, with one exception below.

  • First occurrence wins. If a key appears twice, Autoview keeps the first and ignores the rest. Write each key once.
  • A line starting with // is a comment and places nothing. Useful for labelling an alert without triggering a trade.
  • You can send several commands at once by separating them with a new line or a pipe (|). Each is parsed on its own.
  • An ampersand (&) starts a new section of the same order. This is how brackets attach a stop and a target to an entry, covered below.
  • A token that starts with a colon is ignored. TradingView sometimes inserts placeholder tokens like :plot_0=; Autoview skips anything with a leading colon so those never affect the order.

Two tokens are required for every Tradovate order: s= (the contract) and b= (the side). Most order types also need q= (the size). Everything else has a default or is optional.

The parameter table

These are the parameters Tradovate reads. The cheat sheet uses a handful of them; this is the full set, grouped by what they do.

Routing and identity

ParameterMeaning
e=The exchange. e=TRADOVATESIM for Simulation, e=TRADOVATE for live.
s=The contract, in Tradovate notation (for example s=ESM6). Required.

Direction and size

ParameterMeaning
b=Side: b=buy or b=sell. Required, no default.
q=Quantity. A whole number of contracts (q=1) or a percent of balance (q=50%). Defaults to 100% of balance when omitted.
u=The unit q= is measured in. Defaults to contracts. Set u=currency to size in account currency instead: Autoview divides your number by the price to get contracts (needs a price= reference).
y=Sizing basis for a percent q=. Defaults to your available balance; y=equity sizes the percent against account equity instead.
aid=Route the order to a sub-account by its name (for example aid=DEMO251519-2). Defaults to your main account. An unknown name is rejected with the list of valid names.

Order type and price

ParameterMeaning
t=Order type: market, limit, fok, ioc. Defaults to limit, so market and stop orders set it explicitly. Stops and trailing stops are t=market plus a trigger parameter, not a t= of their own.
fp= / p=Limit price. fp= is a fixed, absolute price; p= is an offset from a reference (see relative pricing).
fpx= / px=Trigger price for a stop. fpx= is absolute; px= is an offset.
fts= / ts=Trailing distance for a trailing stop. fts= is absolute; ts= is an offset. On a t=limit base this builds a trailing stop-limit instead of a trailing stop.
price=A reference price the relative parameters offset from. Use price={{close}} in a TradingView alert. Brackets and percent sizing need it too (see those sections).
h=Iceberg: the maximum quantity to show at once on a limit order. h=1 on a five-lot shows one at a time.
id=A tag carried on the order (its customTag50), so you can recognise or filter it later.

Brackets and closing

ParameterMeaning
sl= / tp=Stop loss and take profit distances, in points from the fill. Written in an & section to attach a bracket.
fsl= / ftp=Fixed (absolute) stop loss and take profit prices, as an alternative to the point distances.
slv= / tpv=The unit the sl= / tp= distance is read in: points, pips, ticks, or price. These pick a unit, they are not values, so they only do something next to an sl= or tp=.
oco=Place a standalone one-cancels-other pair (a stop and a limit that cancel each other), separate from a bracket. Covered in its own section below.
cm= / cmo=When closing or cancelling, act on a subset: cm= is how many (a count or a percent), cmo= is which ones (newest, oldest, highest, and so on).
c=Close. c=all flattens the position and cancels working orders; c=position closes the position only; c=order cancels working orders only. b=flat is a shorthand that routes to c=all.
d=Dry run. d=1 parses and reports the order but places nothing.

Tradovate also reads break-even and auto-trail adjustments inside a bracket section (abe=, abex=, atf=, atx=, atsl=). They are genuinely advanced and most setups never need them; the brackets section shows where they go.

Order types and what each resolves to

Here is each order type with the command on the left and the order Tradovate actually built on the right. The resolved side is the useful part: it shows that t=fok becomes a Limit order with a fill-or-kill time-in-force, that a stop becomes a Stop order with a stop price, and so on.

CommandTradovate resolves
e=TRADOVATESIM s=ESM6 b=buy t=market q=1Market order, quantity 1.
e=TRADOVATESIM s=ESM6 b=buy t=limit fp=5000 q=1Limit at 5000, time-in-force GTC.
e=TRADOVATESIM s=ESM6 b=buy t=market fpx=5050 q=1Stop with a stop price of 5050.
e=TRADOVATESIM s=ESM6 b=buy t=limit fp=5055 fpx=5050 q=1Stop-limit: a limit at 5055 that arms at 5050.
e=TRADOVATESIM s=ESM6 b=buy t=fok fp=5000 q=1Limit at 5000, time-in-force FOK (fill or kill).
e=TRADOVATESIM s=ESM6 b=buy t=ioc fp=5000 q=1Limit at 5000, time-in-force IOC (immediate or cancel).
e=TRADOVATESIM s=ESM6 b=sell t=market fts=10 q=1Trailing stop with a 10-point trail.
e=TRADOVATESIM s=ESM6 b=sell t=limit fp=5000 fts=10 q=1Trailing stop-limit: the same 10-point trail on a limit base, so it resolves to a TrailingStopLimit at 5000.

Two of these surprise people. Fill-or-kill and immediate-or-cancel are not separate order types on Tradovate; they are limit orders with a different time-in-force, which is why both resolve to a Limit. And a stop is a market order with a trigger, so t=market fpx=5050 is the stop, not a t=stop you might expect. The same trail parameter builds a trailing stop on a market base and a trailing stop-limit on a limit base; the t= you choose decides which.

Absolute and relative prices

Every price parameter comes in two forms, and the difference is one letter.

  • With the f prefix, the number is absolute. fp=5000 means the price 5000.
  • Without the f, the number is an offset from a reference you supply with price=. p=-5 means five points below the reference.

Relative pricing is the usual TradingView pattern, because the alert can hand Autoview the candle that fired it:

e=TRADOVATESIM s=ESM6 b=buy t=limit price={{close}} p=-5 q=1

price={{close}} passes the candle close, and p=-5 rests the limit five points under it. The same swap works for triggers (px= instead of fpx=) and trails (ts= instead of fts=).

A plain Simulation account has no live market-data feed. Absolute prices always work because the number is right there in the command. Relative prices need the price= reference to resolve, and without it Tradovate tries a live-quote lookup that the Simulation account cannot answer, which fails with "Ticker is not available." Supplying price={{close}} skips the lookup.

Sizing: contracts and percent

q= sets the size, and it reads two ways.

  • A whole number is contracts. q=2 is two contracts, passed straight through.
  • A percent is a share of your balance, sized to contracts at fill time. q=50% resolved to four contracts on our test account.

Percent sizing needs a price basis. To turn a percent of your balance into a number of contracts, Autoview needs a price to value the position against. In a TradingView alert that comes from price={{close}}. We confirmed this the hard way: q=50% on its own threw an error on the Simulation account, while q=50% price=5000 resolved cleanly to four contracts. If you size by percent, carry a price= reference.

Leave q= off entirely and Autoview uses 100% of the balance. On our Simulation account that was nine contracts. Set the size you mean on every order. It is the cheapest mistake to avoid and the easiest one to make.

Brackets: stops, targets, and scale-outs

A bracket is an entry with a stop loss and a take profit attached, so the trade protects itself the instant it fills. You write it as the entry, an &, then both targets in the same section:

e=TRADOVATESIM s=ESM6 b=buy t=market q=1 price={{close}} & sl=10 tp=20

That is one correct bracket. We placed exactly this on Simulation and watched Tradovate build a single bracket strategy with two legs: a take profit 20 points above the fill and a stop loss 10 points below. Whichever the market reaches first closes the trade and cancels the other.

Keep the stop and the target in the same section. Splitting them into two & sections is the single most common Tradovate mistake. & sl=10 & tp=20 (two sections) builds two separate half-brackets instead of one, and they do not cover each other the way you expect. One &, both values, one section.

The numbers are point distances from your fill, and Autoview applies the direction for you. On a buy the take profit goes above and the stop goes below; flip to b=sell and the sides flip with you. Brackets need the price= reference for the same reason percent sizing does: the engine has to know the fill price to place the legs around it.

Fixed-price legs

If you would rather name the exact stop and target prices than a distance, use fsl= and ftp= in the section. They are the absolute-price counterparts to sl= and tp=, the same f rule as everywhere else.

e=TRADOVATESIM s=ESM6 b=buy t=market q=1 price={{close}} & fsl=4990 ftp=5020

Choosing the distance unit

By default sl= and tp= are read in points. slv= and tpv= change the unit the distance is read in: points, pips, ticks, or price. The important part, and a real trap, is that these pick a unit, they are not a value. slv= does nothing on its own; it modifies the sl= sitting next to it.

e=TRADOVATESIM s=ESM6 b=buy t=market q=1 price={{close}} & sl=10 slv=ticks tp=20 tpv=ticks

That reads the stop as ten ticks and the target as twenty ticks. Write slv=ticks with no sl= and nothing happens, because there is no distance for the unit to apply to.

Scaling out across several legs

More than one & section turns the bracket into a scale-out: each section is its own leg with its own targets and its own size. This buy fills two contracts and gives each contract a different take profit, both protected by the same ten-point stop:

e=TRADOVATESIM s=ESM6 b=buy t=market q=2 price={{close}} & q=1 sl=10 tp=10 & q=1 sl=10 tp=20

On Simulation this resolved to two bracket legs, one targeting ten points and one targeting twenty, so the position takes profit in two steps. A leg can also carry an id= tag, and the break-even and auto-trail parameters (abe=, abex=, atf=, atx=, atsl=) live in a section too. Those last five are advanced and rarely needed; reach for them only when a plain stop and target are not enough.

OCO: a standalone stop-and-target pair

A bracket attaches a stop and a target to a new entry. oco= is the other shape: a stop and a limit placed together with no entry, where filling one cancels the other. It is the protective pair for a position you already hold. You give it a trigger price and a take-profit price:

e=TRADOVATESIM s=ESM6 b=buy t=market q=1 oco=1 fpx=4990 ftp=5020

On Simulation this resolved to a stop order at 4990 paired with a limit at 5020. The b= is the side of the position you are protecting, so a long here places two sell exits: a stop below to cap the loss and a limit above to take the profit. Whichever fills first cancels the other. Use a bracket when you are entering; use oco= when you are protecting a position that is already open.

Order modifiers: iceberg, tags, sub-accounts

These ride along on a normal order and change how it behaves without changing what it is.

ModifierWhat it does
h=Iceberg. On a limit order, show only part of the size at a time. h=1 on a five-lot shows one contract publicly and refills as it fills.
id=Tag. Carries a label on the order so you can recognise or cancel it later. id=entry1.
aid=Sub-account. Route the order to a named sub-account instead of your main one. A name Tradovate does not recognise is rejected outright.
u=currencyCurrency sizing. Read q= as an amount of account currency rather than contracts; Autoview divides it by the price to get the contract count. Needs a price= reference.
y=equityEquity basis. Size a percent q= against account equity instead of available balance.

All five resolved as described when fired against Simulation. They combine with any order type, so an iceberg limit with a tag on a named sub-account is one line: e=TRADOVATESIM s=ESM6 b=buy t=limit fp=5000 q=5 h=1 id=entry1 aid=DEMO251519-2.

Managing an open position

Once you hold a position, three close parameters give you precise control over what to unwind:

CommandEffect
e=TRADOVATESIM s=ESM6 c=allFlatten the position and cancel every working order on the contract.
e=TRADOVATESIM s=ESM6 c=positionClose the position, leave resting orders alone.
e=TRADOVATESIM s=ESM6 c=orderCancel resting orders, leave the position open.

c=all is the one to reach for most of the time. We checked it after a live bracket: one c=all left no open position and no orphan orders behind, so it is both your panic button and the clean end to a test run. Use c=position and c=order when you want to unwind one side without touching the other. b=flat is a shorthand for c=all; the engine rewrites it, which is handy when a TradingView strategy emits a flat signal.

Closing only part of the set

When you have several working orders or positions, cm= and cmo= let you act on a subset rather than all of them. cm= is how many (a count or a percent), and cmo= is which ones, by newest, oldest, highest, lowest, biggest, smallest, or random.

e=TRADOVATESIM s=ESM6 c=order cm=2 cmo=newest

We confirmed this live: with three resting orders, that command cancelled the two newest and left the oldest one working. Without cmo= the engine still honours cm= and simply takes them in the order it finds them.

What Tradovate does not accept

A few things look like they should work and do not. Knowing them saves a debugging session.

  • One command, one account. You cannot list several accounts in one command with a=acct1,acct2; Tradovate rejects it and asks for one account per command. Send a separate command per account, or use aid= to target a single sub-account.
  • oso= is not wired up. One-sends-other is recognised by the parser but its handler is switched off, so it does nothing. Use a bracket or oco= instead.
  • close= is automatic. You do not need to add close=1 to a close command; the engine sets it for you, and on its own it has no separate effect.
  • ps= and opposite= are not Tradovate features here. They belong to other exchange types; on Tradovate a close already does the sensible thing without them.

Everything else on this page was placed against Tradovate Simulation and resolved to exactly what is described.

Testing and going live

Append d=1 to any command and Autoview parses it, reports what it would have done, and places nothing:

e=TRADOVATESIM s=ESM6 b=buy t=market q=1 d=1

That is the safest first run for a command you have just written. Read the log, confirm the symbol and side are right and the size is what you meant, then drop d=1 and let it fill on Simulation. When it behaves there, swap e=TRADOVATESIM for e=TRADOVATE and the same command trades your live account. Nothing else changes: same symbol, same side, same size. For more on reading the log, see test and debug your setup.

Back to the cheat sheet