I found out that the problem is that the spread is preset at 60 points in the historical runs. I have learned that apparently that is set by the broker, and one could adjust the spread manually in MQL4, but no so easily in MQL5. In MQL5, there is an option under symbol, where one can set the spread manually. but it does not work. By this I mean you can set it to say 10, as in the example attached, but once in the simulator... it goes back to the original value (60). Any thoughts on how to adjust the spread in MQL5 for the historical simulations?
Are you sure, you are saving the value by clicking OK?
It should work, as long as you don't test with real tick data.
Hello Fernando,
Unfortunately, on my end changing the spread manually does not work. This is the approach I am using:
1. On the Strategy Tester in MQL5, Click on the Symbol icon.
2. Change spread (lets say to 1).
3. Click Ok.
4. Back to the Strategy tester, Click Start.
That will open, the Strategy Tester Visualization, but the spread appears as 60, and it does not change for the lapse of the simulation. I show the steps on the images attached. Any thoughts on how to modify the spread?. I am looking into some videos claiming that one has to create a new symbol and modify the data manually on the file created....sounds laborious, but will check and report.
- On the Strategy Tester in MQL5, Click on the Symbol icon.
- Change spread (lets say to 1).
- Click Ok.
- Back to the Strategy tester, Click Start.
That will open, the Strategy Tester Visualization, but the spread appears as 60, and it does not change for the lapse of the simulation. I show the steps on the images attached. Any thoughts on how to modify the spread?. I am looking into some videos claiming that one has to create a new symbol and modify the data manually on the file created....sounds laborious, but will check and report.
That is very strange.
Have you tried with a different broker or a different account type with the same broker?
I have tried in two brokers and the problem is the same.
I found that another person got to the same trouble. https://www.mql5.com/en/forum/58825
The end suggestion on that post was to use TesterDeposit() and TesterWithdrawal(), to adjust the gains. I am still trying to figure out how would that work...
- 2015.05.16
- www.mql5.com
I have tried in two brokers and the problem is the same.
I found that another person got to the same trouble. https://www.mql5.com/en/forum/58825
The end suggestion on that post was to use TesterDeposit() and TesterWithdrawal(), to adjust the gains. I am still trying to figure out how would that work...
No, I would suggest a clean new installation, as it seems the problem is with your MetaTrader setup.
By the way, what build are you using?
The latest official build is 3980.
I reinstalled MQL5, and that fixed something but not completely.
If I change the spread in Symbol, the spread used in the Testing changes somewhat ....like if it was some transformation in between.
In the example attached, I set the spread to 10 in the Tested Symbol form ...but in the Visualization the spread used is 17. Images attached. Any thoughts?
I reinstalled MQL5, and that fixed something but not completely.
If I change the spread in Symbol, the spread used in the Testing changes somewhat ....like if it was some transformation in between.
In the example attached, I set the spread to 10 in the Tested Symbol form ...but in the Visualization the spread used is 17. Images attached. Any thoughts?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have a simple EA that enters long when an ema is going up, and short when an EMA is going down. When I run this EA in the Strategy Tester Visualization, the price at which buy operations are entered is much larger than the real price. In turn, the Sell operations appear to be on the right price. See position of Long and Short arrows in the image below. Apologies is this is basic, I am new to MQL5 coding, but I have followed several tutorials by the line, and I cannot find what could be the cause of this. Any thoughts?
Here is the code: