Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1154

 
SEM:

Trying to normalise TakeProfit for Sell

SYMBOL_DIGITS is also a constant. It does NOT return"the number of decimal places in a symbol quote". It tells SymbolInfoInteger() which value of the integer character property to return.
Документация по MQL5: Константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Для получения текущей рыночной информации служат функции SymbolInfoInteger(), SymbolInfoDouble() и SymbolInfoString(). В качестве второго параметра этих функций допустимо передавать один из идентификаторов из перечислений ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE и ENUM_SYMBOL_INFO_STRING соответственно. Некоторые символы (как...
 
Artyom Trishkin:
SYMBOL_DIGITS is also a constant. It does NOT return the " number of decimal places in a symbol quote" value. It tells SymbolInfoInteger() which value of the integer character property to return.

OK, then how do you normalise the TP for Sell?

  Print(NormalizeDouble(SymbolInfoDouble(Symbol(),SYMBOL_POINT),(int)SymbolInfoInteger(Symbol(),SYMBOL_DIGITS)));

also returns unclear = (EURUSD,M15) 1e-05

 
SEM:

Ok, then how to normalise the TP for Sell?

also returns unclear = (EURUSD,M15) 1e-05

1e-05 is one to the minus fifth power, i.e. 0.00001. What did they teach you in high school?

 
SEM:

Ok, then how to normalise the TP for Sell?

also returns an incomprehensible = (EURUSD,M15) 1e-05

You have normalized it for the robot.

You need to useDoubleToString to output to the prints

 Print(DoubleToString(SymbolInfoDouble(Symbol(),SYMBOL_POINT),(int)SymbolInfoInteger(Symbol(),SYMBOL_DIGITS)));
 
Vitaly Muzichenko:

For the robot you have normalised.

You need to useDoubleToString to output to the prints

Thank you for your help! Bottom line:

double _SYMBOL_POINT_ = SymbolInfoDouble(Symbol(),SYMBOL_POINT);
int _SYMBOL_DIGITS_   = (int)SymbolInfoInteger(Symbol(),SYMBOL_DIGITS);


{
  double _PriceCurrent_TakeProfit =NormalizeDouble(m_position.PriceOpen()-(TakeProfit*_SYMBOL_POINT_),_SYMBOL_DIGITS_) ;
  double _PriceCurrent=NormalizeDouble(m_position.PriceCurrent()-(TakeProfit*_SYMBOL_POINT_),_SYMBOL_DIGITS_);
}
 
Franklins100:

This is an idea, but cross-testing will not produce accurate results, in my opinion. Testing, again in my inexperienced opinion, should be done in a final, complete version. And here the question is - how and by what computer parameters is it possible to speed up testing as much as possible, without resorting to the use of third-party power. GPU or CPU?

Cross testing is as accurate as direct testing. If you understand all the variables, you specify an acceptable step for the variables when splitting them into groups. Then, depending on 3D image, you can select one or more groups of values for each group of variables as a result of test runs. And finally you run a full test with narrow range and high discreteness of parameters.

I run one Expert Advisor like this every Saturday. Over 300 variables. During the day, I run cross tests. Then I run the main one at night. On Sunday I analyze the results. I analyze what has changed compared to last week's set. And then, depending on the situation, I sometimes run additional tests. I'm running everything on two computers.

In the end it takes about 30 machine hours. If I ran it directly I think the computer would freeze :) for about two weeks. You've got to do what you can to make it work.

The speed of tests affects the core processor (for MT5 exactly).

It took me a long time to run the very first tests. Now I have been running it for the last week. I think every EA has its own subtleties. I have simply introduced coefficients and the basic parameters are changed very rarely. It turns out that I mainly adjust for volatility. Plus I have a serious news module with individual breakdown by news types, instead of the simple three stars :) In general, I think "news" is the weakest point of all EAs. In addition, there are the periods of "change of contracts", "option expiry". They are also worth working with.

 
Franklins100:

This is an idea, but cross-testing will not produce accurate results, in my opinion. Testing, again in my inexperienced opinion, should be done in a final, complete version. And here the question is - how and by what computer parameters is it possible to speed up testing as much as possible, without resorting to the use of third-party power. GPU or CPU?

There is a topic on tests:Evaluating CPU cores for optimization

Оцениваем ядра CPU для оптимизации
Оцениваем ядра CPU для оптимизации
  • 2019.08.09
  • www.mql5.com
Предлагаю собрать статистику по производительности разных процессоров с целью оценки их эффективности для работы тестера стратегий в режиме оптимиз...
 
Vladimir Karputov:

There is a topic about tests:Evaluating CPU cores for optimisation

BenditO:

Cross-validation is as accurate as direct testing. If you understand all the variables, you specify an acceptable step for the variables when grouping them. Depending on 3D view, you can select one or more groups of values for each group of variables depending on the results. And finally you run a full test with narrow range and high discreteness of parameters.

I run one Expert Advisor like this every Saturday. Over 300 variables. During the day, I run cross tests. Then I run the main one at night. On Sunday I analyze the results. I analyze what has changed compared to last week's set. And then, depending on the situation, I sometimes run additional tests. I'm running everything on two computers.

In the end it takes about 30 machine hours. If I ran it directly I think the computer would freeze :) for about two weeks. You know, you're gonna have to do what you can to make it work.

The speed of tests affects the core processor (for MT5 exactly).

It took me a long time to run the very first tests. Now I have been running it for the last week. I think every EA has its own subtleties. I have simply introduced coefficients and the basic parameters are changed very rarely. It turns out that I mainly adjust for volatility. Plus I have a serious news module with individual breakdown by news types, instead of the simple three stars :) In general, I think "news" is the weakest point of all EAs. In addition, there are the periods of "change of contracts", "option expiry". I have them to work with as well.

Thank you very much.

 

Good day to all!

I'm trying to learn elementary things in MQL5, but I suddenly encountered a warning message displayed in the picture attached when compiling code copied from MQL5 Reference.

I wonder if there are some errors in MQL5 Reference as well. Please, can you tell me what to fix in the code (the MQL5Reference itself would also be useful) to avoid such a warning?

Sincerely, Vladimir.




Документация по MQL5 - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Документация по MQL5 - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
  • www.mql5.com
MetaQuotes Language 5 (MQL5) - язык программирования технических индикаторов, торговых роботов и вспомогательных приложений для автоматизации торговли на финансовых рынках. MQL5 является современным языком высокого уровня и разработан MetaQuotes Software Corp. для собственной торгово-информационной платформы. Синтаксис языка максимально близок...
 
MrBrooklin:

Good day to all!

I'm trying to learn elementary things in MQL5, but I suddenly encountered a warning message displayed in the picture attached when compiling code copied from MQL5 Reference.

I wonder if there are some errors in MQL5 Reference as well. Please, can you tell me what to fix in the code (or in the MQL5 Reference itself) to avoid such a warning?

Sincerely, Vladimir.

Yes, there are some inaccuracies in the Help.

Reason: