FXCM Setup Guide
Time: 10 minutes | Difficulty: Moderate | Market: Forex Mode: Full automation | API: REST API + FIX Protocol | Docs: fxcm-api.readthedocs.io
This guide wires an FXCM forex bot to the REST API using the botwir3 runtime. Configure API credentials, connect to forex markets, and run automated currency trading strategies locally.
Before you start
Verify that automated operation is permitted under FXCM's current terms of service before deploying. botwir3 provides tools for building structured automation. The user is responsible for compliance with the platform's terms and all applicable regulations.
FXCM Terms of Business | Last verified: May 2026
What you need
- An FXCM account (demo or live)
- API access token generated from the FXCM Trading Station
- The botwir3 runtime downloaded and unzipped
- A strategy config file from the builder
Step 1: Create API credentials
- Log in to FXCM Trading Station
- Navigate to the API settings or token generation page
- Generate an API access token
- Copy the token value
Permissions required: The API token grants trading access to the associated account. Permissions to disable: N/A. Withdrawal is not available through the API.
๐ Security. FXCM API tokens grant trading access only. Fund withdrawal requires the FXCM website. Tokens are stored in a local config file and are not transmitted to botwir3 or any third party. botwir3 never sees, stores, or has access to platform credentials.
Step 2: Configure the adapter
Create adapter.json in the bot directory:
{
"adapter": "fxcm",
"credentials": {
"api_token": "paste-api-token-here",
"account_id": "paste-account-id-here"
},
"trading_pair": "EUR/USD",
"environment": "demo",
"rate_limit_ms": 500
}
Common currency pairs: EUR/USD, GBP/USD, USD/JPY, AUD/USD. FXCM uses slash-separated pair notation.
To switch from demo to live, change environment to "live" and use a live account token.
API keys are stored in a local config file on the machine running the bot. They are not transmitted to botwir3 or any third party. botwir3 never sees, stores, or has access to platform credentials.
Step 3: Test the connection
botwir3 test --adapter fxcm
Expected output:
[botwir3] Adapter: fxcm
[botwir3] Connection: OK
[botwir3] Account: [account-id] (demo)
[botwir3] Rate limit: per API documentation
Step 4: Start the bot
botwir3 start --config my-strategy.json
The runtime loads the strategy, computes the spec hash, connects to FXCM via the local API token, and begins evaluating signals. The gate function compares proposed actions against the configured spec. The user is responsible for monitoring the bot and verifying execution outcomes.
Rate limits and considerations
| Endpoint | Limit | Notes |
|---|---|---|
| REST API | Rate-limited per documentation | Market data, account info, order placement. |
| Streaming | Per connection | Real-time price updates. |
| FIX Protocol | Available for institutional accounts | Lower latency than REST. Separate configuration. |
Common FXCM bot configurations include trend-following on major pairs, scalping strategies on tight-spread pairs (EUR/USD, USD/JPY), and multi-pair portfolio strategies. Demo accounts mirror live conditions โ strategies can run on demo indefinitely before switching to live. All actions and decisions are recorded in the local ledger.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
CONNECTION_REFUSED | API token invalid or expired | Regenerate the token in FXCM Trading Station |
RATE_LIMITED | Request limit exceeded | Increase rate_limit_ms in adapter config |
ACCOUNT_NOT_FOUND | Account ID incorrect or token mismatch | Verify account_id in adapter config |
INSUFFICIENT_MARGIN | Margin requirement exceeds available funds | Reduce position size or add funds |
MANDATE_INTEGRITY_VIOLATION | Config file modified while bot is running | Stop the bot, verify config, restart |
Related guides
- OANDA Setup Guide โ forex, REST API, practice accounts
- MetaTrader 4/5 Setup Guide โ forex, Expert Advisors, multi-broker
- TradingView Webhooks Setup Guide โ route alerts to any adapter
One bot. $129. No subscription. No $749/mo platform. โ Build for FXCM