Exchange
The Exchange page manages the exchange accounts you have configured. On FMZ, an "exchange" is an account a strategy program can operate: it holds the keys of the funding account together with the protocol and API wrapper used to talk to that exchange.
Adding an exchange account
- **Create an API key on the exchange**: enable only read and trade permissions, never withdrawal; if the exchange supports an IP whitelist, bind the outbound IP of the docker that will run the robot (see the checklist in
Key Security). - Open the add page: click "Add Exchange" on the Exchange page to open the add exchange page.
- Choose the protocol: pick the exchange by category, or search by exchange name or ID. Spot and futures (contracts) are two different exchange objects and are added separately; futures exchanges carry a "Futures" tag. For example Binance spot is
Binanceand Binance futures isFutures_Binance. - **Fill in the configuration**: "Label" is the account's name on the platform (the exchange name by default) and tells several accounts on the same exchange apart. The other fields depend on the exchange; the common ones are listed below, and the full list for each exchange is on its exchange page in the syntax manual (all exchanges are listed in
Capability Matrix). Fields not marked optional are required. - Confirm: click the confirm button and enter your platform account password. Encrypted fields such as keys are encrypted in the browser with the account password before upload, so the platform never stores them in plain text.
- Use it: select the exchange account when creating a live robot or a backtest. If you use the platform's public dockers, their IPs are listed at the bottom of the add page; add them to the exchange's IP whitelist.
Common fields
| Field | Description |
|---|---|
| Access Key, Secret Key | The exchange API key and secret. Secret Key is an encrypted field |
| Passphrase | The passphrase set when creating the API key; required by some exchanges (see below) |
| Simulate (demo) | When checked, connects to the exchange's demo trading or testnet; usually needs a separate API key |
| Version, V5 protocol, V3 protocol | The exchange API version; keep the default on most exchanges |
| Wallet address and private keys | The wallet address, wallet private key or exchange-generated API private key used to sign on on-chain exchanges |
| Rpc Address, Chain, ChainType | Node address and chain for the on-chain swap and Web3 exchange objects; see Web3 |
| Server address, trading password | Securities and futures accounts such as Futu and Interactive Brokers; see Securities and Futures in the syntax manual |
- Passphrase: required by
OKEX(OKX),Futures_OKCoin(OKX futures), Bitget, DeepCoin,Futures_KuCoin,WEEX,Futures_WEEXand others. ForKuCoinspot this field is labeled Password. - Simulate (demo): supported by some exchange objects of Binance, OKX, Bybit, Gate and DigiFinex.
- API version: on a few exchanges the version selects the account type, for example v3 is the unified account and v2 the classic account on Bitget; see the exchange page.
- Wallet address and private keys: used by on-chain exchanges such as Hyperliquid, Lighter, EdgeX, Aster and Polymarket; see the exchange pages under
Decentralized ExchangesandPrediction Marketsin the syntax manual for the exact fields.
Every masked (encrypted) input can hold a credential file path instead, so the private key stays only on the docker's machine; see Local Credential Files.
Exchange objects
In strategy code a configured exchange is the exchange object exchange. A backtest or live robot can be configured with several exchanges; in code they form the exchange object array exchanges. exchange.GetName() returns the name of the exchange object (such as Futures_Binance); the documentation uses this name when it refers to a specific exchange, with the common name in parentheses where helpful.
Strategy code reads the account and market data, places orders and cancels them through the exchange object. In JavaScript:
javascript
function main() {
let account = exchange.GetAccount() // query account information
let ticker = exchange.GetTicker() // get the ticker
let id = exchange.Buy(1000, 1) // price 1000, amount 1
if (id) {
exchange.CancelOrder(id) // cancel the order if it is still open
}
}
In this sectionRead the whole section
| Name | Description |
| Exchange-Specific Notes | The configuration, contract codes, exchange-specific commands and notes of each exchange have moved to the "Exchanges" chapter of the syntax manual. |
| Local Credential Files | When configuring an exchange, every masked encrypted input (Secret Key, private key, password, etc.) can hold a credential file path file:///name.txt instead of… |
| General Protocol | An exchange the platform has not integrated yet can be connected by writing a general protocol plugin: on one side the plugin calls the exchange's API, on the o… |