TraderWAI
PlatformsAIsPricingDocsBlogInvestorsContact
Sign inStart free
All posts
GuidesNovember 23, 2026· 3 min read

Write and backtest trading strategies in Trae with real market data (MCP guide)

Add TraderWAI as a remote MCP server in Trae and the agent can pull real OHLC data, read charts and backtest strategies on 1-minute history, so you stop scraping data and writing your own backtester.

Gold chart marked up by the AIYour AI analyses, draws on the chart and trades on your broker. Free, no card.Connect your AI freeNo broker yet? Try it free with a simulated account: your AI trades with virtual money and real prices. Write and backtest trading strategies in Trae with real market data (MCP guide)

When you write a trading strategy in Trae, the hard part is rarely the logic. It is the data: finding a source, writing a scraper, fixing time zones and missing candles, and then building a backtester you have to trust. With TraderWAI added as an MCP server, Trae's agent calls real market data and a backtest engine directly, and you focus on the strategy code.

What the agent can do

  • Pull real candles and prices: forex pairs, gold, silver, indices, oil, crypto and US stocks, on any timeframe (get_ohlc, get_quote), and look at the chart (get_chart).
  • Backtest rule-based strategies on the server with 1-minute history: every trade, win rate, total R and drawdown (backtest_strategy).
  • Draw its analysis on a real chart: levels, zones, trendlines and a trade idea (draw_chart).
  • Economic calendar and market structure: get_economic_calendar and get_market_structure.

How to connect

These steps work in Trae (trae.ai) and Trae CN (trae.cn). Menu names may be worded slightly differently between the two.

  1. In the IDE window, open Settings → MCP.
  2. In the MCP servers area, click Add → Add Manually at the top right (the first time, there is also an Add Manually button in the middle of the area).
  3. Paste this configuration in the manual configuration window and click Confirm:
{
  "mcpServers": {
    "traderwai": {
      "url": "https://mcp.traderwai.com"
    }
  }
}
  1. On the first connection, Trae opens your browser on the TraderWAI sign-in page (OAuth). Sign in with your Google or Microsoft account. If you don't have a TraderWAI account yet, it is created at this step, for free. There is no API key and no headers to fill in.
  2. Once you have signed in, TraderWAI appears in the MCP list. Configured MCP servers are added to the built-in agent automatically, and you can switch them on or off in the agent's edit page.
  3. Using a custom agent? Open Create Agent and, under Tools → MCP, tick TraderWAI and the tools you want it to use.
  4. Pick the agent in the chat and start asking.

If the server shows as not authorized, reconnect it from the MCP list or restart Trae and try again.

Example prompts

  • "Use TraderWAI's get_ohlc to pull the last 500 H1 candles of EUR/USD, save them to data/eurusd_h1.csv and write a Python function that computes ATR(14)."
  • "Use backtest_strategy over the last two weeks: buy gold when it breaks the Asian session high between 07:00 and 12:00 UTC, stop at the Asian low, target 2R. Don't compute anything yourself from candles."
  • "Save the parameters you just sent as strategies/gold-asia-breakout.json so I can re-run it every week."
  • "Show me the H4 market structure on the Nasdaq 100 and draw the key zones on the chart."

Why not scrape the data yourself

A home-made backtester has to handle sessions, time zones, spreads and the order in which stops and targets are hit. Each of those is a place for a bug. backtest_strategy simulates each trade minute by minute on the server, and the same rule gives the same result every time. Your code stays in the repo, the rule as a JSON file, and each version is in git. It is the same idea as our Cursor guides: backtest a trading strategy with Cursor and build an AI trading bot in Cursor.

What the Free plan includes

  • Charts and market data, including get_ohlc: unlimited.
  • Marked charts: 20 a day.
  • Backtests: over the last 2 weeks of history. Paid plans unlock longer backtest history and more marked charts.

Analyses and backtests are educational and not investment advice.

Try it with your own AI

Connect Claude or ChatGPT to your broker in a few minutes. Free plan, no card.

Start free

Questions or ideas? Talk with us in our Telegram community

Trading leveraged products carries a high risk of loss. TraderWAI is a technology tool: it is not investment advice and it is not a broker.

Keep reading

Guides
Add live trading charts to Cherry Studio (MCP guide)
Guides
Backtest a trading strategy with Cursor (1-minute data, no code)
TraderWAI

Connect any AI to your broker, with you in control.

Product
  • Platforms
  • AIs
  • Pricing
  • Docs
  • Status
  • Sign in
Resources
  • Connection guides
  • Broker guides
  • Best MCP servers for trading
  • Strategy backtests
  • Markets today
  • FAQ
  • Blog
  • Telegram community: questions & ideas
Company
  • Investors
  • Contact
  • Brokers and prop firms
Legal
  • Privacy
  • Terms

Trading leveraged products such as CFDs, forex and futures carries a high risk of losing money. TraderWAI is a technology tool: it does not provide investment advice and does not manage funds. The AI's analyses and proposals are not recommendations; you decide every order.

© 2026 TraderWAI · FLEXIN AGILE LTD