Skip to Content

Profiles

Each profile is one broker account, one .env file, and one process on its own port — the same model as mt5-trader.

ctrader-markets --profile forex # reads .env.forex → :8010 ctrader-markets --profile deriv # reads .env.deriv → :8011 ctrader-markets # reads .env
ProfileEnv fileDefault portToken cache (example)
forex.env.forex8010data/token-cache.forex.json
deriv.env.deriv8011data/token-cache.deriv.json
(none).envfrom env / default 8010from TOKEN_CACHE_PATH

Copy the matching example and fill it in:

cp .env.example.forex .env.forex cp .env.example.deriv .env.deriv

One process per account

Run exactly one process per broker account. Two processes on the same credentials mean two sessions and two token-refresh races.

PORT must differ from every other profile on the same host. It is read only from the env file: the launchd plists set no environment, so the ports in their comments are documentation.

Give every profile its own TOKEN_CACHE_PATH. The refresh token rotates, so two profiles sharing one cache invalidate each other’s tokens. See Token Lifecycle.

Deriv symbols

For a Deriv profile, do not copy symbol names from mt5-trader/.env.example.deriv. Those are Deriv’s MT5 synthetic indices (“Volatility 75 Index”, “Boom 500 Index”) and will not resolve on a cTrader broker. Startup fails closed if any name cannot be resolved — run --discover-symbols and paste the exact, case-sensitive symbolName values.

Demo vs live

CTRADER_ENVIRONMENT is demo or live. Demo and live are fully separated connections and cannot be mixed. Start on demo until the feed and symbol list are verified.

Last updated on