Changing the Spread in the MT4 Strategy Tester : My SpreadChanger Program Solves the Problem

When you do backtests in Metatrader 4, one of the first things you will notice is how the spread used by the tester is taken from whatever the actual spread is on the demo or live account you have loaded into the platform. This introduces several problems into the tests as they become very hard to reproduce since the spreads can vary a lot within one day and even little variations along the spread can produce different testing results in long term simulations (although differences are proportional to the changes along the spread). Another problem from having the account spreads lies on the fact that most demo accounts have very good spreads which often represent the most expensive live accounts which most people do not get until much later on. In order to solve this problems and get reproducible backtests with realistic spreads we need to find a way to change the spread on the strategy tester to whatever level we want. On today’s post I will talk about the solution to this problem and how a program I made makes spread changing and running backtests with custom spreads a total breeze.

The spread – as many of you already know – is the cost associated with the placement of an order within the currency exchange market, it is the difference between the bid and the ask price of an instrument and directly reflects the cost of running a given strategy over the long term. Not only does the spread affect how much you have to pay the market to enter but it can also affect how a strategy trades since the Ask price changes as a function of the spread in MT4 which doesn’t have separate Bid/Ask histories but merely a Bid history which then simulates the Ask through the use of a constant spread mechanism. If you have a strategy that enters when the Ask is above the upper Bollinger Band – for example – the strategy will enter more trades on a higher spread as a lower Bid is needed for the ask price to reach above the desired point.

Once we realize how vital the spread is for the execution of trading strategies it becomes evident that being able to change the spread to a level which is constant and realistic is vital for the gathering of more accurate and most importantly, more reproducible simulations. Another important point about changing the spread is the ability to evaluate the effects of changing trading costs, something very important to evaluate the sensitivity of a strategy to increases in trading expenses.

Previously the only solution we had – which we had been using in Asirikuy – included a spread changing script available for free online which required us to set the desired spread level, close our MT4 platform, then copy a file into another folder and restart the platform. Not only was this a long and inconvenient process but it had to be done for every pair we wanted to test. This meant that if we wanted to test a EUR/USD strategy and then test it on the GBP/USD we would need to execute the whole procedure over again before starting our tests on the second currency pair. Since I do about 50-100 tests a day of many different strategies on many different pairs each day, it became obvious to me that this way of changing spreads was nothing short of ridiculous and that a more convenient way – to speed up my work and efforts as well as those of Asirikuy members – was needed. Moreover the above script did not work on crosses (like EUR/JPY) with the backtests simply freezing and ending after the first trade.

For this reason I decided to code my own program to modify the symbol.sel binary file – where the spreads are stored – in a way which would allow me to change the spreads of many instruments at the same time, avoid any file copying and allow me to use JPY crosses for my simulations. Since the nature of the symbol.sel file is not known (Metaquotes won’t reveal the formatting) I had to start with the small amount of information available within the script to figure out how to add many pairs with different spreads and get the JPY crosses to run in the backtests with a custom spread level.

Surely after working for about two days using Delphi’s read and write block functions for binary files I was finally able to get a good idea of how the formatting of the symbol.sel file works and I managed to achieve the above objectives. The spread changing program I developed allows a user to change the spread of 8 different instruments with one single click, assigning each one custom spreads and avoiding the need to “reset” the platform between tests. The procedure simply involves closing the platform (which has previously been cut off from connecting to its server), then running the changer program and restarting the platform. The terminal will now have all the custom spreads assigned and you will be able to run backtests for all the instruments you want without having to generate new spread files or restart the terminal. The program also correctly assigns spread levels and pip values to JPY crosses so finally we can use these pairs with custom spreads !

The above program will become available to Asirikuy members this Sunday, allowing them to perform their tests in a much more convenient fashion. If you would like to know more about this program and get access to it to change the spreads within your MT4 platform in a convenient way please consider joining, a website filled with educational videos, trading systems, development and a sound, honest and transparent approach to automated trading in general . I hope you enjoyed this article ! :o)

Print Friendly, PDF & Email
You can leave a response, or trackback from your own site.

6 Responses to “Changing the Spread in the MT4 Strategy Tester : My SpreadChanger Program Solves the Problem”

  1. Gabor says:

    This is coool! Nice reverse engineering :)

    • admin says:

      Hi Gabor,

      Thank you very much for your comment :o) I am glad you like the program ! This definitely makes backtesting a LOT friendlier,

      Best Regards,


  2. Chris says:


    Bravo! Great work as always. Looking forward to taking it for a spin, particularly on the weekend when I get time for this.

    Keep up the great work,


    • admin says:

      Hi Chris,

      Thank you very much for your comment :o) I am glad you liked this program ! Definitely it makes the running of backtests a ton easier since we no longer have to open/close platforms and copy files all around. I am already doing my backtesting a ton faster and exploring some strategies I hadn’t been able to test on JPY crosses due to the problems of the script we used to use. Certainly I’ll be waiting for all your comments and suggestions once this software is released during the weekend ! Thanks again for your comment,

      Best Regards,


  3. Ben says:

    Hi Daniel

    Are you still using your spread changer program?

    The one I was using from Jeremy Whittaker has stopped working.

    If it still works, would you mind sending me a copy.

    Thanks and kind regards

    Ben Pope

    • admin says:

      Hi Ben,

      Thank you for your post :o) This program is only available through an Asirikuy memberhsip,

      Best regards,


Leave a Reply

internal_server_error <![CDATA[WordPress &rsaquo; Error]]> 500