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| Profile | Env file | Default port | Token cache (example) |
|---|---|---|---|
forex | .env.forex | 8010 | data/token-cache.forex.json |
deriv | .env.deriv | 8011 | data/token-cache.deriv.json |
| (none) | .env | from env / default 8010 | from TOKEN_CACHE_PATH |
Copy the matching example and fill it in:
cp .env.example.forex .env.forex
cp .env.example.deriv .env.derivOne 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.