Request A Free Quote

Scalping EA: Why Costs, Spread and Testing Decide the Result

Scalping EA on a EUR/USD one-minute candle chart: a buy at the ask with a 5-pip target and a 5-pip stop, and a bar showing that 1.2 pips of spread, commission and slippage take 24% of the target

A scalping EA trades small moves many times. It holds positions for seconds or minutes, aims for a few pips and risks about as many. On a chart that looks like a strategy built on precise entries. In practice it’s a strategy built on costs, because every trade pays the same spread, commission and slippage however small its target is.

That’s why so many scalpers that look excellent in a backtest fail in the first week of live trading. The entry logic didn’t change. The costs did, or the backtest never modelled them properly in the first place.

Below are the main kinds of scalping EA, the arithmetic that decides whether a small target can pay at all, how spread and execution behave in real markets, and how to test a scalper so the live results resemble the report. At the end is a list of what to put in a specification if you want one built.

Four kinds of scalping EA

“Scalping EA” describes a holding time, not a method. Most scalpers fall into one of four groups, and each fails in its own way.

Range mean reversion.Sells near the top of a short-term range and buys near the bottom, using Bollinger Bands, an envelope or a recent high and low. Works while the market rotates. Loses when a range turns into a trend, because every signal then points against it.
Session breakout.Trades the first push out of a quiet period, typically at the London or New York open. Works when volume arrives with the open. Loses on false breakouts, and pays the widest spreads of the day if it enters too early.
Fast tick-based scalping.Reacts to price changes within seconds. Very sensitive to execution quality. Systems that profit from a broker’s stale quotes rather than from the market, often called latency arbitrage, are prohibited by most brokers.
Grid “scalpers”.Open several small positions at fixed intervals and close them together for a few pips. The individual targets are small, but the open risk grows with every level. Many add a lot multiplier, which turns them into a martingale.

The cost arithmetic

Every trade pays a round-trip cost: the spread, the broker’s commission and any slippage. On a raw-spread EUR/USD account an example might be 0.2 pips of spread, $7 commission per lot round trip (0.7 pips) and 0.3 pips of slippage. That’s 1.2 pips per trade, and it doesn’t depend on how far the trade was meant to go.

With a stop equal to the target, the win rate a strategy needs just to break even is (stop + costs) ÷ (target + stop). Without costs that’s 50%. With 1.2 pips of costs, a 40-pip trade needs 51.5% and a 5-pip trade needs 62%.

Break-even win rate by target size with the stop equal to the target and 1.2 pips of costs: 70% at 3 pips, 62% at 5 pips, 56% at 10 pips, 53% at 20 pips and 51.5% at 40 pips, against 50% with no costs
Target and stop Costs as a share of the target Break-even win rate
3 pips 40% 70.0%
5 pips 24% 62.0%
10 pips 12% 56.0%
20 pips 6% 53.0%
40 pips 3% 51.5%

For a scalper, cutting costs is worth more than refining the entry. Lowering the round trip from 1.2 to 0.8 pips takes a 5-pip strategy’s break-even win rate from 62% to 58%. Few entry filters improve a win rate by four points, and none of them do it on every trade.

The spread isn’t a constant

The 0.2 pips in that example is a good-hours figure. Spreads change through the day: tight while London and New York overlap, wider in the Asian session, and much wider for a few minutes around the daily rollover and around major data releases. A scalper that trades through those minutes pays several times its usual cost on exactly the trades it can least afford.

Illustrative EUR/USD average spread by 15-minute slot in New York time: around 0.2 pips in the London and New York sessions, around 0.45 in Asia, a spike to 1.6 at an 8:30 data release and to 2.6 at the daily rollover

A scalping EA should know this rather than hope for the best. In practice that means three filters:

Maximum spreadNo new entry while the current spread is above a set value. The value should come from your own target and costs, not from a default.
Trading hoursEntries only inside the hours the strategy was built for, with a pause around the daily rollover. Server time differs between brokers, so the EA should define hours in a fixed time zone.
News pauseNo entries for a few minutes before and after scheduled high-impact releases, and a rule for what happens to positions already open.

Small stops run into one more broker setting. Many servers set a minimum distance between the current price and a stop loss or take profit, the stop level, and some also set a freeze level inside which an order can’t be modified or closed (MQL4 Reference). A 3-pip stop on a symbol with a 5-pip stop level will simply be rejected. The EA has to read these values for each symbol and adjust or refuse the trade, rather than fail with an error in the journal.

Between the signal and the fill

On a market-execution account an order fills at whatever price is available when it reaches the server. In a fast move that can be a pip or two away from the price the EA saw. On an instant-execution account the server may instead reject the order with a requote. A scalping EA needs a rule for both: how much slippage it accepts, whether it retries, and what it does when a fill comes back worse than its maximum.

Limit orders are the other option for entries. A limit can’t fill at a worse price than you set, but it may not fill at all, and the trades it misses are often the ones that moved fastest in your favour. Some scalpers use limits for entries and market orders for exits, so that a stop is never left waiting for a price that has already passed.

Latency matters less than most scalping marketing suggests. For a target of several pips, a few hundred milliseconds between the signal and the order rarely decides the result, while a spread spike or a requote often does. A VPS near the broker’s server is still worth having, mainly for stability: a scalper that loses its connection with positions open has no stop management at all. We looked at where speed actually matters in When Does ~0.5s Execution Matter in Automated Trading?

One signal, two markets

Here is the classic range scalp. The EA buys when a candle dips below the lower Bollinger Band and closes back inside it, targets the middle band, and places the stop just below the signal candle’s low. The chart shows the same rule twice in one session.

EUR/USD five-minute candles with Bollinger Bands of 14 periods and 2 deviations: in a range, a close back inside the lower band reaches the middle band for plus 3.9 pips; later, in a downtrend, the same signal is stopped out for minus 2.8 pips as price walks down the band

In the range, price returns to the middle band within two bars: +3.9 pips. Later the market starts to trend, and the same signal fires as price falls along the lower band. The stop is hit on the next bar: −2.8 pips. After 1.2 pips of costs, those two trades become +2.7 and −4.0, so a strategy like this needs to win about 60% of the time just to break even.

Nothing in the entry rule tells the two situations apart. That job belongs to filters: a trend measure on a higher timeframe, a minimum band width, or hours that avoid the moments when trends tend to start. Each filter removes losing trades and some winning ones too, which is why it has to be tested with costs included, not judged by eye.

Testing a scalper honestly

For most strategies the test model is a detail. For a scalper it’s the whole result. In the MetaTrader 5 Strategy Tester, real-tick mode uses the broker’s recorded ticks, so the spread can change within a minute bar. In generated-tick modes the tester builds ticks from minute bars and uses the spread fixed for each bar (MetaTrader 5 Help). A scalper tested on generated ticks never meets the spread spikes it will meet live. MetaTrader 4’s tester is further from reality still, because it runs the whole test with a single spread value.

Model the costs.Test on real ticks where the broker provides them, with the account’s real commission. Add a slippage allowance and see how much of the result survives it.
Look at the distribution.Check average win and loss in pips, not only the net profit. A scalper whose average win is smaller than its round-trip cost is living on its win rate alone.
Forward test at your broker.Run it on a demo account with the broker you plan to use for a few weeks before real money. Spreads, stop levels and execution differ between brokers more than strategies do.
Log every fill.Record the spread at entry and the slippage on every trade. Comparing those logs with the tester’s assumptions tells you quickly whether a live shortfall is the strategy or the execution.

Broker and prop firm rules

Most brokers accept scalping, but terms differ. Some restrict very short holding times or strategies that trade on stale prices, and some cap the number of orders per second or per day. Read the account terms before an EA trades on them, and check the symbol specification for stop level, freeze level and trading hours.

Prop firms add their own rules. Some forbid high-frequency or tick scalping, some require a minimum time in a trade, and many limit trading around news. The rules differ by firm and change often. We look at how firms treat automation in Automated Trading on Prop Firm Accounts.

What to put in a scalping EA specification

Whether you’re ordering an EA or reviewing one you’ve bought, these are the questions it has to answer.

Item What to decide
Entry logic The exact signal, timeframe and symbols, and whether it confirms on a closed bar or on a tick.
Target and stop In pips, in ATR or by structure, and how they adapt to the symbol’s stop level.
Cost limits Maximum spread for a new entry and maximum accepted slippage, set from the target rather than by default.
Trading hours Allowed hours in a fixed time zone, the rollover pause and the news pause.
Order types Market or limit entries, how requotes and partial fills are handled, how many retries.
Position limits Maximum open positions, maximum trades per day, daily loss limit.
Filters Trend, volatility or band-width conditions that keep the entry rule out of the market it can’t handle.
Restart behaviour How the EA finds its open positions after a restart or disconnection and restores their stops.
Logging Spread at entry, slippage and reason for every trade, so live results can be compared with the backtest.

Building one with us

We write scalping EAs for MetaTrader 4 and MetaTrader 5 to the client’s own rules, from single-indicator range scalpers to multi-symbol systems with layered filters. You talk directly with the developer who writes your code. Before any code is written we go through the entry, cost and filter rules with you, and that first consultation is free.

We test the EA with you on real ticks with your account’s commission, then on a demo account at the broker you plan to use. You receive the full source code, and bugs found after delivery are fixed at no extra cost. Since 2018 our team has completed over 3,000 development projects for traders in more than 120 countries.

Discuss your scalping EA →

Prefer to start from your platform? → MetaTrader 4 developers · MetaTrader 5 developers

FAQ

What timeframe does a scalping EA use?

Usually one to fifteen minutes, sometimes ticks. The timeframe matters less than the target size: the smaller the target, the larger the share of it that costs take, whatever the chart.

How much spread is too much for a scalper?

Compare the full round-trip cost with the target. Once costs pass about a fifth of the target, the break-even win rate climbs above 60%. Set the EA’s maximum spread from that calculation, not from a generic default.

Why does my scalper work in the backtest but not live?

The most common reasons are a test model with a fixed spread, missing commission, no slippage, and trades at rollover or news that the test priced at normal spreads. Test on real ticks with full costs, then compare live fills with the tester trade by trade.

Does a scalping EA need a VPS?

It needs a stable connection more than raw speed. A VPS near the broker’s server gives both, and it keeps stops managed when your own computer is off or offline.

Can I run a scalping EA on a prop firm account?

It depends on the firm. Some forbid high-frequency or tick scalping or require a minimum time in a trade. Read the current rules before you connect the EA.

Sources referenced in this article:

  1. MetaTrader 5 Help, Real and Generated Ticks: metatrader5.com
  2. MQL4 Reference, Symbol Properties (stop level, freeze level): docs.mql4.com

Nordman Algorithms provides software infrastructure for trade automation and does not offer financial advice, trading signals, or managed trading services. This article is for informational and educational purposes only. Prices, spreads, costs and results in the examples are illustrations, not recorded trades or a specific broker’s figures. An EA executes the rules it is given and does not adapt to market conditions outside them. Broker and prop firm rules differ and change over time. Trading leveraged instruments such as Forex, CFDs and futures carries a high level of risk and may not be suitable for all investors. Only risk capital should be used. Full Risk Disclosure