Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 888

 
There can only be one class in one programme? It's just that my indicator stopped counting everything in the first class after adding the second one

MQL5
 
Everyone has passed it by. I haven't solved this problem yet. Doesn't anyone know the solution to this?
Любые вопросы новичков по MQL4 и MQL5, помощь и обсуждение по алгоритмам и кодам
Любые вопросы новичков по MQL4 и MQL5, помощь и обсуждение по алгоритмам и кодам
  • 2019.06.12
  • www.mql5.com
В этой ветке я хочу начать свою помощь тем, кто действительно хочет разобраться и научиться программированию на новом MQL4 и желает легко перейти н...
 

Hello traders. Please advise if there is an option to change spread in the MT5 strategy tester? I can change spread in the MT4 strategy tester without any problem, but I don't understand how to do it in MT5. Many thanks in advance.

 
Kolya32:

Hello traders. Could you please advise whether there is a spread change option in the MT5 strategy tester? I can change spread in the MT4 strategy tester without any problem, but I don't understand how to do it in MT5. Many thanks in advance.

The spread cannot be changed. But you can test with a real spread - to do so, select the "Every tick based on real ticks" testing mode and the test will be done with a dynamically changing spread (it will change exactly as it did on the real account).

Also, it is highly recommended to conduct tests with different execution delays.

 
Vladimir Karputov:

The spread cannot be changed. But you can test with a real spread - to do so, select the "Every tick based on real ticks" testing mode and the test will be done with a dynamically changing spread (it will change exactly as it did on the real account).

It is also highly recommended to run tests with different execution delays.

It turns out"Every tick based on real ticks" in MT5 == "Current" in MT4 I see thank you.
 
Kolya32:
It turns out that"Every tick based on real ticks" in MT5 == "Current" in MT4.

No, it is not equal.

  • In MetaTrader 4 in "current spread" mode, the spread that was returned by the server when the test was started is taken for the test. And if the spread is floating, it can be any spread in the tester - 2, 3, 10, 100..., but it will always be constant - the one that was on the server when the test was started, and it will be different from test to test provided that when the next test is started in this mode, the spread on the server has changed.
  • In MetaTrader 5, in the "Every tick based on real ticks" mode, historical tick data are taken for the test - these are the ticks that were on the server during the testing period. Accordingly, if the spread is floating, then it will be floating in the tester - it will change as it was on the server during the period, you are testing.
And those are two big differences.
 
Artyom Trishkin:

No, it is not equal.

  • In MetaTrader 4 in "current spread" mode, the spread that was returned by the server when the test was started is taken for the test. And if the spread is floating, it can be any spread in the tester - 2, 3, 10, 100..., but it will always be constant - the one that was on the server when the test was started, and it will be different from test to test provided that when the next test is started in this mode, the spread on the server has changed.
  • In MetaTrader 5, in the "Every tick based on real ticks" mode, historical tick data are taken for the test - these are the ticks that were on the server during the testing period. Accordingly, if the spread is floating, then it will be floating in the tester - it will change as it was on the server during the testing period.
These are two big differences.
I think I'm beginning to understand. Thank you very much for such a detailed explanation. I'll keep experimenting and figuring things out)
 

How to turn this entry 2015.06.23 00:00 into this entry 2015.06.23. Remove the 4 zeros. I was thinking of doing this.

datetime Data=D'2015.06.23 00:00';
string   Data_st=(string)Data;
Дальше с помощью строковой функции обрезать 2015.06.23 00:00 до такой записи 2015.06.23  или заменить ноли пустотой

I looked atStringAdd,StringFill,StringReplace functions but they are bool or int and I don't understand how they work. Is it possible to use them if yes give an example as I am a jackass.

 
Seric29:

How to turn this entry 2015.06.23 00:00 into this entry 2015.06.23. Remove the 4 zeros. I was thinking of doing this.

I looked atStringAdd,StringFill,StringReplace functions, but they are bool or int and I don't understand how they work. Is it possible to use them if yes give an example as I am a jackass.


string  TimeToString(
   datetime  value,              // число
   int       mode=TIME_DATE      // формат вывода
   );
TimeToString - Преобразование данных - Справочник MQL4
TimeToString - Преобразование данных - Справочник MQL4
  • docs.mql4.com
TimeToString - Преобразование данных - Справочник MQL4
 
Alexey Viktorov:

Well your version would be better.