Change spread in strategy tester

 

I just started with mql5 and I am very excited about it.

But I struggle with a (probably) simple problem which I am unable to fix:

When I use the strategy tester the spread is always fixed to 50 when using EURUSD, M1

But when I look at the docs I see: "The Strategy Tester of MetaTrader 5 client terminal uses the historical spread values

(https://www.mql5.com/en/code/152)

Is there a way to setup my strategy tester to use historical spread values?

Forex Strategy Tester in the MetaTrader 5 Trading Platform
  • www.metatrader5.com
Strategy Tester is a powerful tool that allows testing the efficiency of an Expert Advisor (trading robot) and detects the best input parameters before it is used for real trading on the financial markets (Forex, Stocks, Futures and CFD).
 
CaptainPeacock:

I just started with mql5 and I am very excited about it.

But I struggle with a (probably) simple problem which I am unable to fix:

When I use the strategy tester the spread is always fixed to 50 when using EURUSD, M1

But when I look at the docs I see: "The Strategy Tester of MetaTrader 5 client terminal uses the historical spread values

(https://www.mql5.com/en/code/152)

Is there a way to setup my strategy tester to use historical spread values?

Spread is stored with historical data (for each bar) and is use by Strategy Tester.
 
angevoyageur:
Spread is stored with historical data (for each bar) and is use by Strategy Tester.

Thanks Angevoyageur but when I use the strategy tester, the spead does not change (is always 50)?

 
CaptainPeacock:

Thanks Angevoyageur but when I use the strategy tester, the spead does not change (is always 50)?

Maybe the date from your Broker is not so good,  try the MetaQuotes Demo server or another Broker and different data.
 

Problem solved :)

I had selected a date range in 2003 for the strategie tester.

If I use a more recent date selection, the spread is now changed every tick

(which is a very nice feature btw!).

Thanks for the support 

Reason: