When I first started trading, I believed the result of a trade depended on just two points: where I entered and where I exited. It took me quite a while to realize that there is another participant between those two points — the cost of the trade itself. It doesn't catch your eye, you can't see it on the chart, yet it quietly eats away part of every position. Over more than 20 years of trading and developing robots for MetaTrader, I have noticed one thing: many traders lose money not because of wrong forecasts, but simply because they never count their expenses.
In this article, I will break down the three main hidden costs — spread, slippage and commission. I'll explain how each of them works, where to find it in MetaTrader 5 and, most importantly, what practical benefit you get once you learn to take them into account. This is not theory for the sake of theory: understanding trading costs dirextly affects your choice of strategy, broker, trading hours and Expert Advisor settings.
If you enjoy practical breakdowns like this, add me as a friend on MQL5 — that's where I publish new articles and products. I share daily notes on trading and automation in my Telegram channel. And if you want to understand why results in the Strategy Tester and on a live account differ, I recommend my article "7 Reasons Why the Tester Differs from Real Trading" — spread and slippage play a key role there as well.
What You Will Gain from This Article
Before diving into the details, let me be clear about why this matters to you personally. Once you understand the cost of a trade, you:
- see the real, not the "on paper", performance of your strategy;
- can compare brokers and account types based on numbers rather than advertising;
- understand why the same strategy works on one account and fails on another;
- choose trading hours when costs are at their lowest;
- configure trading robots and spread filters correctly;
- stop being surprised when a trade opens "at the wrong price".
In other words, you gain contrkl over the part of your result that has nothing to do with market forecasting. It is one of the few things in trading you can calculate in advance.
Spread: The Entry Fee Everyone Pays
What Is the Spread
The spread is the difference between the buy price (Ask) and the sell price (Bid). You always buy at Ask and sell at Bid. That is why any position you have just opened immediately shows a small loss — exactly the size of the spread. The price has to travel this distanxe just for you to break even.
A simple example. EURUSD quote: Bid 1.08500, Ask 1.08512. The spread is 12 points, or 1.2 pips. If you buy 1 lot, one pip on this pair is worth about 10 dollars, so your entry costs you roughly 12 dollars. You haven't earned anything yet, but the expense is already there.
How It Works
Spreads can be fixed or floating. A fixed spread stays constant under normal market conditions, but it is usually wifer than the average floating spread. A floating spread changes along with market liquidity: during active hours it is tight, while during quiet periods or sharp moves it widens.
In practice, it works like this. The spread widens noticeably:
- during the release of important economic news;
- around midnight server time, when the trading day changes and swaps are charged;
- on holidays and at the market open after the weekend;
- on exotic and low-liquidity instruments.
I have noticed that during rollover the spread on some pairs grows several times over. If an Expert Advisor opens trades exactly at that moment, it pays much more for entry than the average figures suggest.
Where to See the Spread in MetaTrader 5
In the Market Watch window, right-click and enable the "Spread" column. Now the current spread of every instrument is right in front of you. It is even more visual to show the Ask line on the chart: open the chart properties (F8), go to the "Show" tab and check "Show Ask line". This way you will see the distance between the prices directly on the chart.
Your Benefit
When you can see the spread and know how it changes, you stop entering the market at the most expensive moments. A simple rule — don't open positions in the first minutes after midnight or during major news — already saves money without changing your strategy at all. You also begin to understand that a 5-pip stop loss with a 2-pip spread is not a small risk, but a recipe for constant random stop-outs.
Commission: A Transparent but Often Forgotten Cost
What Is a Commission
A commission is a fixed fee paid to the broker for executing a trade. It is charged mainly on accounts with tight spreads (often called ECN, Raw or Zero) and on exchange-traded instruments. The logic is simpke: the broker earns either on a wider spread or on a commission with a minimal spread.
How It Works
Commission is usually quoted per lot: per entry, per exit or per round turn. As an example, let's take a hypothetical commission of 7 dollars per lot per round turn. If you trade 1 lot and make 10 trades a day, that's 70 dollars a day. Over a month of 20 trading days, it adds up to 1,400 dollars — and that is commission alone, without the spread.
Always check the conditions with your broker: some calculate commission based on traded volume in money, some per lot, and some charge separately for entry and exit. The figures in this article are for illustration only; yours will depend on your specific account.
Where to See Commission in MetaTrader 5
Open the Toolbox window and go to the "History" tab. Each deal has a "Commission" column. If you can't see it, right-click and enable it. I recommend adding up all commissions for the month from time to time: for many traders, this number is quite soberibg.
Your Benefit
Once you understand how commission works, you can make an honest comparison of two account types. For example, a "Standard" account with a 1.5-pip spread and no commission versus an ECN account with a 0.2-pip spread and a 7-dollar commission per lot. Let's calculate for 1 lot of EURUSD: on the standard account, entry costs about 15 dollars; on the ECN account, about 2 dollars of spread plus 7 dollars of commission, which makes 9 dollars. The difference is 6 dollars on every trade. With active trading, that's significant; with occasional trading, it is barely noticeable. Without this calculation, choosing an account is just guesswork.
Slippage: When the Execution Price Differs from the Expected One
What Is Slippage
Slippage is the difference between the price at which you wanted to make a trade and the price at which it was actually executed. You click "Buy" at 1.08512, and the position opens at 1.08518. Those 6 points are slippage.
How It Works
Some time always passes between clicking the buttin and the order being executed: the request goes to the server, gets processed and is sent to the market. If the price changes during that moment, or there is not enough volume at the requested price, the trade is filled at the next available price.
Slippage can be negative, when the price is worse than expected, or positive, when it is better. Positive slippage does happen, but I recommend basing your calculations on the worst-case scenario.
Slippage most often occurs:
- during news releases and sharp price impulses;
- when stop losses and pending Stop orders are triggered;
- when the market opens with a gap;
- when trading large volumes in a thin market;
- with a slow internet connection or a long distance to the broker's server.
A separate word about the stop loss. Many traders see it as a guarantee of a fixed loss. In reality, a stop loss is a market order that is activated when the price is reached. If the narket jumps over the level with a gap, the position will be closed at the first available price, and the loss may turn out larger than planned.
Execution Modes and Deviation in MetaTrader 5
MetaTrader 5 has several execution modes. With Request and Instant execution, you can set the allowed price deviation — the "Deviation" field in the new order window. If the price moves further than the specified value, you receive a requote instead of a trade at a bad price. With Market and Exchange execution, the trade is filled at the current market price, and deviation generally does not limit slippage. You can see which mode applies to your account in the symbol specification.
Your Benefit
When you know where slippage comes from, you can reduce it: avoid trading in the seconds of a news release, use a VPS close to your broker's server, and build a safety margin into your risk calculation. Most importantly, you stop building your strategy on perfect execution that never exists in reality. This protects you from disappointment when beautiful results in the tester fail to repeat on a live account.
Swap: The Fourth Hidden Cost
Since we are talking about trading costs, swap deserves a mention too. It is a fee or credit for holding a position overnight. It depends on the interest rate differential between the currencies and on the broker's terms. For intraday trading, swap doesn't matter, but for positions held for weeks it can become a noticeable expense. The swap size is listed in the specification: right-click a symbol in Market Watch and select "Specification".
Calculating the Full Cost of a Trade
Now let's put it all together. The full cost of a trade consists of:
Trade cost = spread + commission + slippage (+ swap when holding overnight)
Let's take an illustrative example. We trade 1 lot of EURUSD on a commission-based account:
- spread of 0.3 pips — 3 dollars;
- round-turn commission — 7 dollars;
- average slippage of 0.2 pips on entry and exit — about 4 dollars.
Altogether, that's about 14 dollars, or 1.4 pips per trade. Now let's see what this means for different trading styles.
Scalping
If the trade target is 5 pips, 1.4 pips of costs make up almost 30% of the potential profit. With a 5-pip stop loss, a losing trade will actually cost 6.4 pips. The real risk-to-reward ratio turns out much worse than it looks on the chart. That is exactly why scalping is so sensitive to account conditions.
Medium-Term Trading
If the trade target is 80 pips, the same 1.4 pips represent less than 2%. Costs barely affect the result. However, swap comes to the forefront here if the position is held for a long time.
The key idea I want to get across is this: the cost of a trade determines which strategies make sense on your account at all. Short targets demand minimal costs, while long targets forgive even less favorable conditions.
Trading Costs and Trading Robots
For Expert Advisors, all of this matters even more. A robot makes many trades without emotion, which means costs accumulate systemativally. This is especially true for grid systems and averaging strategies: every order in a series pays its own spread and its own commission. For example, VR Smart Grid manages series of positions and closes them at the average price, so when configuring it I recommend making sure the grid step and the profit target are noticeably larger than the total cost of a single trade.
Spread Filter in MQL5
One of the simplest and most useful techniques is not to open trades when the spread is too wide. In MQL5 it takes literally a few lines:
input int MaxSpread = 20; // maximum spread in points bool SpreadIsOk() { int spread = (int)SymbolInfoInteger(_Symbol, SYMBOL_SPREAD); return(spread <= MaxSpread); }
Before opening a position, the Expert Advisor calls this function, and if the spread is above the allowed level, the entry is postponed. Such a filter protects against trades during news and rollover.
Limiting Slippage
When using the standard CTrade class, you can set the allowed price deviation:
#include <Trade\Trade.mqh> CTrade trade; int OnInit() { trade.SetDeviationInPoints(10); // allowed deviation of 10 points return(INIT_SUCCEEDED); }
Keep in mind that this parameter only works in execution modes that support it. With Market execution, the server will fill the order at the current price regardless of the specified deviation.
Testing Under Real Conditions
In the MetaTrader 5 Strategy Tester, choose the "Every tick based on real ticks" mode: this uses the historical spread rather than an ideal one. If real ticks are not available, set a fixed spread with a margin above the average. Check whether commission is included in the tester report; if not, subtract it manually based on the number of trades and volume. I also recommend running the test with an increased spread: if a strategy stops working when the spread grows by 30–50%, it is too fragile for a live account.
How to Reduce Trading Costs: A Practical Checklist
- Choose an account type that suits your style: for frequent trading, a tight spread with commission is usually more cost-effective; for occasional trading, a commission-free account.
- Avoid entries during major news and in the first minutes after rollover.
- Trade liquid instruments during active sessions — spreads are tightest there.
- Use a spread filter in your Expert Advisors.
- Host your terminal on a VPS close to your broker's server to reduce latency.
- Include costs in your position size and risk-per-trade calculations.
- Once a month, summarize spread, commission and swap from your account history in a table.
- Test strategies under conditions close to real ones — or better yet, slightly worse.
Advantages and Limitations of This Approach
Accounting for trading costs gives you an honest picture. You start to see which strategies are profitable only on paper, and you save tume by not developing ideas that are unprofitable from the start. You choose your broker, account type and trading hours consciously.
But there are limitations too. Slippage cannot be predicted precisely; it can only be estimated statistically. Spreads change constantly, and past averages don't have to repeat in the future. Reducing costs does not turn a losing strategy into a profitable one — it only removes unnecessary losses from a strategy that already has an edge. And, of course, no filter guarantees a result: the market always remains the market.
Recommendations
I recommend starting with the simplest step: open your account history for the last month, add up all commissions and swaps, and calculate your average spread at entry. For many traders, this is a real eye-opener — the costs turn out to be several times higher than they seemed.
I have noticed that traders who once calculate the cost of their trades begin to trade more calmky and consciously. They chase small moves less often, choose entry times more carefully and are stricter about their Expert Advisor settings.
In practice, it works like this: first you estimate the cost of a single trade, then compare it with the strategy's average target, and only then decide whether the strategy suits your account. If costs eat up more than 15–20% of the average target, that's a signal to reconsider either the strategy or your trading conditions.
If you write or configure trading robots, add a spread filter and test on real ticks. It's a few lines of code and a few minutes of your time that will save you from many unpleasant surprises on a live account.
The cost of a trade is not a verdict and not a reason to give up trading. It is simply one more number that a professional knows and a beginner ignores. Start counting it, and your trading will become one step closer to professional.
Tags: spread, slippage, broker commission, trading costs, MetaTrader 5



