Capital.com command reference

Autoview · Reference · Updated October 8, 2026

This is the full reference for writing Capital.com orders from an Autoview alert. Getting started with Capital.com gets your account connected and fires one test order; this page goes parameter by parameter, covers the & advanced-syntax scale-out that opens several orders from a single alert, and documents the guaranteed-stop pre-flight rules and position behavior confirmed against a live Capital.com Demo account.

Capital.com trades CFDs, not the underlying asset, across forex, indices, commodities, shares, and crypto. Every market has its own venue code called an epic (for example GOLD or US500), and it is not always the everyday ticker. Autoview sends your s= value to Capital.com as the epic, exactly as you typed it. If no market has that epic, the command fails with an unknown-symbol error. When Capital.com's market search finds matches for your text, the error lists their epics. Copy one of those, or look up the epic on Capital.com before you send a command.

How Autoview reads a command

A command is a single line of key=value tokens separated by spaces. e=capital s=GOLD b=sell t=market q=1 is five tokens. The order you write them in does not matter.

  • First occurrence wins. If a key appears twice in the same command, Autoview keeps the first and ignores the rest.
  • A line starting with // is a comment and places nothing.
  • You can send several commands at once separated by a new line or a pipe (|). Each is parsed on its own.
  • A token that starts with a colon is ignored. TradingView sometimes inserts placeholder tokens like :plot_0=; Autoview skips anything with a leading colon.

Three tokens matter for every Capital.com order: s= (the epic), b= (the side), and q= (the size). Leave q= off and Autoview uses 100% of the relevant balance, so set it explicitly on every order.

The parameter table

Routing and identity

ParameterMeaning
e=The exchange. e=capital routes to Capital.com. Chrome extension only: on the webhook platform the exchange is already fixed to the webhook itself.
s=The market's epic code, which is not always the everyday ticker. Required.
a= / aid=On the Chrome extension, a= picks which named connection to use. On the webhook platform the webhook's linked key is used, and a= does not switch keys. aid= picks a Capital.com sub-account when your connection has more than one.

Direction and size

ParameterMeaning
b=Side: b=buy/b=sell or b=long/b=short. Required for an entry.
q=Quantity. A plain number is units of the instrument. A percent (q=10%) sizes against available balance. Defaults to 100% of the relevant balance when omitted, so set it explicitly.
u=u=currency treats a plain-number q= as a notional amount in your account's currency instead of instrument units, converted at the live rate. A percent q= ignores u=; percents always size against balance.
y=Balance basis for a percent q=. y=deposit sizes against your deposited amount and y=equity against full account balance; left out, q= sizes against available balance.

Order type and price

ParameterMeaning
t=Order type. t=market fills immediately; anything else resolves to a resting limit order unless a stop trigger is present.
fp= / p=Limit price. fp= is absolute; p= is an offset from price= or the live quote.
fpx= / px=Entry-stop trigger price. Adding it to any order sets Capital.com's order type to STOP while keeping your original side.
dt=Good-til-date. Sets goodTillDate on a resting (non-market) order.
price=A reference price the relative parameters (p=) offset from. Use price={{close}} in a TradingView alert.

Stop-loss, take-profit, trailing stop, and Guaranteed Stop Loss

ParameterMeaning
sl= / fsl=Stop-loss. fsl= is an absolute price; sl= is relative. Attaches directly to the order, no & required.
tp= / ftp=Take-profit, same absolute/relative pair.
ts= / fts=Trailing stop distance.
gsl= / fgsl=Requests a Guaranteed Stop Loss, a stop protected against slippage even in a fast market, guaranteed by Capital.com for a premium built into the spread. See the pre-flight rules below before you rely on it.

Closing and updating a position

ParameterMeaning
c=c=order cancels resting orders. c=position closes or amends the open position on the epic, see below.
cm= / cmo=Narrow which resting orders or positions are affected: cm= is how many (a count or percent), cmo= is which ones (newest, oldest, and so on). Applies to both c=order and c=position.
edit=On c=position, forces the amend-in-place path (edit=1) or the close path (edit=0) explicitly. Defaults to amend whenever sl=/tp=/ts=/gsl= are present, and to a full close otherwise.
opposite=Defaults to 1. A close order flips to the side that offsets the position, so a bare c=position needs no b=. Set opposite=0 (with an explicit b=) to add to the position on its own side instead of closing it.
ps=ps=position prices a partial close or update relative to the position's own average price instead of the current quote.
d=Dry run. d=1 resolves and reports the order without sending it. Capital.com still requires valid credentials for a dry run, since it looks up your account and the instrument's live price first.

The & advanced syntax: scaling out in one alert

Capital.com has no OCO or linked-order endpoint of its own, so the & advanced-syntax separator fans one alert out into several independent orders, each placed with POST /api/v1/positions or /workingorders. This is confirmed against the connector's own test suite, not assumed: each & section places its own order, sharing a single session, market, balance, and ticker lookup across all of them.

CommandCapital.com resolves
e=capital s=<EPIC> b=long t=market & q=2 ftp=120 & q=4 ftp=130 & q=4 ftp=140Three market buys, sizes 2, 4, and 4, each with its own take-profit at 120, 130, and 140.
e=capital s=<EPIC> b=long t=market q=10 & q=2 ftp=120One market buy, size 2, take-profit 120. The q=10 before the first & is part of the shared template, not its own order, and every & section supplies its own q=, so the template's q=10 is never read.

Three things matter for a scale-out alert to resolve the way you expect.

  • The text before the first & is a shared template, and it never places an order by itself. Only & sections place orders. Whatever comes before the first & (s=, b=, t=) is prepended to every section, but a bare q= or price parameter in that shared text is discarded the moment a section supplies its own, since each section's own tokens come first and, per the grammar above, first occurrence wins.
  • ftp= (and fsl=/fts=) are absolute prices; tp= (and sl=/ts=) are relative. ftp=120 means the price 120. tp=20 on a 100 entry means an offset, not the price 120.
  • q= always sizes against available balance, on every leg, independently. It is never a percent of a prior leg, and never a percent of the position being built. If you want three legs to add up to a specific total (say, 10 units split 20/40/40), convert those percentages into absolute leg sizes (q=2, q=4, q=4) rather than writing q=20%/q=40%/q=40%, which would size each leg off your account balance instead.

A section can override the shared template, including the side. Because each & section's own tokens are read before the shared template's, a section that includes its own b= wins over the one before the first &. Most scale-out alerts do not need this, but it is available if one leg genuinely needs a different side, price basis, or account.

& does not do anything on a close. Sending c=position q=20% & q=40% does not close in two steps: the close path never re-parses & sections, so the whole line resolves as one plain command and, per the grammar's first-occurrence rule, only the first q= (20%) is read. The rest of the line after & is inert. & is an entry-side feature; see closing and updating a position for how a close actually works.

Guaranteed Stop Loss: the pre-flight rules

A Guaranteed Stop Loss (gsl=/fgsl=) is protected against slippage even in a fast market, at a cost Capital.com builds into the spread. Autoview checks three conditions before it ever sends the request, on both a fresh entry and a c=position update, and on every & leg independently. Each is confirmed against a live Capital.com Demo account, in both standard and hedging account mode:

  • gsl= without a stop-loss level is rejected before it sends. gsl= or fgsl= requires sl= or fsl= in the same command. Without one, Autoview throws immediately instead of sending Capital.com a request with no stop level, which the venue itself rejects with an opaque error.null.stoploss.value.
  • gsl= together with a trailing stop is rejected. Combining gsl=/fgsl= with ts=/fts= throws instead of silently dropping the trailing stop and sending a static Guaranteed Stop Loss with no indication anything changed.
  • gsl= under Hedging mode is rejected. Capital.com itself does not allow a Guaranteed Stop Loss on a hedged position ("Guaranteed stop loss is not available for hedged positions."). Autoview checks your account's hedging setting and throws before sending, instead of round-tripping to that venue rejection.

All three checks apply the same way whether gsl= arrives on a new entry or on a c=position sl=... gsl=1 update to an existing position.

Closing and updating a position

c=position does one of two things, decided automatically by which parameters you send:

CommandEffect
e=capital s=<EPIC> c=positionFull close. No stop/target/trailing parameters present, so Autoview sends DELETE /positions/{dealId}, the same route Capital.com's own Close button uses.
e=capital s=<EPIC> c=position q=50%Partial close. Sends one offsetting order sized at 50% of the position's current size (not your balance), in the direction that reduces it. opposite= defaults to 1, so no b= is needed.
e=capital s=<EPIC> c=position fsl=59000Amend, not close. Any of sl=/fsl=/tp=/ftp=/ts=/fts=/gsl=/fgsl= present sends PUT /positions/{dealId} instead, updating the resting stop or target on the position that's already open. q= is not read on this path. Force the close path anyway with edit=0.

cm=/cmo= narrow which positions c=position affects the same way they narrow c=order: cm=2 cmo=newest closes only the two newest matching positions on the epic and leaves the rest open.

A partial close never fans out with &, even when you write one. The regression case is c=position q=50% & q=50%: this places exactly one offsetting order at 50%, not two. See the advanced-syntax section above for why.

A LONG_ONLY or SHORT_ONLY instrument can reject a partial close it would otherwise accept. Capital.com's own POST /positions has no reduce-only flag, so a partial close is indistinguishable from opening new exposure on the offsetting side. On an instrument that only allows long (or only short) exposure, that offsetting order is rejected even though nothing new is actually being opened; a full close through DELETE is unaffected. Autoview's error message names the instrument restriction when this happens.

Does Capital.com merge same-direction positions?

No, confirmed on a live Capital.com Demo account (TaskFlow #2027, September 22, 2026), in both account modes:

  • Same-direction, same-epic orders never merge. Two market buys on the same epic, in standard mode or hedging mode, land as two separate position rows, each with its own size and its own take-profit level. This is what makes the & scale-out above safe to use for opening several targets from one entry: each leg is its own position, not folded into an averaged one.
  • An opposite-direction order behaves differently depending on account mode. In standard (non-hedging) mode, an opposite-direction order on the same epic closes or reduces the existing position, the normal single-book behavior. In hedging mode, it opens a separate, independent position instead, and the two sit side by side with no offsetting.

Check your account's mode on Capital.com directly if this matters to your strategy; Autoview reads it once per session (GET /api/v1/accounts/preferences) and uses it for the Guaranteed Stop Loss guard above, but does not expose a command parameter to change it.

What Capital.com does not accept

  • No c=all. Capital.com never implemented a combined liquidate-everything command; sending it throws an explicit "has not been implemented" error instead of silently doing nothing. b=flat maps to c=all internally and hits the same error. Cancel orders and close positions as two separate commands.
  • No reduce-only flag on a fresh entry. ro= is not read when opening a new order; Capital.com's POST /positions has no reduce-only field. Use c=position to close or reduce an existing one instead.
  • No sizing multiplier. l= is not read on Capital.com. Leverage is a Capital.com account and instrument setting, not something a command dials per order.
  • One account per command. A comma-separated a= list is refused, same as every Autoview integration.

Testing and going live

Append d=1 to any command and Autoview resolves it and reports what it would have done without sending it:

e=capital s=GOLD b=sell t=market q=1 d=1

A dry run still needs valid credentials: Capital.com looks up your account and the instrument's live price before the halt, so d=1 proves more than a syntax check. Read the log, confirm the epic, side, and size, then remove d=1 to send it for real. Capital.com's Demo account is the free, zero-risk way to run through all of the above before you touch a live account. For more on reading the log, see test and debug your setup.

Back to getting started with Capital.com