โ—Forex

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

  1. Log in to FXCM Trading Station
  2. Navigate to the API settings or token generation page
  3. Generate an API access token
  4. 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

EndpointLimitNotes
REST APIRate-limited per documentationMarket data, account info, order placement.
StreamingPer connectionReal-time price updates.
FIX ProtocolAvailable for institutional accountsLower 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

ErrorCauseFix
CONNECTION_REFUSEDAPI token invalid or expiredRegenerate the token in FXCM Trading Station
RATE_LIMITEDRequest limit exceededIncrease rate_limit_ms in adapter config
ACCOUNT_NOT_FOUNDAccount ID incorrect or token mismatchVerify account_id in adapter config
INSUFFICIENT_MARGINMargin requirement exceeds available fundsReduce position size or add funds
MANDATE_INTEGRITY_VIOLATIONConfig file modified while bot is runningStop the bot, verify config, restart

Related guides


One bot. $129. No subscription. No $749/mo platform. โ†’ Build for FXCM


Build your FXCM bot

Ready to build?