Independent market intelligence
Research over noise · Risk before return
Forex research guide

Fixed vs variable spread in a EUR/USD backtest

A backtest can assume the same spread at every entry and exit, or price each order from the Bid and Ask available at that moment. We replay the same scheduled EUR/USD positions both ways. The charts show how the spread varies around the chosen trade times and which quotes enter the calculation.

In simple terms

Keep the entry and exit timestamps identical when you compare spread models. Use Ask to buy and Bid to sell. Measure the spread at both endpoints and check how much the result changes across plausible assumptions.

On this page
01

Start with a two-sided quote

Bid is the quoted price for selling and Ask is the quoted price for buying. The spread is Ask minus Bid at the same quote. For EUR/USD, 1 pip equals 0.0001 USD per EUR. A fifth decimal place represents a tenth of a pip.

02

Set up a paired test

We use the HistData.com EUR/USD tick archive from 8 to 11 July 2024. We schedule two positions per day, at 14:00–14:05 UTC and 20:58–21:03 UTC. Both are long on 8 and 10 July and short on 9 and 11 July. The direction and times are set in advance for the comparison.

03

Separate the decision time from the quote time

Normalize the archive's time convention, UTC−5, to UTC. Use the first valid quote at or after each scheduled time, with a maximum wait of 60 seconds. Preserve the archive order if multiple quotes share a timestamp. If either endpoint is unavailable within the limit, drop that position from both calculations. Store the actual quote time and the wait.

04

Price the same position twice

For a long, enter at Ask and exit at Bid. For a short, enter at Bid and exit at Ask. For the fixed case, keep each observed midpoint and place the Bid and Ask 0.5 pip on either side. The resulting spread is 1 pip at each endpoint.

05

Read the midpoint charts

A midpoint is the average of Bid and Ask. Each M1 candle is built from the midpoints of the archived quotes within that UTC minute. A midpoint shows price movement on a common reference. The modeled buy and sell prices are selected separately. Empty minutes remain empty.

EUR/USD midpoint candles at both times

EUR/USD · 2024-07-08 UTC · HistData.com

1 Entry2 Exit

14:00–14:05 UTC

14:00–14:05 UTC · EUR/USD midpoint candles at both timesUSD / EUR · M11.08381.08401.08421.08441.08462024-07-08 13:55 UTC · Open 1.084100 · High 1.084250 · Low 1.084095 · Close 1.084200 · Quotes 79 · Status Archived quotes2024-07-08 13:56 UTC · Open 1.084185 · High 1.084215 · Low 1.084135 · Close 1.084165 · Quotes 66 · Status Archived quotes2024-07-08 13:57 UTC · Open 1.084160 · High 1.084320 · Low 1.084105 · Close 1.084320 · Quotes 112 · Status Archived quotes2024-07-08 13:58 UTC · Open 1.084315 · High 1.084455 · Low 1.084310 · Close 1.084445 · Quotes 87 · Status Archived quotes2024-07-08 13:59 UTC · Open 1.084450 · High 1.084455 · Low 1.084350 · Close 1.084380 · Quotes 141 · Status Archived quotes2024-07-08 14:00 UTC · Open 1.084385 · High 1.084440 · Low 1.084220 · Close 1.084225 · Quotes 84 · Status Archived quotes2024-07-08 14:01 UTC · Open 1.084225 · High 1.084355 · Low 1.084225 · Close 1.084300 · Quotes 51 · Status Archived quotes2024-07-08 14:02 UTC · Open 1.084305 · High 1.084385 · Low 1.084265 · Close 1.084385 · Quotes 42 · Status Archived quotes2024-07-08 14:03 UTC · Open 1.084390 · High 1.084465 · Low 1.084385 · Close 1.084445 · Quotes 59 · Status Archived quotes2024-07-08 14:04 UTC · Open 1.084440 · High 1.084455 · Low 1.084355 · Close 1.084355 · Quotes 47 · Status Archived quotes2024-07-08 14:05 UTC · Open 1.084340 · High 1.084340 · Low 1.084285 · Close 1.084300 · Quotes 72 · Status Archived quotes2024-07-08 14:06 UTC · Open 1.084305 · High 1.084315 · Low 1.084110 · Close 1.084120 · Quotes 102 · Status Archived quotes2024-07-08 14:07 UTC · Open 1.084140 · High 1.084235 · Low 1.084130 · Close 1.084190 · Quotes 70 · Status Archived quotes2024-07-08 14:08 UTC · Open 1.084195 · High 1.084205 · Low 1.083875 · Close 1.083895 · Quotes 93 · Status Archived quotes2024-07-08 14:09 UTC · Open 1.083905 · High 1.084185 · Low 1.083895 · Close 1.084130 · Quotes 81 · Status Archived quotes2024-07-08 14:10 UTC · Open 1.084135 · High 1.084215 · Low 1.084030 · Close 1.084080 · Quotes 76 · Status Archived quotes1213:5514:0314:10
Open
1.084340
High
1.084340
Low
1.084285
Close
1.084300
Quotes
72
Status
Archived quotes

20:58–21:03 UTC

20:58–21:03 UTC · EUR/USD midpoint candles at both timesUSD / EUR · M11.08231.08241.08251.08262024-07-08 20:53 UTC · Open 1.082515 · High 1.082515 · Low 1.082495 · Close 1.082510 · Quotes 35 · Status Archived quotes2024-07-08 20:54 UTC · Open 1.082505 · High 1.082550 · Low 1.082500 · Close 1.082530 · Quotes 65 · Status Archived quotes2024-07-08 20:55 UTC · Open 1.082520 · High 1.082550 · Low 1.082480 · Close 1.082490 · Quotes 64 · Status Archived quotes2024-07-08 20:56 UTC · Open 1.082495 · High 1.082500 · Low 1.082465 · Close 1.082475 · Quotes 25 · Status Archived quotes2024-07-08 20:57 UTC · Open 1.082480 · High 1.082515 · Low 1.082455 · Close 1.082505 · Quotes 28 · Status Archived quotes2024-07-08 20:58 UTC · Open 1.082510 · High 1.082525 · Low 1.082490 · Close 1.082490 · Quotes 25 · Status Archived quotes2024-07-08 20:59 UTC · Open 1.082495 · High 1.082510 · Low 1.082470 · Close 1.082510 · Quotes 28 · Status Archived quotes2024-07-08 21:00 UTC · Open 1.082505 · High 1.082515 · Low 1.082385 · Close 1.082390 · Quotes 38 · Status Archived quotes2024-07-08 21:01 UTC · Open 1.082400 · High 1.082460 · Low 1.082395 · Close 1.082445 · Quotes 31 · Status Archived quotes2024-07-08 21:02 UTC · Open 1.082450 · High 1.082465 · Low 1.082450 · Close 1.082465 · Quotes 11 · Status Archived quotes2024-07-08 21:03 UTC · Open 1.082460 · High 1.082460 · Low 1.082445 · Close 1.082450 · Quotes 7 · Status Archived quotes2024-07-08 21:04 UTC · Open 1.082455 · High 1.082465 · Low 1.082445 · Close 1.082460 · Quotes 13 · Status Archived quotes2024-07-08 21:05 UTC · Open 1.082445 · High 1.082465 · Low 1.082445 · Close 1.082465 · Quotes 5 · Status Archived quotes2024-07-08 21:06 UTC · Open 1.082470 · High 1.082500 · Low 1.082470 · Close 1.082500 · Quotes 6 · Status Archived quotes2024-07-08 21:07 UTC · Open 1.082495 · High 1.082500 · Low 1.082495 · Close 1.082500 · Quotes 2 · Status Archived quotes2024-07-08 21:08 UTC · Open 1.082490 · High 1.082490 · Low 1.082445 · Close 1.082455 · Quotes 29 · Status Archived quotes1220:5321:0121:08
Open
1.082460
High
1.082460
Low
1.082445
Close
1.082450
Quotes
7
Status
Archived quotes
Each candle uses the midpoints of the quotes in one UTC minute. Entry and exit refer to the selected quote times.
06

Measure the spread within each minute

Compute Ask minus Bid for every quote before grouping those values into M1 candles. The spread charts share a vertical scale and show the fixed 1-pip reference as a dashed line. The largest spread in a candle describes one observed quote. The spread cost of a position comes from the quotes used for its entry and exit.

Observed spread compared with a fixed 1 pip

EUR/USD · 2024-07-08 UTC · HistData.com

1 Entry2 Exit
Fixed 1 pip

14:00–14:05 UTC

14:00–14:05 UTC · Observed spread compared with a fixed 1 pipPips · M10.00.51.02024-07-08 13:55 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 79 · Status Archived quotes2024-07-08 13:56 UTC · Open 0.30 · High 0.30 · Low 0.10 · Close 0.10 · Quotes 66 · Status Archived quotes2024-07-08 13:57 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 112 · Status Archived quotes2024-07-08 13:58 UTC · Open 0.30 · High 0.30 · Low 0.10 · Close 0.30 · Quotes 87 · Status Archived quotes2024-07-08 13:59 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 141 · Status Archived quotes2024-07-08 14:00 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.10 · Quotes 84 · Status Archived quotes2024-07-08 14:01 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 51 · Status Archived quotes2024-07-08 14:02 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.30 · Quotes 42 · Status Archived quotes2024-07-08 14:03 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.10 · Quotes 59 · Status Archived quotes2024-07-08 14:04 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.10 · Quotes 47 · Status Archived quotes2024-07-08 14:05 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 72 · Status Archived quotes2024-07-08 14:06 UTC · Open 0.10 · High 0.40 · Low 0.10 · Close 0.20 · Quotes 102 · Status Archived quotes2024-07-08 14:07 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 70 · Status Archived quotes2024-07-08 14:08 UTC · Open 0.30 · High 0.30 · Low 0.10 · Close 0.10 · Quotes 93 · Status Archived quotes2024-07-08 14:09 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 81 · Status Archived quotes2024-07-08 14:10 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 76 · Status Archived quotes1213:5514:0314:10
Open
0.20
High
0.30
Low
0.10
Close
0.20
Quotes
72
Status
Archived quotes

20:58–21:03 UTC

20:58–21:03 UTC · Observed spread compared with a fixed 1 pipPips · M10.00.51.02024-07-08 20:53 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 35 · Status Archived quotes2024-07-08 20:54 UTC · Open 0.30 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 65 · Status Archived quotes2024-07-08 20:55 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 64 · Status Archived quotes2024-07-08 20:56 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.10 · Quotes 25 · Status Archived quotes2024-07-08 20:57 UTC · Open 0.20 · High 0.20 · Low 0.10 · Close 0.10 · Quotes 28 · Status Archived quotes2024-07-08 20:58 UTC · Open 0.20 · High 0.20 · Low 0.10 · Close 0.20 · Quotes 25 · Status Archived quotes2024-07-08 20:59 UTC · Open 0.10 · High 0.20 · Low 0.10 · Close 0.20 · Quotes 28 · Status Archived quotes2024-07-08 21:00 UTC · Open 0.10 · High 0.20 · Low 0.10 · Close 0.20 · Quotes 38 · Status Archived quotes2024-07-08 21:01 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.30 · Quotes 31 · Status Archived quotes2024-07-08 21:02 UTC · Open 0.20 · High 0.30 · Low 0.10 · Close 0.30 · Quotes 11 · Status Archived quotes2024-07-08 21:03 UTC · Open 0.20 · High 0.20 · Low 0.10 · Close 0.20 · Quotes 7 · Status Archived quotes2024-07-08 21:04 UTC · Open 0.10 · High 0.30 · Low 0.10 · Close 0.20 · Quotes 13 · Status Archived quotes2024-07-08 21:05 UTC · Open 0.30 · High 0.30 · Low 0.20 · Close 0.30 · Quotes 5 · Status Archived quotes2024-07-08 21:06 UTC · Open 0.20 · High 0.20 · Low 0.10 · Close 0.20 · Quotes 6 · Status Archived quotes2024-07-08 21:07 UTC · Open 0.30 · High 0.30 · Low 0.20 · Close 0.20 · Quotes 2 · Status Archived quotes2024-07-08 21:08 UTC · Open 0.20 · High 0.40 · Low 0.10 · Close 0.30 · Quotes 29 · Status Archived quotes1220:5321:0121:08
Open
0.20
High
0.20
Low
0.10
Close
0.20
Quotes
7
Status
Archived quotes
Both charts use the same pip scale. The dashed line marks the fixed comparator. A gap in the candles means there was no quote in that minute.
07

Inspect the quotes used at exit

The quote charts show the surrounding Bid and Ask observations in archive order. The highlighted dots identify the recorded exit Bid and Ask. The fixed model derives its exit prices from their midpoint using its fixed spread. Tick spacing in these charts follows sequence order. Read the timestamp to measure elapsed time.

Bid and Ask around the selected exit

EUR/USD · 2024-07-08 UTC · HistData.com

BidAsk

14:00–14:05 UTC

14:00–14:05 UTC · Bid and Ask around the selected exitUSD / EUR1.084251.084301.084351.084402024-07-08 14:04:56.747 UTC · Bid 1.084370 · Ask 1.084390 · Midpoint 1.0843802024-07-08 14:04:57.102 UTC · Bid 1.084360 · Ask 1.084380 · Midpoint 1.0843702024-07-08 14:04:57.205 UTC · Bid 1.084360 · Ask 1.084370 · Midpoint 1.0843652024-07-08 14:04:58.529 UTC · Bid 1.084350 · Ask 1.084370 · Midpoint 1.0843602024-07-08 14:04:58.683 UTC · Bid 1.084350 · Ask 1.084360 · Midpoint 1.0843552024-07-08 14:04:59.296 UTC · Bid 1.084350 · Ask 1.084370 · Midpoint 1.0843602024-07-08 14:04:59.807 UTC · Bid 1.084350 · Ask 1.084360 · Midpoint 1.0843552024-07-08 14:05:01.181 UTC · Bid 1.084330 · Ask 1.084350 · Midpoint 1.0843402024-07-08 14:05:01.233 UTC · Bid 1.084320 · Ask 1.084330 · Midpoint 1.0843252024-07-08 14:05:01.286 UTC · Bid 1.084310 · Ask 1.084320 · Midpoint 1.0843152024-07-08 14:05:03.119 UTC · Bid 1.084300 · Ask 1.084320 · Midpoint 1.0843102024-07-08 14:05:03.222 UTC · Bid 1.084300 · Ask 1.084310 · Midpoint 1.0843052024-07-08 14:05:03.325 UTC · Bid 1.084300 · Ask 1.084320 · Midpoint 1.0843102024-07-08 14:05:07.775 UTC · Bid 1.084300 · Ask 1.084310 · Midpoint 1.0843052024-07-08 14:05:08.285 UTC · Bid 1.084290 · Ask 1.084310 · Midpoint 1.084300−70+7
Bid
1.084330
Ask
1.084350
Midpoint
1.084340

20:58–21:03 UTC

20:58–21:03 UTC · Bid and Ask around the selected exitUSD / EUR1.082441.082461.082482024-07-08 21:02:20.169 UTC · Bid 1.082450 · Ask 1.082470 · Midpoint 1.0824602024-07-08 21:02:30.078 UTC · Bid 1.082450 · Ask 1.082480 · Midpoint 1.0824652024-07-08 21:02:30.180 UTC · Bid 1.082450 · Ask 1.082470 · Midpoint 1.0824602024-07-08 21:02:40.547 UTC · Bid 1.082450 · Ask 1.082470 · Midpoint 1.0824602024-07-08 21:02:52.376 UTC · Bid 1.082450 · Ask 1.082480 · Midpoint 1.0824652024-07-08 21:02:52.630 UTC · Bid 1.082450 · Ask 1.082470 · Midpoint 1.0824602024-07-08 21:02:57.877 UTC · Bid 1.082450 · Ask 1.082480 · Midpoint 1.0824652024-07-08 21:03:19.308 UTC · Bid 1.082450 · Ask 1.082470 · Midpoint 1.0824602024-07-08 21:03:47.564 UTC · Bid 1.082450 · Ask 1.082460 · Midpoint 1.0824552024-07-08 21:03:50.341 UTC · Bid 1.082440 · Ask 1.082460 · Midpoint 1.0824502024-07-08 21:03:54.033 UTC · Bid 1.082440 · Ask 1.082450 · Midpoint 1.0824452024-07-08 21:03:57.010 UTC · Bid 1.082440 · Ask 1.082460 · Midpoint 1.0824502024-07-08 21:03:57.113 UTC · Bid 1.082440 · Ask 1.082450 · Midpoint 1.0824452024-07-08 21:03:57.317 UTC · Bid 1.082440 · Ask 1.082460 · Midpoint 1.0824502024-07-08 21:04:01.782 UTC · Bid 1.082450 · Ask 1.082460 · Midpoint 1.082455−70+7
Bid
1.082450
Ask
1.082470
Midpoint
1.082460
The horizontal positions follow quote order. The highlighted Bid and Ask belong to the same timestamp.
08

Split price movement from spread cost

Measure the midpoint change in pips in the position's direction. Subtract half of the entry spread and half of the exit spread. The quoted result is the same as calculating directly from the appropriate Bid and Ask. With a 1-pip spread at each end the total spread cost is 1 pip.

m = (Bid + Ask) ÷ 2
s = (Ask − Bid) ÷ 0.0001
P = q × (m₂ − m₁) ÷ 0.0001 − (s₁ + s₂) ÷ 2

q = +1 Long · q = −1 Short

09

Walk through two positions

The examples use both scheduled positions from the first date, 8 July 2024. Each card gives the entry and exit quote times, the two observed spreads and the modeled results. A wider observed spread at either endpoint increases its half-spread charge.

Two matched positions on the first date

EUR/USD · 2024-07-08 UTC · HistData.com

14:00–14:05 UTC · Long

Entry
Scheduled time (UTC)
14:00:00
Quote time (UTC)
14:00:00.091
Wait (ms)
91
Entry spread (pips)
0.10
Exit
Scheduled time (UTC)
14:05:00
Quote time (UTC)
14:05:01.181
Wait (ms)
1,181
Exit spread (pips)
0.20
Midpoint move (pips)
−0.45
Observed spread cost (pips)
0.15
Fixed-spread result (pips)
−1.45
Observed-spread result (pips)
−0.60
Observed minus fixed (pips)
+0.85

20:58–21:03 UTC · Long

Entry
Scheduled time (UTC)
20:58:00
Quote time (UTC)
20:58:00.982
Wait (ms)
982
Entry spread (pips)
0.20
Exit
Scheduled time (UTC)
21:03:00
Quote time (UTC)
21:03:19.308
Wait (ms)
19,308
Exit spread (pips)
0.20
Midpoint move (pips)
−0.50
Observed spread cost (pips)
0.20
Fixed-spread result (pips)
−1.50
Observed-spread result (pips)
−0.70
Observed minus fixed (pips)
+0.80
Both models use the same quote timestamps and direction. The observed model takes spread costs from the archived Bid and Ask. The fixed model uses a 1-pip spread.
10

Compare the full sample

We priced 8 of 8 scheduled positions in both models. The fixed-spread total was −14.55 pips and the total using observed Bid and Ask was −7.90 pips. Observed minus fixed was +6.65 pips. The results isolate quoted spread and midpoint movement. Commissions, slippage and overnight adjustments are outside this calculation.

Paired results by time window

14:00–14:05 UTC

Matched positions
4
Fixed-spread result (pips)
−9.90
Observed-spread result (pips)
−6.50
Observed minus fixed (pips)
+3.40

20:58–21:03 UTC

Matched positions
4
Fixed-spread result (pips)
−4.65
Observed-spread result (pips)
−1.40
Observed minus fixed (pips)
+3.25

All matched positions

Matched positions
8
Fixed-spread result (pips)
−14.55
Observed-spread result (pips)
−7.90
Observed minus fixed (pips)
+6.65
The figures show summed pips across equal-size modeled positions. The observed model uses the recorded Bid and Ask at both endpoints.
11

Test other fixed assumptions

The sensitivity cards repeat the same positions at 0.5, 1.0, 1.5 and 2.0 pips of fixed spread. A change of 0.5 pip changes each priced position's result by 0.5 pip. The observed-spread case uses the recorded endpoint spreads and stays tied to their quote times.

Sensitivity to a fixed spread

Fixed spread (pips) · 0.5

Fixed-spread result (pips)
−10.55

Fixed spread (pips) · 1.0

Fixed-spread result (pips)
−14.55

Fixed spread (pips) · 1.5

Fixed-spread result (pips)
−18.55

Fixed spread (pips) · 2.0

Fixed-spread result (pips)
−22.55
Only the fixed spread changes across these scenarios. The positions and midpoint moves stay the same.
12

Interpret the rollover window

Dukascopy documents daily settlement at 21:00 or 22:00 GMT depending on the season. The July window from 20:58 to 21:03 UTC spans Dukascopy’s summer reference time. Its quotes come from the HistData.com archive. Review the actual quote timestamps and spreads within it. A broker's trading hours and swap terms can differ from this feed.

13

Check your tester settings

Record which feed and tick mode your platform uses. MetaTrader 5 documents how its tester obtains spread from historical data. If a backtest starts from one-sided bars, specify how you modeled the other side. Write down the assumptions for market orders, stops and gaps.

14

Keep other execution costs separate

A quote is the price used by the model. Actual fills can depend on order size, latency, depth and available liquidity. Include commission, slippage and any applicable financing as separate inputs when they belong in your test.

15

Reproduce the arithmetic from the data

The JSON records the source archive URLs and checksums, the selected quotes and the calculation inputs. Replay the quote selection, compute the two half-spreads and use full input precision. Round results for display after summing the positions.

16

Review the assumptions before comparing strategies

Show which positions matched both scenarios and how the quotes were timed. Check spread by window, record any skipped positions, and compare fixed sensitivity with the observed spread. Treat these four dates as one documented sample.

Frequently asked questions

What is the difference between fixed and variable spread in a backtest?

A fixed model assigns one spread across the positions. A variable model can use the Bid and Ask recorded at each matched entry and exit.

Does a 1-pip spread charge 2 pips for entry and exit?

Against the midpoint it charges 0.5 pip at entry and 0.5 pip at exit. With 1 pip at both endpoints that adds up to 1 pip.

Can I calculate a spread candle from separate Bid and Ask candle highs?

Calculate the spread from each simultaneous quote and aggregate it. Separate candle highs can come from different times.

Why might the observed model do better than the fixed one?

If the two observed half-spreads sum to less than the fixed spread, the modeled spread cost is lower for that position.

Why use the same quote times in both cases?

Matching times and direction holds the midpoint move constant, so differences in the modeled result come from the spread assumption.

Can these results tell me what my broker will fill?

The calculation uses archived quotes from one feed. Check your broker's quotes, execution conditions and costs for your own test.

Primary sources

Created by the MyProfitFactor editorial team.

Copying or republication without attribution and an active link to the original material is prohibited. Usage policy.