GUIDE · CLAUDE · MT5 · NOVEMBER 2026

Claude trading bot: three setups that reach a real MT5 account

A Claude trading bot is Claude plus something that reaches a trading account: a strategy it wrote that TradingView runs, an MCP server it can call, or a script that passes its decisions to an API. Each one puts the model at a different distance from your money. This guide sets up all three on MetaTrader 5 and says what to check before any of them goes live.

BBenjamin SF · Founder Published Nov 22, 2026 Read 10 min

Quick answer

CHECKED ON 22 NOVEMBER 2026.

Claude has no connection to a broker, so it cannot place a trade by itself. It needs a tool that reaches your account. Three setups work on MetaTrader 5. Claude writes a Pine Script strategy and TradingView alerts execute it through a webhook. Claude calls an MCP server such as SFConnect to read your account and send signals. Or your own script asks the Claude API for a decision and posts it to a trading API. In the first setup the model is out of the picture when the order fires. In the other two it decides, so start with dry runs and a read-only key.

Three ways to build a Claude trading bot

HOW THE ORDER HAPPENS AND WHERE THE MODEL SITS.

Setup
How an order happens
Where the model sits
Claude writes or edits the Pine Script. You backtest it and create a webhook alert, and SignalForge AI turns each alert into an order on MT5 or cTrader.
Outside the execution path. The same alert always produces the same order.
You ask in plain words. Claude calls the SFConnect tools to read accounts and signals, or to send a signal to your EA.
Inside the loop, with a dry run by default and keys that cannot trade unless you allow it.
A script on a schedule sends your data to the Claude API, gets a decision back and posts it to the SFConnect REST API.
Inside the loop and unattended. The checks are the ones you write.

Setup 1: Claude writes the strategy, TradingView runs it

NO MODEL IS INVOLVED WHEN THE ORDER FIRES.

01

Write and test the Pine Script

Ask Claude for a Pine Script v6 strategy from rules you can state: entry, stop, target, session. Paste it into TradingView's Pine Editor and read the Strategy Tester before anything else. If you have connected TradingView's official MCP server, Claude can validate and backtest the script from the chat with run_pine_backtest, which returns the metrics and the most recent trades.

If you would rather not prompt for code, SFBuilder builds a Pine Script v6 strategy from blocks, with no model involved, and backtests it on real candles in your browser.

02

Create the webhook alert yourself

On tradingview.com, create an alert on the strategy and paste your SignalForge webhook URL and the JSON message. Webhook alerts need the Essential plan or higher and two-factor authentication. This step stays manual, because TradingView's MCP server cannot create webhook alerts. The Pine Script alert and webhook guide has the message formats.

03

Let the bridge execute

SignalForge AI receives the alert and places the order on MetaTrader 5 through its EA, on your own terminal or on SFCloud, or on cTrader through the official Open API. Your position sizing, news and trend filters and Prop Firm Shield apply to every alert. Setup guides: TradingView to MT5 and TradingView to cTrader.

Start here if you can. A strategy in Pine can be backtested and does the same thing on every alert, which a model answering in a chat does not.

Setup 2: Claude operates your MT5 through an MCP server

SFCONNECT: SIX TOOLS, DRY RUN BY DEFAULT.

1

Create a key

In your SignalForge dashboard, open SFConnect and create a key. Leave Allow sending signals unticked. A read-only key reads your data and can preview a signal as a dry run.

Read-only to begin with
2

Add the server to Claude

In Claude Code, run the command below and check it with /mcp. In the Claude app, go to Customize, Connectors, Add custom connector, paste the address, choose No sign-in and, under Request headers, add Authorization with the value Bearer sfk_YOUR_KEY (Claude does not add the word Bearer for you). Anthropic lists Request headers as a beta open to a limited set of organizations: if your account does not show that field, connect from Claude Code instead.

Claude Code or the Claude app
3

Ask, then send a dry run

Ask about your accounts and signals first, then ask for an order as a dry run to see what would be sent. Live orders need a key created with Allow sending signals ticked and dry_run set to false.

Live only when you say so
CLAUDE CODESHELL
claude mcp add --transport http signalforge \
  https://api.signalforge-ai.com/mcp \
  --header "Authorization: Bearer sfk_YOUR_KEY"

Things to ask

  • "Is my EA connected on all my accounts?"
  • "Why was my last signal rejected?"
  • "List this week's signals on my funded account and tell me which were rejected."
  • "Buy 0.10 XAUUSD as a dry run and show me what would be sent."

SFConnect has no market data or charts, so Claude cannot ask it for a price. It reads your MT5 account and sends signals; if you also have cTrader connected, name the account in each signal. The MT5 MCP server guide lists the six tools and compares SFConnect with the native MCP in MetaTrader 5.

Setup 3: your own bot on the Claude API

FOR DEVELOPERS. IT RUNS UNATTENDED.

If you want a bot that runs on a schedule with no chat window, write a script. It collects the data your rules need, asks the Claude API for a decision in a fixed JSON shape, validates that JSON in code and posts it to the SFConnect REST API. The key and the rules are the same as in setup 2.

YOUR SCRIPTPYTHON
import requests

API = "https://api.signalforge-ai.com/api/v1"
KEY = {"Authorization": "Bearer sfk_YOUR_KEY"}

# "order" is the JSON your script got from the Claude API and validated in code
order = {"action": "buy", "symbol": "XAUUSD", "lot": 0.1}

# dry run by default: validated and previewed, nothing is sent
r = requests.post(API + "/signals", headers=KEY, json=order)
print(r.json())

# live: add "dry_run": False and an "idempotency_key" so a retry is not sent twice

Checks to write before it runs alone

  • Validate the model's output in code: allowed symbols, a maximum lot and a stop on every order.
  • Send an idempotency_key with every live order.
  • Stay under the limits of the key: 60 requests and 10 signals per minute.
  • Log the prompt, the answer and the API response for every order.

Endpoints and schemas: api.signalforge-ai.com/docs/api.

TradingView, MetaTrader and cTrader have their own MCP servers

WHAT CLAUDE CAN DO WITH EACH ONE.

Server
What Claude can do with it
Limits
Watchlists, screeners, news, price alerts, and writing, validating and backtesting Pine scripts.
No order tool and no webhook alerts. Its terms forbid automated trading and trading decisions.
Read market information, analyse charts and work with the trading environment. MetaQuotes names Claude Code among the tools that connect.
Part of the terminal since build 6060. A setting allows AI-initiated trading, forbids it or asks for manual confirmation.
cTrader MCP
A remote server for balances, positions and orders on cTrader Web, and a local one for charts and indicators on cTrader Windows and Mac.
Free during beta. On the local server, trading stays off until you allow it, and confirming each order is a setting you turn on.

Do not feed an order-sending agent from TradingView's MCP server, since its terms rule out trading decisions. Use it for research and Pine work, and let alerts or your own data drive the orders.

Before Claude touches a live account

A SHORT LIST, IN ORDER.

  • Run it on a demo account first, with the symbols and lot sizes you plan to use.
  • Keep the key read-only until a week of dry runs matches what you intended.
  • Write the rules into the prompt or the project instructions: instruments, hours, risk per trade, maximum daily loss and when to stop and ask you.
  • Put the limits where the model cannot change them. Position sizing, the news filter and Prop Firm Shield live in your SignalForge settings and apply to every signal.
  • Expect seconds per decision. A model call is too slow for scalping, and each call has a cost.
  • Check what it tells you. Ask for the signal detail and compare it with your dashboard and your MT5 history.

A model can be wrong with full confidence, and no setting changes that. Trading involves substantial risk of loss. Claude is a product of Anthropic. SignalForge AI is not affiliated with Anthropic, TradingView, MetaQuotes or Spotware.

FAQ

CLAUDE, MT5 AND SFCONNECT.

Can Claude trade for me?+
Not by itself. Claude has no broker connection. It can write a strategy that TradingView runs, call an MCP server that reaches your account, or answer a script that then calls a trading API.
What is a Claude trading bot?+
Claude connected to a tool that reaches a trading account. The tool can be a Pine Script strategy with webhook alerts, an MCP server such as SFConnect, or your own script on a trading API.
Does Claude Code work with MetaTrader 5?+
Yes, in two ways. SFConnect is a remote MCP server you add with one claude mcp add command. MetaTrader 5 build 6060 also added native MCP support, and MetaQuotes names Claude Code among the tools that can connect.
Can Claude use TradingView?+
Yes, through TradingView's official MCP server: watchlists, screeners, news, price alerts and Pine scripts, within a daily call limit that depends on your plan. It cannot place orders or create webhook alerts, and its terms forbid automated trading.
Can I use Cursor or another AI app instead?+
SFConnect works with Claude, Claude Code, Cursor, VS Code and other apps that support remote MCP servers over HTTP. The REST API works with any model, because your own script makes the call.
Is it safe to let an AI place trades?+
It carries risk. SFConnect limits it: every signal is a dry run until you set dry_run to false, new keys are read-only, each key is capped at 10 signals per minute, and your own sizing and prop-firm limits apply. Start on a demo account.
What does it cost?+
SFConnect is included in the Trader plan at $14.99/month, with a 14-day free trial and no card, and in Pro and Elite. Your Claude subscription or API usage is billed separately by Anthropic.

RELATED GUIDES

INCLUDED FROM THE TRADER PLAN

Create a read-only key, connect Claude and look at a week of dry runs before you go live.

FROM $14.99/MO (TRADER) · 14-DAY FREE TRIAL, NO CARD · DRY RUN BY DEFAULT

SFConnect: API and MCP server for MT5 · included from Trader, 14 days freeSee SFConnect →