Writing an Autoview command
By the end of this guide you'll be able to write a command that places a real trade, and test it first so you don't lose money learning. An Autoview command is one line of key=value pairs. It tells Autoview which account to use, what to trade, which way, and how much. Most people put that line in a TradingView alert, but the webhook will take a command from anything that can POST to your URL: a script, a cron job, another platform. The command syntax is the same wherever it comes from.
Here is a complete one:
e=oanda s=EUR_USD b=long q=2% sl=1.2% tp=3%Read it left to right. Send to OANDA, trade the euro against the dollar, go long, size at 2% of the balance, set a stop 1.2% away and a take-profit 3% away. That's a real working command. The rest of this guide builds it piece by piece.
Step 1: Pick the account and exchange
Two parameters decide where the order goes.
e=is the exchange.e=oanda,e=kraken,e=tradovate, and so on.a=is the account alias: the nickname you gave a set of API credentials when you connected them. If you only have one set of credentials for that exchange, you can leaveaoff and Autoview uses the default.
Use a= when you've connected the same exchange twice, say a demo set and a live set, and you need to be explicit about which one a command hits. One account per command. Don't list several. The parser rejects a comma-separated list with the message "To ensure command accuracy, please use one account per command."
Step 2: Name the symbol
s= is the market, written the way the exchange writes it. This is the single most common place a command silently does nothing, because every exchange spells its symbols differently.
- OANDA uses an underscore:
s=EUR_USD, notEURUSD. The underscore is required. - A crypto pair on most exchanges looks like
s=BTCUSDors=BTCUSDT. - Futures and stocks follow each platform's own contract notation.
When in doubt, copy the symbol from the exchange's own market page rather than guessing. We don't normalize it for you. What you type is what gets sent.
One catch if your alert comes from TradingView. People reach for TradingView's
{{ticker}} placeholder to fill the symbol, and at fire time
TradingView substitutes the chart's ticker, which for EUR/USD comes back as
EURUSD with no separator. OANDA wants EUR_USD. The placeholder is
TradingView's, not Autoview's: whatever sends the alert has to supply a value the
exchange accepts, so type the underscore form yourself rather than trusting the raw
substitution. A script or another platform fills the symbol its own way.
Step 3: Set the side and the size
b= is the book, the side you want.
b=longorb=shortopen a margin position.b=buyorb=sellare the plain spot equivalents.
q= is the quantity, and it's smarter than a raw number. Write it as a percentage and it scales with your account: q=2% uses 2% of the balance, q=100% uses all of it. Leave q off entirely and the default is 100%. Worth knowing before your first live order. The default unit is contracts. Set u=currency if you'd rather size in the currency instead.
Step 4: Add stops and take-profits
This is where a command stops being a market punt and starts being a strategy. The percentage forms key off your fill price, which is what you usually want:
sl=1.2%sets a stop loss 1.2% away.tp=3%sets a take-profit 3% away.
If you'd rather name a literal price than a distance, the fixed variants take an absolute number: fsl= for a fixed stop loss, ftp= for a fixed take-profit, fp= for a fixed price. ts= gives you a trailing stop that follows the market by the amount you set. There's also a guaranteed stop, gsl=, on exchanges that support guaranteeing the level against slippage. OANDA is the obvious one for forex traders.
Step 5: Choose the order type
t= is the order type, and it defaults to limit. Switch it when you want a different behavior:
t=market: fill now at the going rate.t=limit: rest on the book at your price (the default).t=fok/t=ioc: fill-or-kill or immediate-or-cancel, on exchanges that support them.
tif= sets the time in force on its own, so it composes with the order type: t=market tif=fok fills completely or not at all, and t=limit tif=ioc takes what it can at your price and cancels the rest. The standalone t=fok / t=ioc spellings above mean a market order with that time in force, and they keep working.
Stops aren't a t= value. You set a stop with the parameters from Step 4 (sl=); on exchanges that support stop orders, t=market then makes the triggered order fill at market instead of resting as a limit.
A note for stock traders on Alpaca: eh=1 lets an order work in pre-market and after-hours sessions instead of regular hours only.
Step 6: Closing and cancelling
A command doesn't only open trades. c=position closes an open position. c=order cancels resting orders. Pair it with cm= to limit how many: cm=5 touches just five, and cmo=oldest or cmo=newest controls which five.
Step 7: Test before it trades real money
Don't aim a brand-new command at a funded live account. Two switches let you prove it out safely.
d=1disables a single command. Autoview parses it and reports back what it would have done, but places nothing.testing=1is the bigger hammer: while it's on, every command is held back until you turn it off.
Better still, connect a demo or testnet account first. Several of those connections are free, so you can fire the exact command at fake money, watch the fill, then drop the d=1 and point it at the real account once you trust it. That's the whole workflow. Test, read the output, then go live.
Putting it together
Two of those steps were optional: the account alias and the order type. Here's the full version with everything spelled out:
a=main e=oanda s=EUR_USD b=long t=market q=2% sl=1.2% tp=3% d=1Send to the account I aliased main, on OANDA, buy EUR/USD at market, size 2%, stop at 1.2%, target 3%, with d=1 so this first run only reports back. Confident it's right? Delete d=1 and the next alert trades it for real.
The full parameter list
This guide covers the parameters you'll reach for in almost every strategy. The platform supports many more: auto-borrow, hedge mode, iceberg sizing, OCO and OSO brackets, wallet transfers, leverage type, and the rest. For the complete reference with every parameter and its accepted values, see the alert syntax page.