cTrader CLI¶
cTrader CLI is a command-line tool that manages account, trading and algo operations directly from a terminal, without opening the cTrader desktop application. You type commands to sign in, read market data, place and manage trades, and run, backtest and optimise cBots.
cTrader CLI in one minute!
There are two main ways to use cTrader CLI. You can type and script the commands yourself, or an AI agent can turn your natural-language requests into cTrader CLI commands for you to review and run. Either way, you can:
- Connect cTrader to AI agents that write CLI commands for you to review and run.
- Run cBots on Windows, macOS and Linux without keeping the cTrader desktop application open, which saves RAM and CPU resources.
- Host cBots on a low-cost Linux VPS or cloud server instead of a resource-intensive desktop machine.
- Read account data, prices and history, and place or manage orders and positions from scripts and automated workflows.
Note
cTrader CLI runs cBots on your machine or server. This is different from running cBots in the cloud, where cTrader hosts them on its servers, so nothing needs to remain running on your end.
cTrader CLI scenarios¶
cTrader CLI supports two main scenarios. Both rely on typed commands rather than a graphical interface, but they suit different goals.
| Scenario aspect | AI agent, no interface | Self-hosted on a VPS or in the cloud |
|---|---|---|
| Goal | Operate cTrader through an AI assistant, with no terminal and no graphical UI. | Run cBots around the clock on a server you manage, with the desktop application closed. |
| Typical user | A user who describes goals in natural language; an AI assistant drafts the commands for you to review and run. | A trader or operator with terminal literacy who types or scripts the commands. |
| Command source | Generated by the AI from a natural-language request or a scripted agent workflow. | Typed at the terminal, or from a script, cron job or docker run. |
| Output handling | JSON parsed by the AI into a response or the next prompt. | JSON to stdout, redirected to files or piped into other tools. |
| Long-running commands | The AI agent should not start run autonomously. It can safely monitor cbots and read live price output, but any command that starts, configures or stops a cBot must be reviewed before it runs. | run is a long-running process that needs a process supervisor such as systemd, Docker or --exit-on-stop; every other CLI command is a one-shot call that returns a result and exits. |
Note
You provide and manage the server or workstation in both scenarios. cTrader CLI does not include a managed hosting service.
Set up cTrader CLI¶
cTrader CLI vs cTrader MCP servers¶
Both cTrader CLI and the cTrader MCP servers let you operate cTrader without manually clicking through its interface, but they work in different ways. Use the table below to choose the option that matches your workflow.
| cTrader CLI | cTrader MCP servers | |
|---|---|---|
| How you interact | You type commands in a terminal, or an AI drafts them for you to review and run. | You describe what you want in natural language and an AI agent carries it out. |
| cTrader app required | None, runs on its own from a terminal, VPS or container. | A cTrader host must stay open in the background, either the desktop application on Windows or macOS for local use or a cTrader Web session for remote use. |
| Where actions appear | Terminal only, as text and JSON; nothing is shown in a cTrader interface. | In the cTrader interface, alongside your normal platform view. |
| Best suited to | Scripted, repeatable automation and hosting cBots on a server. | Conversational trading, analysis and ad-hoc questions through an AI assistant. |
Tip
Choose cTrader CLI when repeatability and precise control matter most. Choose the cTrader MCP servers when conversational interaction with an AI agent is the priority.
Explore cTrader CLI¶
-
Use an AI assistant to draft cTrader CLI commands for you.
-
Run, stop and backtest cBots from the terminal.
-
Build and export the
.algofile that cTrader CLI runs. -
Browse the raw commands and code.
Operations¶
cTrader CLI groups its commands by task. The table below lists the available operations. Detailed syntax, options and examples for every command are available in the CLI references.
| Operation | cTrader CLI |
|---|---|
| List accounts and review account statistics | ✅ |
| List available symbols and review their trading sessions and conditions | ✅ |
| Read live prices and historical candles | ✅ |
| Place market, limit, stop and stop-limit orders, modify and cancel pending orders, list existing orders | ✅ |
| Modify stop loss and take profit, close fully or partially, and list open positions | ✅ |
| Pull deals, completed order history and current exposure | ✅ |
| Calculate current and historical indicator values and list available indicators | ✅ |
| Create, delete and list price alerts | ✅ |
| Run, stop and backtest cBots and read cBot metadata | ✅ |
| Optimise cBots | ✅ |
| Scaffold and build cBot, indicator and plugin projects | ✅ |
Warning
cTrader CLI is a tool for trading and automation. It does not provide financial, investment, legal or tax advice. Commands that place or change orders can trigger real trades and result in losses. Verify every command before you run it, test on a demo account first and protect your credentials.