Skip to content

MetaTrader 5

The Full Cost of a Trade: Spread, Commission, Swap and Slippage

Trading costs are the gap between the price move a trading rule measures and the result the account actually receives. They are the bid-ask spread, broker commission, slippage on each fill, swap on positions held through the daily rollover, and any separate fees. Add them per round trip in one unit, then divide by the stop distance to express them in R: illustratively, 2.3 pips against a 15-pip stop is about 0.15R.

Every cost figure on this page is illustrative, not a recommendation or a measured cost. For how quotes, orders, fills, margin and costs fit together from alert to broker, start with the trading mechanics library. Automation sends the orders your rules request; it does not remove any of these costs.

Illustrative cover for the full cost of a trade: a measured price move reduced by spread, commission, slippage and swap, with the official PineConnector logo.
Every round trip pays the spread and any commission and slippage; positions held overnight add swap.

Trading costs at a glance

CFA Institute splits transaction costs into explicit costs, such as broker commissions, taxes and exchange fees, and implicit costs, such as the bid-ask spread, market impact and delay.[1] A forex or CFD trade in MetaTrader 5 (MT5) can carry five kinds of cost:

Scroll horizontally to read every column.

Cost What it is Where MT5 shows it
Spread Ask minus Bid. A buy generally fills at the Ask and is closed by selling at the Bid, so a round trip pays about one spread against the mid-price.[2] Market Watch; the symbol Specification, in points; the History tab's Cost column, where the server provides it.[3][4]
Commission A broker charge per lot or per deal, on entry, exit or both, in money, percentage or points. The Specification's Commission section; the History tab's Commission column, or a daily or monthly balance deal.
Slippage The difference between the price you expected and the price of the deal. The deal Price in the History tab, against a recorded same-side broker quote. A gap measured from the alert price can also contain spread.
Swap Applied when a position is held through the daily rollover; separate values for buys and sells, and a multiplier for each weekday. The Specification's Swap type, Swap long, Swap short and Swap rates; the Swap column in the Trade tab while the position is open.
Other fees A separate per-deal fee, and taxes or exchange fees where they apply. The History tab's Fee column.

How do you calculate the full cost of a trade?

Convert every component into one unit and add them per round trip: one entry deal and one exit deal. This page uses pips and one 1.00-lot round trip as the unit of comparison, on a USD account.

Round-trip cost (pips) = spread + (commission ÷ pip value) + entry execution slippage + exit execution slippage + (swap ÷ pip value)

Cost in R = round-trip cost ÷ initial risk R, with both in pips or both in account currency

  • Spread: against the mid-price, a buy pays about half the spread at entry and half at exit, so a constant spread costs one spread per round trip. MT5 quotes spread in points. PineConnector defines one pip as 10 quoting points, so a 10-point spread is 1.0 PineConnector pip.[2][3][5] See the bid-ask spread explained for fixed and floating spreads.
  • Commission: read whether the charge is per side or per round turn, and per lot or per deal. Convert it to pips by dividing by the pip value per 1.00 lot: pip size × contract size, converted to the account currency. For EURUSD with a 100,000-unit contract, 0.0001 × 100,000 = US$10. The pip value guide covers other symbols.
  • Execution slippage: compare the fill with a recorded same-side broker quote at the chosen reference time if spread is counted separately. A chart/alert-to-fill gap can already contain spread and feed movement. Count adverse execution slippage as a cost and favourable slippage as a reduction. See slippage in trading.
  • Swap: the base swap times the weekday multiplier, for each rollover the position is held through, converted to pips. The swap and rollover guide explains the calculation modes.
  • R: the initial risk per trade, from entry to the initial stop. When every component scales with volume, cost in R is the same at any position size, because R scales too.

A commission charged per deal, rather than per lot, does not scale with volume. Its share of R rises as the position gets smaller.[3]

Worked example: 2.3 pips, or about 0.15R

Illustrative example, not a recommendation or a measured cost. EURUSD on a five-decimal quote, a USD account and a 100,000-unit contract, so one pip is worth US$10 per 1.00 lot. One 1.00-lot entry and one full exit, with a 15-pip stop, give R = 15 × US$10 = US$150 at this volume. The figures match the cost budget in the TradingView backtesting guide.

Round-trip component Illustrative assumption Cost in pips
Spread 1.0 pip, the same at entry and exit 1.0
Commission US$7 per round-turn lot ÷ US$10 per pip 0.7
Slippage 0.3 pip on each of two fills 0.6
Intraday round trip 1.0 + 0.7 + 0.6 2.3
Swap, if held two nights 2 × US$3.50 per lot ÷ US$10 per pip 0.7
Held across two rollovers 2.3 + 0.7 3.0

In currency, 2.3 pips × US$10 = US$23 per 1.00-lot round trip. In R, 2.3 ÷ 15 = 0.1533R, about 0.15R. Held across two ordinary rollovers, the total is 3.0 ÷ 15 = 0.20R.

Swap depends on the calendar. In MetaQuotes' own example, the multiplier is 3 for Wednesday, so the rollover from Wednesday to Thursday is charged three times.[3] With one ordinary night and one tripled night, the illustrative swap becomes 0.35 + 1.05 = 1.4 pips. The total becomes 3.7 pips, or 0.2467R. Read the actual multipliers in the symbol's Specification.

Illustrative round-trip trading cost breakdown for 1.00 lot of EURUSD: 0.8 pip at entry, 0.7 pip commission and 0.8 pip at exit total 2.3 pips, or 0.1533R on a 15-pip stop; two nights of swap add 0.7 pip for 3.0 pips, or 0.20R.
Illustrative arithmetic per 1.00-lot round trip, not measured costs. Replace each assumption with your broker's terms and your own deal history.

How costs move the break-even win rate

Costs apply to winning and losing trades alike. With a planned target of T R, a stop of 1R and a cost of c R on every trade, the break-even win rate is (1 + c) ÷ (T + 1). With an illustrative 2R target:

  • Before costs: 1 ÷ 3 = 33.3%.
  • With the intraday budget, c = 0.1533: 1.1533 ÷ 3 = 38.4%.
  • Held two nights, c = 0.20: 1.20 ÷ 3 = 40.0%.

The 2R target is an illustration, not a suggested target, and real results do not all land exactly at +2R or −1R. The break-even win rate guide derives the formula. The average trade guide compares the average result per trade with the cost per trade in the same unit.

Costs repeat on every round trip. At the illustrative 2.3 pips, 100 round trips of 1.00 lot cost US$2,300, or about 15.3R at US$150 per R. The CFTC reminds retail forex customers that a dealer earns when customers trade more frequently or pay fees, spreads or commissions.[6]

Why does the same cost weigh more on a tight stop?

The stop distance is the denominator. With the same 2.3-pip round-trip cost, halving the stop doubles the cost in R. A 5-pip stop gives 2.3 ÷ 5 = 0.46R, a 15-pip stop gives 0.1533R, a 50-pip stop gives 0.046R and a 100-pip stop gives 0.023R.

Illustrative bar chart of one 2.3-pip round-trip cost expressed in R: 0.46R on a 5-pip stop, 0.153R on a 15-pip stop, 0.046R on a 50-pip stop and 0.023R on a 100-pip stop.
Illustrative arithmetic, not a recommended stop distance. The pip cost stays the same; only the denominator changes.

The same broker terms therefore take a larger share of each trade from a rule with a tight stop than from one with a wide stop, which pips or currency alone do not show.

Where do you find each cost in MT5?

MT5 separates the broker's published terms from what each deal actually paid. As of 25 September 2026, MetaQuotes documents the following places:

  • Specification: right-click the symbol in Market Watch and choose Specification. The broker sets the values shown, including spread in points (marked floating when it varies), contract size, tick size and tick value, swap type, swap long, swap short, swap rates and commission terms.[3]
  • History tab: each deal shows its Price, Commission and Fee. Where the server provides it, the Cost column shows the deal's cost relative to the mid-point price, which MetaQuotes describes as the amount lost on the traded spread.[4]
  • Commission charged later: a broker can charge commission at execution or at the end of a day or month.[3] When it accumulates, MT5 withdraws it as a single balance deal and does not show it on each deal.[4] Allocate that amount back to the trades it covers before you calculate cost per trade.
  • Trading report: when MT5 classes deals as profitable or losing for Gross Profit and Gross Loss, it uses each deal's result after commission, fees and swap.[7]
  • MQL5: an Expert Advisor reads the same terms as symbol properties, such as SYMBOL_SWAP_LONG, SYMBOL_SWAP_SHORT, SYMBOL_SWAP_MODE and SYMBOL_SWAP_ROLLOVER3DAYS, the day of the week for the 3-day swap. For a closed deal, DEAL_COMMISSION, DEAL_FEE and DEAL_SWAP, the cumulative swap on close, hold the charges.[8][9]
  • Strategy Tester: advanced settings let you set commissions when testing an MQL5 Expert Advisor. MetaQuotes says swap and commission calculations are eliminated when profit is calculated in pips, and recommends that mode only for rough estimates.[10]

How do costs show up from TradingView alert to MT5 order?

Costs enter at different stages of the path from a rule to a position, and each stage records them differently.

  1. TradingView strategy report. A Pine Script v6 strategy applies no commission unless you set one. Commission can be a percentage of transaction value, cash per contract or cash per order, and applies to entries and exits. Slippage is a fixed number of ticks, and the Help Center says it can be used to account for the spread on market and stop orders.[11][12] Neither page documents a swap or financing setting, so deduct holding costs separately. The TradingView backtesting guide converts the budget above into those inputs.
  2. Alert and PineConnector. Broker charges arise at deals and rollovers, not when an alert condition is true or the alert triggers. PineConnector's spread= parameter sets a maximum entry spread in PineConnector pips, measured as (Ask − Bid) ÷ pip size when the signal arrives; a spread equal to the limit passes.[5] Passing the filter is not a confirmed order. The docs describe an entry check, not a limit on slippage, commission, swap or the spread at exit.
  3. MT5 order, deal and position. The EA's order request, the broker's acceptance, the deal and the resulting position are separate events. The entry deal's price carries one side of the spread and any slippage. Commission and fees attach to deals, swap applies while the position stays open, and the exit deal pays the other side of the spread.[2][4]
  4. PineConnector displays. The EA dashboard's Profit Computation setting includes commission, taxes and swap by default, and can omit them.[13] PineConnector's Analytics guide says to check which costs a net profit figure includes before comparing it with another report.[14]

Demo test only. Confirm every account sharing the selected License ID is a demo account before creating the alert. These messages request broker trades or closures. Check the exact symbol and permitted volume, and add your configured secret= if required.[16]

Illustrative message, not a recommendation. Paste it into the TradingView alert's Message field, with your own License ID and your broker's exact symbol:

LicenseID,buy,EURUSD,vol_dollar=100,sl_pips=15,spread=1.5

Here vol_dollar=100 sizes the trade for a planned loss of about US$100 at the 15-pip stop, and spread=1.5 is an illustrative entry limit, not a suggested value. PineConnector's docs say costs, fills, gaps and broker limits can make the actual loss differ from the sizing input.[5] At the illustrative 0.1533R budget, the average round trip at that size would cost about US$15 beyond the price result.

How do you measure your real trading costs?

A budget is an assumption until the account history confirms it. For a sample of closed trades on the exact account and symbol:

  1. Record the Specification values with the date: spread, contract size, tick value, swap type, swap long and short, swap rates and commission terms.
  2. For each round trip, copy the entry and exit deal prices, the Cost column if shown, and the commission and fee from the History tab. Record the swap from the Trade tab before the position closes, or read the exit deal's cumulative swap.
  3. Separate the total alert-to-fill gap from execution slippage. To add execution slippage to a separate spread measurement, compare the fill with a recorded same-side broker quote at the chosen reference time. With only chart/alert and fill prices, report the combined gap; do not add the same spread again.
  4. Add any commission withdrawn as a daily or monthly balance deal, allocated to the trades it covers.
  5. Convert the consistently measured, non-overlapping costs to pips and to R, and compare it with the budget used in the backtest, session by session.

Professional transaction cost analysis uses the same reference point. CFA Institute defines the effective spread as twice the difference between the trade price and the prior midquote, and implementation shortfall as a measure of all explicit and implicit costs.[1]

“Commission-free” does not mean cost-free. In the United States, the National Futures Association requires a forex dealer that advertises commission-free services to disclose prominently how it is compensated. Its guide also lists per-trade disclosure of commission, other fees and either a mark-up or the mid-point spread cost.[15]

What do cost budgets commonly get wrong?

  • Counting the spread twice. If the TradingView slippage input already carries half the spread per fill, do not deduct the spread again. On a feed with a 0.00001 tick, 0.5 pip of spread plus 0.3 pip of slippage is 8 ticks per market fill.
  • Mixing per-side and round-turn commission. US$7 per round-turn lot is US$3.50 per side. Reading a per-side quote as a round-turn figure halves the commission in the budget.
  • Using one session's spread for every session. A floating spread changes, and MT5 marks it as floating in the Specification.[3] Observe the spread during the hours the rule actually trades.
  • Leaving out swap. A report with no swap setting shows an intraday cost for a rule that holds positions overnight. Check the symbol's triple-swap day as well.
  • Expecting every stop-loss exit to lose exactly 1R plus the budget. Where the spread and entry slippage appear depends on where the stop is measured from. A stop measured from the fill keeps the loss near the planned amount but sits closer to the market; a stop at a fixed chart price adds those costs to the loss. The cost exists either way.
  • Treating the budget as a measurement. TradingView calls slippage dynamic and unpredictable, and impossible to simulate precisely.[12] A constant input is a planning figure; the deal history is the evidence.
  • Comparing reports with different cost treatment. An MT5 report, a TradingView strategy report and a PineConnector dashboard can each include different costs; confirm which before comparing.

Frequently asked questions

What are transaction costs in trading?

Transaction costs in trading are what a trade pays beyond the price move itself. CFA Institute splits them into explicit costs, such as commissions, taxes and exchange fees, and implicit costs, such as the bid-ask spread, market impact and delay. A forex or CFD trade in MetaTrader 5 can also carry slippage on each fill and swap on positions held through the daily rollover.

What is the difference between spread, commission and swap?

The spread is the gap between the Ask and the Bid, paid through the prices a trade fills at. Commission is a separate broker charge, per lot or per deal, shown on deals or withdrawn as a balance deal. Swap applies when a position is held through the daily rollover, with separate values for buy and sell positions. The MT5 symbol Specification shows the broker's terms for all three.

How do you calculate the cost per trade in forex?

Add non-overlapping round-trip costs in one unit. If spread is counted separately, measure execution slippage against a recorded same-side broker quote; a chart-to-fill gap may already contain spread. Illustratively, a 1.0-pip spread, US$7 round-turn commission at US$10 per pip, and 0.3 pip execution slippage per fill total 2.3 pips, or US$23 per lot.

Does a TradingView backtest include spread and swap?

A TradingView strategy includes only the costs you enter. As of 25 September 2026, its documented properties include commission and slippage in ticks, and TradingView says slippage can be used to account for the spread on market and stop orders. Neither the Strategy properties page nor the Pine Script Strategies page documents a swap or financing setting, so holding costs need a separate deduction.

How do trading costs change the break-even win rate?

With a planned target of T R, a 1R stop and a cost of c R on every trade, the break-even win rate is (1 + c) ÷ (T + 1). Illustratively, a 2R target needs 33.3% before costs and 38.4% with costs of 0.1533R per trade. The planned levels are an illustration only, and real trade results vary around them.

Reviewed 25 September 2026. Facts were checked against the linked sources on that date. Nothing in this article was tested on a trading account and no code was compiled.

Sources

  1. CFA Institute – Trading Costs and Electronic Markets, accessed 25 September 2026.
  2. MetaQuotes – Basic Principles (MetaTrader 5 Help), accessed 25 September 2026.
  3. MetaQuotes – Market Watch: viewing symbol specification (MetaTrader 5 Help), accessed 25 September 2026.
  4. MetaQuotes – Executing Trades: trading account history (MetaTrader 5 Help), accessed 25 September 2026.
  5. PineConnector Docs – PineConnector Syntax: spread=, PineConnector pip and vol_dollar=, accessed 25 September 2026.
  6. CFTC – Customer Advisory: Eight Things You Should Know Before Trading Forex, accessed 25 September 2026.
  7. MetaQuotes – Trading Report (MetaTrader 5 Help), accessed 25 September 2026.
  8. MetaQuotes – MQL5 Reference: Symbol Properties, accessed 25 September 2026.
  9. MetaQuotes – MQL5 Reference: Deal Properties, accessed 25 September 2026.
  10. MetaQuotes – Strategy Testing (MetaTrader 5 Help), accessed 25 September 2026.
  11. TradingView – Strategy properties, accessed 25 September 2026.
  12. TradingView – Pine Script Strategies: simulating trading costs, accessed 25 September 2026.
  13. PineConnector Docs – EA settings reference: Dashboard, accessed 25 September 2026.
  14. PineConnector Docs – Trading analytics: read the performance metrics, accessed 25 September 2026.
  15. National Futures Association – Forex Transactions: Regulatory Guide, accessed 25 September 2026.
  16. PineConnector – Test your setup: demo account and License ID scope, accessed 25 September 2026.

PineConnector executes the instructions you send it. It does not select trades, manage money, or hold funds. Trading carries risk, and past performance of any strategy does not indicate future results.

Back to PiCo Blog

Run your strategies on our managed infrastructure

Bridge routes TradingView alerts to MetaTrader. Edge hosts and runs MT5 for you.

Core Trial

Then $59/month unless you cancel.

$7for 7 days

  • 3 account connections
  • 1 hosted MT5
  • Unlimited alerts, routed by Bridge
Try Core for $7

Trusted by 66,000+ traders in 156 countries and territories · <1s typical latency

Your Edge MT5 runs in our cloud · nothing to install · built on Microsoft Azure