Build trading algorithms with AI.

  • Write strategies in Python, with an AI assistant
  • Let AI agents improve them in the background
  • Backtest on point-in-time data, trade through 10 brokers
Get started
The code editor: a strategy in Python, the ETFs it trades, and the AI assistant beside it
The same strategy's live trading dashboard: its balance and returns, its performance against the benchmark, and its open positions

The screenshots show demo data, and charts elsewhere on this page are illustrations: none are results of a real strategy.

Three ways in

Trade the way you want.

Write every line yourself, let the assistant draft it, or bring a strategy you already trust to a broker.

You write the code

Write it yourself

Start from a blank file or a dataset example and use the whole LEAN API. Every line is yours.

main.py
SPYAAPLGCESEURUSDBTCUSD
From backtest to broker

Take it live

Paper first

Deploy the code you backtested to a paper or live account, and watch positions and orders as they happen.

Paper accountrunning
Equities62%
Futures23%
Crypto15%
GoalKeep drawdown under 15% with a Sharpe above 1, 2010–2020
running
Spent$1.84 of $5.00
Backtests9
Final test2019–2020
  1. Read the strategy and its last backtest
  2. Added a 200-day trend filter · backtest 3
  3. Cut position size in high volatility · backtest 7
  4. Final test on held-out dates
Illustration
AI agents

Give an AI agent a task. Review what it finds.

An agent works on a copy of your algorithm in the background: it changes the code, runs backtests, reads the reports and tries again, within a budget you set.

  • Tasks in plain English: a lower drawdown, a higher Sharpe, fewer trades
  • A final test on dates the agent never sees until its last step
  • Nothing changes in your algorithm until you adopt it
  • Available Research agent
  • Coming soon Monitoring agent
  • Coming soon Paper trading agent
Data

Data that's ready in one line.

Load a dataset by name and it arrives in your algorithm at the moment it became public, so a backtest never sees the future. No downloads, no cleaning.

  • US companies with fundamentals from every 10-K and 10-Q
  • Weekly positioning in 806 futures markets from the CFTC, since 2006
  • US equity, forex and crypto price history
  • Every value at the time it was published
class Strategy(QCAlgorithm):
    def initialize(self):
        # fundamentals from every 10-K and 10-Q
        self.aapl = self.add_data(SecFundamentals, "AAPL").symbol
        # weekly CFTC positioning in gold futures
        self.gold = self.add_data(CotReport, "GC").symbol

    def on_data(self, data):
        # each value arrives on the day it became public
        if self.gold in data:
            self.log(data[self.gold])
Security

Your code is private and your accounts stay protected.

Isolated runs

Every backtest runs alone in its own container, with no network access and fixed CPU and memory limits.

Encrypted broker keys

Credentials are encrypted before they are stored, and only decrypted to place your orders.

Private by default

Your projects, backtests and deployments are visible to your account only.

Brokers and data

Trade through 10 brokers and exchanges.

Connect the account you already have. Several offer paper or demo accounts, so you can go live without real money first.

  • Interactive BrokersStocks, options, futures, forex, bondsPaper trading
  • AlpacaUS stocks, options, cryptoPaper trading
  • OANDAForex, CFDsPaper trading
  • TradierUS stocks, optionsPaper trading
  • CoinbaseCrypto spot
  • KrakenCrypto spot
  • BinanceCrypto spot and futuresPaper trading
  • Binance.USCrypto spot
  • BybitCrypto spot and futuresPaper trading
  • BitfinexCrypto spot and margin
30+fundamental fields per filing
806futures markets of positioning data
10brokers and exchanges
20+statistics in every backtest
FAQ

Questions, answered.

How MarketsCoder works, what you need to get started, and what a backtest can and can't tell you.

Ready to test your first strategy?

Write it yourself or describe it to the assistant, and see a full backtest report in minutes.

Get started
How does MarketsCoder work?

You write a strategy in Python, or ask the assistant to draft one. A backtest runs it on the open-source LEAN engine against historical data and gives you a full report: returns, drawdowns, risk statistics, every order and trade. An AI agent can then work on a copy in the background to improve it. When you're ready, you deploy the same code to a broker account, paper first if your broker offers it.

What is an AI trading agent?

An agent is Claude working on its own toward a goal you set, such as a lower drawdown or a higher Sharpe ratio, within a budget you choose. It edits a copy of your algorithm, runs backtests, reads the reports and tries again, then tests its finished version once on dates it never saw. You review the changes and decide whether to adopt them.

Do I need to know Python?

It helps, but you can start without it. The assistant writes a first version from a plain-English description, explains the code, and runs backtests for you, so you can learn by changing working examples.

What data can my backtests use?

US company fundamentals from every 10-K and 10-Q, weekly futures positioning from the CFTC, and sample price data for US equities, forex and crypto. Every dataset is point-in-time: a value reaches your algorithm when it became public.

Which brokers can I trade through?

Interactive Brokers, Alpaca, OANDA, Tradier, Coinbase, Kraken, Binance, Binance.US, Bybit, Bitfinex. Several offer paper or demo accounts, so you can run a strategy live without real money first.

Can an AI agent trade with my money?

No. Agents work on a copy of your algorithm and only run backtests. Nothing changes in your algorithm until you adopt it, and you decide what gets deployed to a broker.

How much do AI agents cost?

You set a budget for each run, and it has to be in your prepaid balance to start. You pay only for what the agent uses, and it pauses when the budget runs out, so you can add more or stop.

Is my code and my account safe?

Projects belong to your account and nobody else can see them. Each backtest runs in its own container with no network access, and broker credentials are stored encrypted.

Does a good backtest mean the strategy will make money?

No. A backtest shows how rules would have behaved on past data. Markets change, and real fills, costs and your own decisions differ. Treat results as research, and start live trading small.