aid= by exchange: pick the account an alert trades
One broker sign-in often holds several accounts: a futures account and a stock account at TradeStation, three evaluation accounts at Tradovate, a few sub-accounts on Hyperliquid. aid= tells Autoview which of them a command is for. Five connections read it on orders, and they do not all match it against the same thing.
This page comes from the Autoview integrations code that runs on our servers today. We read the code; we did not place live orders for this guide.
a= and aid= are different keys
a= is the Account key: it names the connection. aid= is the Account Identifier: it names one account inside that connection. A connection with a single account never needs aid=.
What each connection matches
| Connection | aid= is compared with | Without aid= |
|---|---|---|
| Tradovate | The account name | The first account Tradovate lists |
| TradeStation | The account ID. Closed accounts are skipped. | The first open account TradeStation lists |
| Charles Schwab | The account number | The primary account, or the first listed if none is marked primary |
| Capital.com | The account name | The preferred account, or the first listed if none is marked preferred |
| Hyperliquid | A sub-account name, or a 0x address | The vault set on the connection, or the key's own address |
On all five, aid= is read for new orders, for cancels and for position closes. A close sent without it goes to the default account, even when the entry named another one. Put the same aid= on every line of a strategy.
The match is exact, but case does not matter
Autoview upper-cases your aid= value and the broker's account names before it compares them, so aid=demo251519-2 and aid=DEMO251519-2 find the same Tradovate account. Beyond that the two must be equal. Part of a name does not match.
e=TRADOVATESIM s=ESM6 b=buy t=market q=1 aid=DEMO251519-2 d=1A market buy of one contract on the Tradovate account named DEMO251519-2. Nothing is sent while d=1 is on the line.
When the name is wrong
The command stops before the order is sent, and the error carries the answer:
Account Name "DEMO1" not found: DEMO251519-1, DEMO251519-2Everything after the colon is the list of accounts Autoview can see on that connection, in the form aid= expects. Copy one. If the connection has no accounts at all, the error is No available Accounts.
Capital.com switches the session
Capital.com works with one active account per session. When aid= names an account other than the active one, Autoview switches the session to it first and then places the order.
e=capital s=EURUSD b=buy t=market q=1000 aid=CFD2 d=1Here CFD2 stands for whatever your second account is called in Capital.com.
Hyperliquid takes a name or an address
On Hyperliquid, aid= can be a 42-character 0x address or a sub-account name. An address is used as it is. A name is looked up among the sub-accounts of your main wallet, and a miss gives the same "not found" error with the valid names. Autoview keeps that sub-account list for 15 minutes.
A connection can also carry a vault setting. aid= on the line wins over it, and the vault wins over the key's own address.
e=HYPERLIQUID s=BTC b=buy t=market q=0.01 aid=SWING d=1A buy on the sub-account named SWING.
Bitget reads aid= on transfers only
Bitget does not read aid= on orders. It reads it on a wallet transfer, where it is the user ID of the sub-account that funds move to or from. Wallet transfers by exchange has that syntax.
Every other connection
No other connection reads aid=. It is a known key, so you get no "Unknown parameter ignored" warning either, and the order is placed as if aid= were not on the line. On a crypto exchange with sub-accounts, give each sub-account its own API key and connect it to Autoview as its own account. Several strategies on one account covers that setup.