forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


Forex Software → Expert Advisor Studio → Dynamic Spread Backtetsing

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 2

Topic: Dynamic Spread Backtetsing

Hello Trader,

I'll demonstrate the effect of the Dynamic spread when we backtet a strategy.

I'll use two copies of EA Studio with equal data and the same strategy open.
The left-hand side EA Studio instance has a Dark colour theme and uses "Dynamic spread".
The right-hand side EA Studio uses a light color theme and has "Dynamic spread" disabled.

Please find the demonstration strategy attached.

https://image-holder.forexsb.com/store/1-use-dynamic-spread-option-thumb.png


Here is how the backtest looks with and without Dynamic spread backtesting.

https://image-holder.forexsb.com/store/2-use-dynamic-spread-option-thumb.png

The data, the strategy and all other settings are the same. The only difference is that the "dark" EA Studio uses dynamic spread, and the "Light" EA Studio uses fixed spread.
You see that the count of trades is the same in both instances.


Here is a screenshot of the Journal:

https://image-holder.forexsb.com/store/3-use-dynamic-spread-option-thumb.png

We see that we have a different Open price of the first position.
The first position is long. It means that it opens at the Ask price.
Because the historical data and the indicator charts use Bid prices, we calculate the Ask price by adding the spread.

Ask = Bid + Spread

We have "Bar Open" = 0.86457. This is the Bid price.

We can see the dynamic spread on the Indicator chart when we hover the mouse over a specific bar.

https://image-holder.forexsb.com/store/4-use-dynamic-spread-option-thumb.png

We have different Ask prices in both examples:
- Dynamic spread: Ask = 0.86457 + (46 * 0.00001) = 0.86457 + 0.00046 = 0.86503
- Static spread: Ask = 0.86457 + (20 * 0.00001) = 0.86457 + 0.00020 = 0.86477

Therefore, when we use a dynamic spread, the deposition opens at  0.86477; when we use a static spread, the position opens at 0.86477.

The dynamic spread eats from the profit.
Using dynamic spread makes the backtest far more reliable.
For that reason, I recommend using either the provided Premium Data feed or importing data from MetaTrader 5.

Please study this example and post your comments.

Post's attachments

Dynamic Spread Demo AUDCAD H1.mq5 24.7 kb, 3 downloads since 2023-10-17 

You don't have the permssions to download the attachments of this post.

2 (edited by S118 2024-02-17 23:48:09)

Re: Dynamic Spread Backtetsing

this is awesome!!! Thank you

Posts: 2

Pages 1

You must login or register to post a reply

Forex Software → Expert Advisor Studio → Dynamic Spread Backtetsing

Similar topics in this forum