- From theory to practice
- MT5 strategy tester and broker's spreads
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
You are correct; Spread is fixed for duration of backtest. With some 'smart' coding it's possible to effectively vary this during a backtest & tweak the Entry, SL & TP points.
It is possible to log spreads and so make a Spread history, and so then it's possible to take it into account for back testing. I'm sure a search will help you find examples of how others have done it.
Note that Broker A's price history & Broker B's spread history could be worse than not taking Spread into account. Indeed, 2 people using Broker A and recording Spread history could well get 2 different values. e.g. One broker gives different spreads for different geographical areas, and gives a wider spread than native clients if a client is introduced from their US sister company. https://alpari.com/en/trading_accounts/account_comparison_table.html#alpari_us
Personally, I ignore spreads and calc my EAs just on Bid price, & regard spread as the cost of entering or exiting the trade. This means that my Entry & Exit points exactly match the historical Bid price (rather than being above when Ask price is used) . Some laugh at me for doing that, but then again no-one has shown where I can get Bid+Ask or Spread history.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use