Errors, bugs, questions - page 553

 
Urain:

Then make a suggestion in the profile thread (there is no mistake, though).

well... I think this is a mistake. according to my understanding, if in the calendar I can select the end of the period to be today's date,
then the tester and optimizer are expected to work up to the current time, but this does not happen ((
the developers are aware of this and it is within their power to make a good platform. if not, then no. we will think further...

 

I read this article "A Step-by-Step Guide to Writing MQL5 Expert Advisors for Beginners" https://www.mql5.com/ru/articles/100 found the following lines in it:


For 3 and 5-digit quotes we multiply Stop Loss and Take Profit values by 10.

The MACD sample included in the terminal contains the same information:

//--- tuning for 3 or 5 digits
int digits_adjust=1;
if(m_symbol.Digits()==3 || m_symbol.Digits()==5) digits_adjust=10;

m_adjusted_point=m_symbol.Point()*digits_adjust;

What is this action? Why multiply variables by 10 with 3 and 5 decimal places?

Пошаговое руководство по написанию MQL5-советников для начинающих
Пошаговое руководство по написанию MQL5-советников для начинающих
  • 2010.06.09
  • Samuel
  • www.mql5.com
Написание советников на MQL5 проще чем кажется, вы легко можете этому научиться. В этом руководстве вы познакомитесь с основными моментами, необходимыми для написания простого советника на основе конкретной торговой стратегии. Рассмотрена структура советника, использование встроенных технических индикаторов и торговых функций, вопросы отладки и тестирования советника на исторических данных.
 
progeon:

I read this article "A Step-by-Step Guide to Writing MQL5 Expert Advisors for Beginners" https://www.mql5.com/ru/articles/100 found the following lines in it:

For 3 and 5-digit quotes we multiply Stop Loss and Take Profit values by 10.

The MACD sample included in the terminal contains the same information:

//--- tuning for 3 or 5 digits
int digits_adjust=1;
if(m_symbol.Digits()==3 || m_symbol.Digits()==5) digits_adjust=10;

m_adjusted_point=m_symbol.Point()*digits_adjust;

What is this action? Why multiply variables by 10 with 3 and 5 decimal places?

It's for those friends who are used to counting everything in four digits and don't want to change their minds.

Thus, if we set 100 points of Stop Loss in parameters, we obtain 1000 points in five-digit calculations, and 100 points in four-digit calculations, which is the same.

The four-digit number has advantages, the ease of re-calculation of profit, 1 pip 1% of the invested funds.

 
progeon:

I read this article "A Step-by-Step Guide to Writing MQL5 Expert Advisors for Beginners" https://www.mql5.com/ru/articles/100 found the following lines in it:

For 3 and 5-digit quotes we multiply Stop Loss and Take Profit values by 10.

The MACD sample included in the terminal contains the same information:

//--- tuning for 3 or 5 digits
int digits_adjust=1;
if(m_symbol.Digits()==3 || m_symbol.Digits()==5) digits_adjust=10;

m_adjusted_point=m_symbol.Point()*digits_adjust;

What kind of action is that? Why would you multiply a variable by 10 with 3 and 5 decimal places?


For better compatibility with different brokers (providing 4 or 5 digits quotes), i.e. without the need to change the parameters of the Expert Advisor.

This algorithm is based on the fact that at brokers offering 4-digit quotes _Digitsmay be 4 or 2 (usually at pairs with JPY),

and in 5-digits 5 and 3 accordingly.

Although, I am interested in security of this method myself, because there are tools with differentvalues of _Digits.

Personally I'm checking with "EURUSD". But at least there are brokers in MT4 where the eurodollar has a slightly different name, for exampleEURUSD_fx

or something like that.

 
crOss:
пункты 1 и 2 уходят, если фиксировать правое время на момент начала теста/оптимизации.
никто не просит актуальность до секунды... но один торговый день - это, извините, ни в какие ворота.

Urain:

Then you will have to enter not only the year month date, but also the hour:minutes of the end.

Not necessarily, the time can be fixed purely programmatically when the test/optimisation runs.

Honestly, I find the suggestion quite sensible. I'm all for it.

It's irrelevant to me at the moment, but it might be very desirable soon.

 
Urain:

This is for those people who are used to count everything in four-digit points, and do not want to rebuild.

Thus, setting stoploss for 100 points in the parameters, we obtain recalculation of 1000 points in five-digit, and 100 points in four-digit, which is the same thing.

The four-digit number has advantages, the ease of recalculation of profit, 1 pip 1% of the invested funds.

I see, let's continue) Another question - the same article uses NormalizeDouble function when forming Stop Loss and Take Profit for what reason? It seems to be meaningless.

mrequest.sl = NormalizeDouble(latest_price.ask - STP*_Point,_Digits); // Stop Loss
mrequest.tp = NormalizeDouble(latest_price.ask + TKP*_Point,_Digits); // Take Profit
Документация по MQL5: Преобразование данных / NormalizeDouble
Документация по MQL5: Преобразование данных / NormalizeDouble
  • www.mql5.com
Преобразование данных / NormalizeDouble - Документация по MQL5
 
progeon:

I see, let's continue) Such a question - in the same article the NormalizeDouble function is used when forming Stop Loss and Take Profit for what reason? It seems to be meaningless.

There is no pointlessness at all. During level calculation, operations with doublings are performed and the result will not be normalized and in case you pass it to the server as it is, you will get requotes. That's why the result of calculation is normalized.
 
Urain:
There is no pointlessness, when calculating the level, operations with doubles are performed, and the result will not be normalised, if you pass it to the server as it is, you will get a requote. That's why the result of calculation is normalised.
Suppose the stoploss is 100, the point is 0.00001. What may occur when multiplying them? Will the 9's pop up somewhere? For example 0.0009999?
 
progeon:
Stoploss let's say 100, point 0.00001. what might arise when multiplying them? Will the 9's pop up somewhere? For example 0.0009999?
   double a=1.45861+32*_Point;
   Print(DoubleToString(a,16));

Seems like a normal number should come out as 1.45893 but we get 1.4589300000000002

 
Renat:

We planned to make a "Security" tab in the EA information, which shows the security level and a list of called DLL functions.

Just in time for the launch of the shop, we will be working on the EX5 files.

Renat, there are two more questions about DLL calls in the new EX5 format.

1. How will the code behave when calls are disabled? Like now - won't it even run?

2. If it won't start, what is MQL5_DLLS_ALLOWED /TERMINAL_DLLS_ALLOWED for?

Reason: