CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. Trade only with money you can afford to lose.
Educational guide + demo account
+

Test a trading idea before you trust it

You have an idea for a trade. Before money goes behind it, you want to know whether it survives a real test: the broker's costs, a period it has never seen, and the number of attempts you have already spent on it. This page shows how to run that test with Claude on cTrader's own tools, in eight steps. A demo account is enough for everything below.

Already know what you need? Skip to the full kit (zip) ↓ — every prompt, command and checklist on this page, plus a README, in one archive. No sign-up.

Official MCP servers

Vendor release, 14 May 2026 — not a third-party bridge.

41 sec First cBot compiled

Measured on our stand: draft 35.9s + compile 5.2s, one iteration.

Demo Account needed

Free, and enough for every step on this page.

You Who confirms trades

A setting you switch on — never assumed, never hidden.

What this is, in one line

Claude — the AI agent — never places an order. It writes a cBot in C# or Python from a rule you describe in words. cTrader's own command-line backtester compiles and runs it against two time windows with the broker's real costs. Claude then reads the two JSON reports and writes a plain accept/reject verdict. Nothing here needs Claude to place an order — the CLI runs the test, and a cBot, if you ever run one, is started by you.

Claude never places orders Confirmation is a setting you switch on Keys stay in the config file, never in a prompt No code word, no e-mail, no paid community

Why Claude will not place orders — and what that means for you

Anthropic's consumer terms ask users not to rely on the service to buy or sell securities. Claude drafts, reviews and writes reports; the CLI runs backtests; you start anything that ever touches a live account. See the full explanation in the FAQ ↓

The eight setup steps to connect Claude + cTrader

Each step has one job. Do them in this order once; after that you mostly repeat steps 7 and 8 with a new rule. Every prompt is written to be copied as-is — fill in the parts in angle brackets.

1

cTrader and a demo account

Install the cTrader Windows or Mac application and sign in with a cTID from a TopFX demo account: free, and enough for everything on this page — how to open an account, and the platform as offered here — cTrader at TopFX.

2

Claude Code

If you already use Claude in the app or browser, you're already signed in — Claude Code uses the same Anthropic account, just from a terminal window instead of a chat window. New to Claude? You'll need a paid subscription or Anthropic Console access: the free chat plan does not include Claude Code (see the cost section below). Either way, install it once:

This means Claude Code specifically — a separate command-line agent, not the Claude Desktop app or the claude.ai chat you may already use. This guide needs an agent that runs directly on your machine (Claude Code, or another local coding agent like Cursor or Windsurf): Claude Desktop's connectors reach the internet through Anthropic's cloud, not your own computer, so it can't reach cTrader's local server in step 5.

Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex

Installing Git for Windows first is recommended — it gives Claude Code a bash shell to work in.

macOS · Linux · WSL
curl -fsSL https://claude.ai/install.sh | bash
3

cTrader CLI

Not the cTrader app you already trade in — this is a separate, free command-line tool from cTrader that runs and backtests a cBot that's already built. It doesn't write or compile code itself — that part still happens in cTrader Desktop's Automate editor (step 7 covers it). Install it once:

(Spotware — cTrader's official developer — is exactly who these commands install from.)

Windows (PowerShell, as administrator)
winget install Spotware.cTrader.CLI
macOS · Linux (Homebrew)
brew tap spotware/tap https://github.com/spotware/homebrew-tap brew install spotware/tap/ctrader-cli

Homebrew may print a wall of untrusted tap errors first — that's normal, it re-taps and installs right after.

Either way, confirm it's installed — this doesn't need you to sign in:

ctrader-cli --version

That's it for this step. Nothing else to configure yet — the credentials file (your cTID and a password file) only comes into play in step 8, when a command needs to touch your account to run a backtest.

4

Install the skills package

The vendor's skills package — it teaches Claude how to drive the cTrader MCP server correctly (which tools are read-only, how to read the reports, the safe order to call things in):

npx skills add spotware/ctrader-skills --skill '*' --global

Restart your agent once it's done so it picks up the new skills.

5

Connect the local MCP server

In cTrader: Settings → MCP Server. Tick "Enable MCP server"; leave "Allow trading via MCP" unticked. Keep cTrader itself running — the local server lives inside it, so your agent needs it open in the background to connect at all.

On Claude Code, run this as a plain terminal command (not a chat message; type exit first if you're inside one) — it registers the server itself, no config file to find:

claude mcp add --transport http --scope user ctrader http://127.0.0.1:9876/mcp/

On a different MCP-compatible agent (Cursor, Windsurf and others also work)? Paste this as a chat message instead — the agent finds its own MCP config and adds the entry for you:

Give this to your agent mcp-config-local.json
Set up the cTrader local MCP server for me. Add the following to my MCP configuration, then verify the connection:

{
  "mcpServers": {
    "ctrader": { "type": "http", "url": "http://127.0.0.1:9876/mcp/" }
  }
}

127.0.0.1 means "this machine" — your agent needs to be running locally, on the same computer as cTrader, not in a remote or cloud session (Claude Desktop's connectors don't count — see step 2).

6

First session: check accounts and tools

Restart the agent once more so it picks up both the skills package and the new server, then run this — it lists your accounts, confirms DEMO, and sorts the tools into read-only and changing:

Prompt 1 of 5 05-prompt-first-mcp-session.txt
List every account visible through the cTrader MCP server. For each one, state clearly whether it is DEMO or LIVE. Then list the available tools and sort them into two groups: read-only (data, history, reports) and changing (anything that could place, modify or cancel an order). Do not call any changing tool. Confirm the active account is DEMO before we continue.
7

Draft the cBot

Give Claude your rule in one message: instrument, timeframe, entry, exit, stop-loss, and the one parameter you want to tune. It hands back the C# source — paste it into a new cBot in cTrader Desktop's Automate editor and click Build there; that's what turns it into the .algo file cTrader CLI can run. On our stand the draft plus that build took 41 seconds for the example rule (EUR/USD, H1, SMA cross, ATR stop) — the full source is in the kit as cbot-template/SmaProbe.cs, a shape to replace, not a rule to trade.

Prompt 2 of 5 01-prompt-draft-cbot.txt
You are drafting a cBot for cTrader Automate (C#) that will be backtested with cTrader CLI. Read the command reference at https://github.com/spotware/CLI-references before proposing any command. Do not invent options. Use placeholders for the account id and file paths. Never ask for a password.

Rule: <instrument, timeframe, entry, exit, stop-loss, exit rule>
Parameter to expose as a cBot parameter: <name, default, sensible range>

Deliver: (1) the cBot source, ready to paste into cTrader Desktop's Automate editor; (2) a .cbotset file with the defaults; (3) the exact backtest commands for the in-sample window <dates> and the out-of-sample window <dates>, with --commission, --spread and --report-json; (4) your assumptions and anything that is missing.

Do not start `run`. Do not place orders. Do not estimate returns.
8

Backtest with costs, then the acceptance report

Ask Claude Code to run this — twice, once for each time window (in-sample, then out-of-sample): same cBot, same command, only the dates and the output file name change:

ctrader-cli backtest "path/to/YourBot.algo" --ctid=<your cTID> --pwd-file=path/to/password.pwd \ --account=<account number> --symbol=EURUSD --period=h1 \ --start="<window start>" --end="<window end>" --data-mode=m1 \ --commission=<broker's commission> --spread=<broker's spread> --report-json=<report name>.json

First the in-sample window with report-in-sample.json, then the out-of-sample window (dates it hasn't seen) with report-out-of-sample.json. Account number and cTID are in cTrader; the password file is plain text with just your cTID password, never typed into the command itself.

Attach both JSON files and this is attempt N on this family of ideas — every parameter change counts as one attempt.

Prompt 3 of 5 02-prompt-acceptance-report.txt
Attached are two JSON backtest reports from cTrader CLI: in-sample and out-of-sample. This is attempt number N=<n> on this family of ideas (every parameter set and every rule change counts as one attempt).

Write an acceptance report with exactly these fields, each quoting the report it comes from: trades (IS / OOS); net result sign (IS / OOS); max balance drawdown (IS / OOS); ProfitFactor (IS / OOS); buy-and-hold of the same instrument over the same period; cost sensitivity (a third report with the spread doubled, if attached); N and the noise threshold for N attempts; bootstrap of trade order (drawdown distribution, if computed).

Verdict: "not rejected" or "rejected", with the reason. Do not forecast. Do not recommend a position. Do not use the word "works".

"Not rejected" does not mean the idea makes money — it means it survived the filters you declared before the test. Full method in the journal section ↓

Two more prompts, once the loop works

Not part of the eight steps — use these once you are iterating on ideas that already passed step 8.

Prompt 4 of 5 03-prompt-position-size.txt
Compute the volume in lots for a fixed risk of <amount or % of balance> per trade on <instrument>, with a stop-loss of <pips/points>. Read the pip value from the terminal for this account and symbol; do not assume a standard-lot value. Show the formula and round down to the nearest valid lot step.
Prompt 5 of 5 04-prompt-morning-pipeline.txt
Write a scheduled script (shape only, for a cron-like container) that: pulls fresh data with cTrader CLI for <instruments>; applies these filters: <declared filters>; queues backtests for anything that passes; and sends me one summary report to <channel>. It must never place, modify or cancel an order — only run backtests and report.

If something doesn't work

The most common snags across steps 1–8, and what they usually mean.

If the agent does not see the MCP server

Nine times out of ten it is the configuration file: one stray comma, or the URL without the trailing slash — http://127.0.0.1:9876/mcp/, as the vendor writes it. cTrader must be running with the setting ticked; restart the agent after installing the skills package.

It worked, then an update broke it

After a cTrader or Claude Code update, check the three tick boxes again and re-run the first-session prompt. The vendor's servers and skills package are versioned; when they change, the change has a date.

The backtest reports no trades, or no data

Check --start and --end in the vendor's reference format, the symbol name exactly as your broker spells it, and the data mode: m1 for H1 and above, ticks for anything below M15. The first run downloads history from the broker's server, and in the shipped image (CLI 5.9.11) every run downloads it again: there is no --data-dir in that build — the command reference documents the flag for 5.10, and an unknown flag with a value is taken silently as a cBot parameter.

Prefer Docker for the CLI?

Pull the image instead of winget/Homebrew:

# Docker Desktop on Windows runs on WSL 2 docker pull ghcr.io/spotware/ctrader-console:latest

On Windows, enable WSL 2 first and run the pull from PowerShell. Mount the folder where you exported the .algo file from cTrader Desktop (step 7), so it's visible inside the container too. The full setup guide covers a manual Windows install as well.

"The model cannot read my chart"

It is not supposed to. A model does not read prices off pixels reliably; this setup feeds it data through the MCP tools and the JSON reports, never through screenshots.

Does this work with my setup?

Coming from MetaTrader, TradingView or NinjaTrader

What carries over, what changes, and what to check before anything leaves the demo account.

An EA in MQL4/MQL5

Claude translates it to C#; the translation goes through the same two-window test as a new idea — a port is a new attempt, not a proven one.

A Pine Script strategy

Same translation; expect different numbers — Pine and the CLI use different fill models. The acceptance report is written from the CLI run with the broker's costs.

A NinjaScript/Sierra Chart study

Same path: the indicator logic carries over, order handling is rewritten for cTrader Automate.

History

Comes from the broker's server through the CLI: m1 for H1+, ticks below M15; m1-csv with --data-file takes your own CSV. Measured on 17 September 2026: a year of EUR/USD minute bars arrived and replayed in about 90 seconds; the shipped image (CLI 5.9.11) has no --data-dir, so history is fetched again on each run unless the platform's own data folder is mounted. Nothing to buy from a data vendor.

Live execution

A cBot in cTrader, started by you, or the vendor's cloud. Never the model.

Prop-firm accounts

FTMO lists cTrader alongside MT4/MT5/TradingView; whether a cBot may run on an evaluation account is each firm's decision and it changes — read current rules first. Everything here stays on demo.

Instruments and timeframes. The commands default to EURUSD on H1. Gold: the same command with --symbol=XAUUSD --period=m15 --data-mode=ticks. Below M15, use tick data — minute bars hide the fills that decide a short-timeframe rule. Position size for any of them: TopFX lot size page, plus prompt 4 of 5 above.

Is it free?

What this costs

One line: only Claude Code itself costs anything. The demo account, cTrader, the CLI, the Docker image, both MCP servers and the skills package are all free.

Free Everything except Claude Code

Demo account, cTrader, CLI, Docker image, MCP servers, skills package, this page and the kit.

Your choice How you pay for Claude Code

A Claude subscription, or Anthropic Console access billed by use. The free chat plan does not include Claude Code.

2 calls Claude usage, per idea

The draft (step 7) and the acceptance report (step 8). Backtests themselves cost nothing — the CLI runs those, not Claude.

Nothing here polls the market in the background, so usage doesn't quietly drain while you're not looking: Claude is only called when you change an idea, and the scheduled report in prompt 5 of 5 runs through the CLI, not through Claude.

Any proof this works?

The journal of attempts: proof without income figures

Every attempt on our stand, two windows, real costs, a binary verdict — no return figure, ever.

4 September 2026

Toolchain on the vendor's Docker image · EUR/USD H1 · SMA cross, ATR stop

Scaffold
2.4 s
Draft
35.9 s
Compile
5.2 s, one iteration
Status
Compiled, not yet backtested
17 September 2026

EUR/USD H1 on a TopFX demo account · SMA cross, ATR stop · in-sample 2024, out-of-sample H1 2025 · 1.2 pips spread, no commission

Status
Rejected — in-sample 2024: 146 trades, net result negative, profit factor 0.71, max balance drawdown 0.59%. Out of sample H1 2025: 67 trades, positive, 1.38, drawdown 0.17% — yet behind buy-and-hold of the same instrument over the same windows (6.25% down, then 13.88% up). Spread doubled to 2.4 pips: 1.18. Bootstrap of trade order, 5,000 shuffles: median drawdown 0.64% and 0.22%. N=1.

Each entry shows

# fields in every journal entry
dateinstrument and timeframe — when it ran, and on what
rulethe one-line rule Claude drafted from
windowsin-sample (tuned on) · out-of-sample (untouched until the end)
coststhe commission and spread passed to the CLI
tradesper window — too few out of sample reads as inconclusive
verdictnot rejected · rejected · inconclusive, with the reason
Nattempts this family of ideas has consumed so far
reportsthe two JSON files the verdict was written from

How a verdict is reached

01

Number of trades in each window. Too few out of sample, and the verdict is "inconclusive", not "not rejected".

02

Sign of the net result and the maximum balance drawdown, in-sample and out-of-sample, side by side.

03

Buy-and-hold of the same instrument over the same period — an idea that loses to holding it is rejected.

04

Cost sensitivity: the same run with the spread doubled — an idea that dies on costs is rejected.

05

Declared N: how many attempts this family of ideas has consumed. With N attempts, the best result of pure noise isn't zero — across ten thousand attempts over five years, the expected best Sharpe ratio of noise is about 1.7 (Bailey and others, 2014). The threshold rises with N.

06

Bootstrap: shuffle the order of the trades a few hundred times and look at the distribution of drawdowns, not the one path history happened to take.

What this setup does

  • Drafts a cBot and the exact CLI commands from a rule you write in words.
  • Runs every backtest through the vendor's own CLI, with real commission and spread.
  • Writes an accept/reject verdict from two JSON reports, field by field.
  • Keeps every prompt, command and checklist on this page and in one open archive.

What you will not find here

  • Income figures of any kind, ours or anyone else's.
  • Where the price is going, market calls, or a model reading a chart from a screenshot.
  • Buy or sell recommendations for any instrument, or copying other people's trades.
  • A claim that trade confirmation happens by itself — it is a setting you switch on.
  • Claims of being first or the sole platform with an AI integration — several brokers and platforms have shipped MCP servers or agent APIs; cTrader is one of the first FX/CFD platforms with official ones.

Ground rules

A model does not predict price and does not guarantee anything.

A person is in the loop: one command, one review, one confirmation.

Demo first. Demo is enough for everything on this page.

Code with rules beats an opinion: filters and sizes are computed, not felt.

Context beats the question: Claude gets the report, the costs and the constraints — not "is this a good trade".

Claude is a reviewer, not a generator of trades.

Where's the file?

Everything in one archive

The same five prompts and commands from the eight steps above, plus checklists and the MCP configuration — one zip, no sign-up, and a README that says what's inside and in which order to use it.

15 plain-text files and one C# source. No code word, no e-mail, no community.

Download the kit (zip)
Inside the zip
  • README.txt — what is inside and in which order to use it
  • 05-prompt-first-mcp-session.txt — step 6's prompt
  • 01-prompt-draft-cbot.txt — step 7's prompt
  • 02-prompt-acceptance-report.txt — step 8's prompt
  • 03-prompt-position-size.txt · 04-prompt-morning-pipeline.txt — the two optional prompts above
  • commands-backtest.sh — the in-sample/out-of-sample commands with your broker's costs and --report-json
  • cbot-template/SmaProbe.cs — the cBot that compiled on our stand, 4 September 2026
  • mcp-config-local.json — the local MCP server entry, as documented by the vendor
  • pipeline-cron.txt · position-size-formula.txt — the schedule's shape; the sizing formula
  • checklist-*.md (four files) — acceptance-report fields; before sizing; before the first scheduled run; what the model sees and could change
Not in the kit
  • No "strategy that works" — the template is a shape; every rule, including this one, goes through the two-window test described in the journal section.
  • No trade calls, no files for a live account, no orders.
  • No code you'd have to trust blindly: Claude drafts it, cTrader Desktop builds it in front of you, you read every line.

The cBot that compiled on our stand

A template for the shape of a cBot, not a rule to trade — the rule is the part you replace. Claude drafted it from the rule below in 35.9 s; building it in cTrader Desktop's Automate editor took 5.2 s, one iteration.

# cbot-template/SmaProbe.cs
instrumentEUR/USD, H1
entrylong when the fast SMA crosses above the slow one, short on the cross below
positionone at a time, fixed volume
stop-loss1.5 × ATR(14)
take-profit2 × the stop
tunableFastPeriod — the one parameter exposed
compiled4 September 2026 · 73 lines

To use it: paste this file into a new cBot in cTrader Desktop's Automate editor, click Build to get the .algo file, then run the two-window backtest from commands-backtest.sh with cTrader CLI. Or hand Claude your own rule with prompt 2 of 5 and let it draft the C# from scratch.

Frequently asked questions

The model says it will not place orders. Is something broken?

No. That is its documented line: Anthropic's consumer terms ask users not to rely on the service to buy or sell securities. This page is built on the same line — Claude drafts and reviews, the CLI runs the backtests, and a cBot, if you ever run one on a demo account, is started by you in cTrader. Nothing here asks the model for an order, and a guide that shows how to get around the refusal asks the model to do the one thing its terms exclude.

Is anything on this page behind a sign-up?

No. The prompts, commands, checklists, template cBot and MCP configuration are on the page and in the kit archive. The only account involved is the broker's demo account, needed to run the backtests, not to read the page or download the kit.

Do I need to know how to code?

You need to read, not to write. Claude drafts the C# and the commands; the CLI builds and runs them; you review every command before it runs — the vendor's own model for AI-drafted commands.

Does it run on Windows?

Yes. cTrader has a Windows application, the CLI and its Docker image run on Windows (Docker Desktop on WSL 2), and Claude Code installs natively from PowerShell. The local MCP server is a setting inside cTrader — no store package to work around and no third-party bridge to keep alive.

Does "not rejected" mean the idea makes money?

No. It means the idea survived the filters you declared before the test. With enough attempts, noise survives too — that's why the number of attempts (N) is written into the report and raises the threshold.

Can I use this with a prop-firm account?

FTMO lists cTrader among its platforms; rules on running a cBot on an evaluation or funded account are the firm's own and they change, so read them first. For a challenge, the acceptance report should also carry the worst daily loss (closed and open positions together) and max drawdown against the firm's limits. Everything on this page stays on a demo account, which needs no firm's permission.

Is Claude required?

No. Any agent that can read the CLI reference and speak MCP will do — the vendor lists several developer clients. Our stand runs Claude Code on Console access rather than a chat subscription.

Can it run around the clock?

A cBot can run on a server or the vendor's cloud, on the rules you set. The scheduled script in prompt 5 of 5 produces a report — it does not place orders at any hour.

Can I do this from my phone?

The cycle runs on a computer — the CLI, Docker and Claude Code are desktop tools, and the local MCP server lives inside the cTrader desktop app. The cTrader mobile apps show the account and charts, enough to read a report on the way.

Start on a demo account

Everything on this page needs a cTID and a demo account. Open one, install the CLI or pull the Docker image, and run the first prompt.

  • AI disclosureParts of the code samples and prompts on this page were drafted with an AI model and reviewed by a person before publication.
  • Not adviceThis page is education about tools. It is not investment advice, not a recommendation to trade any instrument, and not an invitation to open a live account.
  • ProtectionA general-purpose AI model is not a regulated financial service. Its output is not covered by any investor compensation scheme or financial ombudsman.
  • Broker disclosureThe broker's own disclosure states that 85.19% of retail investor accounts lose money when trading CFDs with this provider.

Sources and dates

Disclosure: Spotware, the vendor of cTrader, lists TopFX among its featured clients. This page is written by an independent introducing-broker partner of TopFX, not by either company. This site serves clients of TopFX in Malaysia; a reader elsewhere runs every step on any cTrader demo account with the same CLI, image and MCP servers.