Get funded. Trade with your AI model. 20% off every challenge

Forex trading bot: EAs, robots and how to test one

Forex trading bot guide: MT4 and MT5 expert advisors vs API bots, rule based vs AI, how to test a forex robot, session timing and prop firm rules.

Vittorio De Angelis••14 min read
Share article
Forex trading bot: EAs, robots and how to test one

Run your algo on funded capital

Explore

A forex trading bot is a program that trades currency pairs automatically. In the MetaTrader world it is called an expert advisor (EA) or a forex robot. Elsewhere it is usually a script that talks to a broker or platform through an API. Either way, the bot follows fixed rules for entries, exits and position size, and it does so around the clock while the forex market is open.

The marketing around forex robots is louder than in most corners of trading, and regulators have spent years warning about it. This guide explains how forex bots work, how EAs differ from API bots, how to evaluate a robot before trusting it, and what to watch when running one under prop firm rules.

Quick answer: A forex trading bot, also called a forex robot or expert advisor, is software that opens and closes currency trades automatically from predefined rules. EAs run inside MetaTrader 4 or 5, while API bots connect to a platform directly. A bot removes emotion and fatigue, but it cannot create an edge, so test it carefully before trusting it.

Highlights of this article

  • Forex bots come in two forms: expert advisors that run inside MetaTrader, and API bots that connect to a platform from your own code
  • Most forex robots are rule based; AI models are a smaller, harder to validate category
  • A robot's backtest is the start of the evaluation, not the proof; forward testing and costs matter more
  • Session timing, rollover and swap charges change how a forex bot performs
  • On Velotrade, bots run through the DXtrade API (MT4 and MT5 EAs need a bridge or a rewrite), and grid, martingale style averaging down, arbitrage and HFT robots are not allowed

Funded accounts

Ready to get funded?

Trade up to $200,000 in firm capital with static drawdown, no consistency rule, and payouts within 24 hours. Pass the challenge and keep up to 90% of your profits.

Get funded from $40

Forex trading bot: key facts

Item Detail
Other names Forex robot, expert advisor (EA), algo, automated trading system
Where EAs run MetaTrader 4 (MQL4) or MetaTrader 5 (MQL5) terminals
Where API bots run Your own code on a server, connected to a platform's REST or WebSocket API
Common strategy types Trend following, breakout, mean reversion, grid, martingale, scalping
How to test Backtest, then out of sample test, then forward test on a demo or evaluation
Biggest risks Curve fitting, hidden martingale or grid logic, costs, fake track records
On Velotrade Bots allowed via the DXtrade API; grid, arbitrage, tick scalping and HFT are prohibited

What is a forex trading bot?

A forex trading bot is a set of trading rules written as code. It reads price data for pairs such as EURUSD or USDJPY, decides whether a condition is met, and sends orders without you clicking anything. Investopedia describes a forex trading robot as software that analyses and conducts currency trades automatically, and notes that most are built on MetaTrader using the MQL language.

Every forex bot needs the same building blocks: a price feed, entry and exit rules, a position sizing rule, a stop loss, and a way to stop trading when something goes wrong. The step by step build process is covered in how to build a trading bot. Here the focus is on the forex specific choices.

What is the difference between an EA and an API forex bot?

The biggest practical choice is where the bot lives.

MetaTrader EA (MT4 or MT5) API bot
Language MQL4 or MQL5 Any language, often Python or JavaScript
Where it runs Inside the MetaTrader terminal, often on a VPS On your own server or cloud machine
Built in testing Strategy tester inside the terminal You choose or build the backtester
Portability Tied to MetaTrader brokers Tied to the platform API you code against
Best for Traders already using MetaTrader, buying commercial EAs Custom logic, data analysis, multi-asset systems

MetaTrader 5's own help pages explain how to create an expert advisor in its editor and how to run it through the built in strategy tester. That makes EAs the easiest entry point for forex automation, and the reason most commercial forex robots are sold as EA files.

API bots trade off convenience for control. You can use any data library, keep your strategy code private, and run the same logic across asset classes. The cost is that you build more of the plumbing yourself: authentication, reconnection, logging and backtesting.

Velotrade runs on DXtrade, not MetaTrader. An MT4 or MT5 EA will not connect natively. To use one, you need a bridge, or you rewrite the logic against the DXtrade REST or WebSocket API. New systems can be built directly against the API. The DXtrade API guide walks through the setup.

Payout proof

Fast, real payouts. Traceable on Arbitrum.

  • Paid within 24 hours of approval
  • Settled on Arbitrum in USDC or USDT
  • Look up any transaction on Arbiscan
Velotrade payout certificate: $1,684 paid on a $100,000 account
Velotrade payout certificate: $1,452 paid on a $25,000 account

Rule based or AI: which kind of forex bot?

Most forex robots are rule based: a moving average crossover, a breakout of the Asian session range, a mean reversion entry at a Bollinger Band. The logic is transparent and testable. When it stops working, you can see why.

AI and machine learning bots learn patterns from data instead of following hand written rules. They can capture relationships that a simple rule misses, but they are harder to validate and easier to overfit. Every extra parameter is another way to fit noise. We cover AI approaches in depth in AI forex trading, so here is the short version: treat any "AI forex robot" with the same scepticism as a rule based one. Then add more for any vendor who will not explain what the model does.

Common forex robot strategies, and which are allowed on Velotrade

Strategy type How it trades Allowed on Velotrade?
Trend following Trades in the direction of a moving average or breakout signal Yes
Breakout Enters when price leaves a defined range, often around session opens Yes
Mean reversion Fades stretched moves back toward an average, with a fixed stop Yes
Grid Places orders at fixed price steps regardless of signals No, grid trading is prohibited
Martingale Doubles size after each loss to recover it on the next win No, continuously averaging down a losing position is risk abusive
Tick scalping and HFT Enters and exits within seconds, or places huge numbers of orders No, both are prohibited
Arbitrage Exploits price differences between feeds or platforms No, prohibited, including latency arbitrage

Many commercial forex robots are grid or martingale systems underneath, even when the sales page does not say so. They often show smooth equity curves for months because they keep adding to losers until price comes back. When price does not come back, one trend can wipe out the account. If a robot's trade log shows positions being added at worse prices without a stop, that is what you are looking at.

Four wall clocks labelled London, New York, Tokyo and Moscow
Forex liquidity shifts as trading moves between financial centres through the day

How do forex sessions affect a trading bot?

Forex trades 24 hours a day, five days a week, but liquidity is not constant. Activity rises as each financial centre opens and is typically strongest when the London and New York sessions overlap. A breakout bot built for the London open behaves very differently if it fires in the quiet hours after New York closes.

Three session details matter for a bot:

  • Daylight saving. Session open times shift in UTC when Europe or the US changes clocks. Hard coding a UTC time can move your entry window by an hour twice a year. Use the market sessions tool to check the current times.
  • Rollover. At Velotrade, forex trades from Sunday 21:05 UTC to Friday 20:55 UTC, with a short break of about 2 minutes around 21:00 UTC from Monday to Thursday. A bot should not try to place orders in that window.
  • Swap. Positions held through the 21:00 UTC rollover are charged 0.05% of notional per night, three times on Wednesday to cover the weekend. A bot that holds for days pays this every night.

How do you evaluate a forex robot?

A backtest is where evaluation starts, not where it ends. Bailey, Borwein, López de Prado and Zhu showed that when many strategy variations are tested on the same data, the best result is likely to be overfit. Commercial robots are often presented with exactly that kind of best case backtest.

Work through this checklist before you trust a robot:

  1. Read the logic. If you cannot explain when it enters, exits and how it sizes, do not run it. Ask specifically whether it uses grid, martingale or averaging down.
  2. Test on unseen data. Run the backtest on a period the vendor did not show, and on other pairs.
  3. Include real costs. Commission, spread, slippage and swap. A scalper that earns a fraction of a pip per trade can be wiped out by costs.
  4. Check the worst stretch. Look at maximum drawdown and the longest losing streak, not the average month.
  5. Forward test. Run it on a demo or evaluation account for weeks before risking more.
  6. Verify the track record. The CFTC notes that the Mirror Trading International scheme used MetaTrader demo accounts to show fake balances to customers. Screenshots prove nothing.

On scams, the CFTC's forex fraud advisory warns about promises that forex has no down market, pressure to send money quickly, and sellers who are hard to look up. Its separate advisory on AI trading bots lists guaranteed monthly returns as a hallmark of fraud. Never send money to a robot vendor to "manage" for you.

A hand holding a magnifying glass over a balance sheet
Read the logic and the full trade log before trusting a forex robot

Run it on funded capital

Run your bot on a funded account from $40

Bots and EAs are allowed on challenge accounts, with full REST and WebSocket API access at no extra fee, no consistency rule and a static drawdown floor your risk code can rely on.

Get funded from $40

How do you run a forex trading bot on a prop firm evaluation?

A prop firm evaluation lets a forex bot trade with a fixed downside: the challenge fee. At Velotrade, a multi-asset prop firm offering simulated evaluations, the rules a bot must respect are:

  • Bots and EAs are allowed on every account, evaluation and funded, through the DXtrade REST and WebSocket API at no extra fee, with no approval process. Details are on the API access page.
  • Prohibited strategies stay prohibited when automated. The rules list grid trading, arbitrage, tick scalping and high frequency trading as prohibited strategy types, along with latency arbitrage, exploiting stale prices and coordinated multi-account bots. Continuously adding to a losing position is listed as risk abusive behaviour, which rules out martingale EAs.
  • Source of the strategy. You may run your own strategy or a commercial EA that anyone can buy on standard terms. Private or invitation only signal services are not permitted. Copy trading is allowed only between your own accounts.
  • Static maximum drawdown: 10% on CLASSIC 2-Step, 7% on CLASSIC 1-Step, 3% on PRO 1-Step, as a fixed dollar floor from the starting balance.
  • Daily loss limit: 5%, 4% or 3% by plan, reset at 00:30 UTC from the higher of balance or equity, monitored against live equity.
  • Forex costs: 0.004% commission per side on notional, plus the 0.05% nightly swap described above. Majors have 50x leverage on challenges and 30x funded.

Worked example: an EURUSD bot on a PRO 1-Step 50K account

A breakout bot trades EURUSD on a 50,000 USD PRO 1-Step account. PRO has a 3% daily limit and a 3% static drawdown, so both equal 1,500 USD on day one, and the static floor is 48,500 USD.

  • Risk per trade: 0.25% of the starting balance, or 125 USD.
  • Stop: 20 pips. A standard lot on EURUSD is 10 USD per pip, so size = 125 / (20 x 10) = 0.625 lots, or 62,500 EUR.
  • Notional: at an assumed EURUSD price of 1.1000, about 68,750 USD, or 1.4x leverage.
  • Commission: 0.004% x 68,750 = about 2.75 USD per side, 5.50 USD per round trip.
  • Swap: 0.05% x 68,750 = about 34 USD per night, and about 103 USD on a Wednesday.

The swap is larger than the commission by a wide margin, so this bot should close intraday or budget for holding costs. With 1,500 USD of total room, twelve full losses end the account. A sensible kill switch stops new trades after three losses in a day (375 USD), and shuts the bot down if equity reaches 48,900 USD.

Run your own sizes in the position size calculator, compare plans on the challenges page, and explore related guides in the algo trading library, such as backtesting trading strategies and risk management in trading.

Velotrade provides education and simulated trading only. It is not a broker and is not regulated as a financial institution. Nothing here is investment advice, and backtested results do not predict future results.

Sources

Frequently Asked Questions

About the author

Vittorio De Angelis

Vittorio De Angelis

Executive Chairman

Former equity-derivatives trader at JP Morgan, Dresdner Kleinwort and Bank of America in London. Later Head of Brokerage at a global broker in Hong Kong.

Velotrade was founded in Hong Kong in 2016 by a team from JP Morgan, Dresdner Kleinwort and Bank of America, has paid out over $2.5 billion to its trade-finance clients, and has been featured in Bloomberg, the Financial Times, the Wall Street Journal and on Nasdaq. Its prop trading evaluations are simulated and educational.

View author page

Ready to trade with
$200,000 capital?

Up to 90% profit split

Keep most of what you earn

No consistency rule

News trading allowed

Payouts within 24 hours

Of your request