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.
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 1: Claude writes the strategy, TradingView runs it
NO MODEL IS INVOLVED WHEN THE ORDER FIRES.
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.
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.
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.
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 withAdd 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.
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.
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.
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 twiceChecks 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_keywith 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.
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?+
What is a Claude trading bot?+
Does Claude Code work with MetaTrader 5?+
Can Claude use TradingView?+
Can I use Cursor or another AI app instead?+
Is it safe to let an AI place trades?+
What does it cost?+
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