Wishes for MT5 - page 45

 
Dear developers. How would you feel about introducing a data type from C/C++ "long double"? That would be very useful. Truth be told, I've encountered that the accuracy of "double" type is not enough for calculations. Or alternatively, make a special class for operations with arbitrarily defined precision. How do you look at that?
Документация по MQL5: Основы языка / Типы данных
Документация по MQL5: Основы языка / Типы данных
  • www.mql5.com
Основы языка / Типы данных - Документация по MQL5
 
-Alexey-:
Dear developers. What do you think about introducing the "long double" data type from C/C++? It would be very useful. To tell the truth, I've encountered that "double" type's accuracy is insufficient for calculations. Or alternatively, make a special class for operations with arbitrarily defined precision. What do you think about it?

Sorry to intrude, but are you launching a rocket into space? Wouldn't it be better to think about optimizing the algorithm or something?

Can you give an example where such precision is needed?

 
For example it is necessary for numerical calculation of normal distribution quantile with accuracy at least 4-5 signs, as dependence at P>.9 lies in horizon and machine zero on probability change does not allow to obtain accuracy more than 2-3 signs, and at P>.99 even worse. And so on. Figures may be a bit different, it's just for example, as I have to work with a different distribution, but the idea is the same. What a rocket :)
 
Another problem has arisen with the lack of precision. The situation is as follows. I'm building a distribution function of 10000 values by prices. On some intervals the function's value is small and divided by 10000. We obtain values of the order 1*10e-6; then we need to find the square of the difference between these values and obtain the value of the order 1*10e-13 (then several thousand such values need to be summed up); data are catastrophically lost. And 10000 is not so much, to tell the truth - not much. That's why I once again ask the developers to introduce "long double". As far as I understand, statistical work with large samples in the financial field is a frequently demanded task. Otherwise it turns out that one has just got excited about MQL5 and now has to switch to C++.
 
-Alexey-:
There is one more issue with the lack of accuracy. The situation is as follows. We are building a distribution function for 10 000 values by price. On some intervals the function's value is small and divided by 10000. We obtain values of the order 1*10e-6; then it is necessary to define the square of the difference between these values and we obtain the value of the order 1*10e-13 (then several thousand such values must be summed up); data are catastrophically lost. And 10000 is not so much, to tell the truth - not much. That's why I once again ask the developers to introduce "long double". As far as I understand, statistical work with large samples in the financial field is a frequently demanded task. Otherwise it turns out that we have just got excited about MQL5 and now we have to switch to C++.

Type double in mql5 works with numbers in range +-10e-307 to +-10e307, with mantissa of 16 digits. So there are no problems described by you.

If the declared mantissa is not enough, develop a higher precision class, for example, with mantissa of 32 digits. That is your right.

But for the main mass of developers 16 digits of mantissa is enough, why bother with such a mess?

Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
  • www.mql5.com
Основы языка / Типы данных / Вещественные типы (double, float) - Документация по MQL5
 
Urain:

Type double in mql5 works with numbers in range +-10e-307 to +-10e307, with mantissa of 16 digits. So there are no problems described by you.

If the declared mantissa is not enough, develop a higher precision class, for example, with mantissa of 32 digits. That is your right.

For most developers, 16 characters mantissa is enough, so why bother with it?

I do not agree. Here is an example (grid 10000x10000)

double x1=0.0011;

double y1=x1/10000;

double x2=0.0012;
double y2=x2/10000;

double c=y1-y2;
double d=MathPow(c,2);


printf(string(d));

результат: 9.999999999999968e-017

What do I do with this result? How do I compare it to other results? DBL_EPSILON=2.2204460492503131e-016. Besides the last two digits - see? And that's only two operations. And I have more of these operations. And based on this information, you will have to restore data later using some more operations. More losses. I'm just learning to program in a C-like language and such a class is difficult for me to build (or rather, I have no idea how). This is a serious work. By the way, by any chance, do you have such a class? And the developers can improve things for everyone at once. It would be possible to make 100,000x100,000 grids. Already more or less representative samples would be available, although even this is not enough by and large. And if they made a class for arbitrary precision, it would be even better :) It's just a data type. If it exists, it's there for a reason, because it fulfills a need. The point is that I don't know whether it's difficult or not for developers. If it's difficult and expensive - I agree with you - why pass my problem onto them. But if it's not difficult - why not do it. Again - a powerful development environment for trading calculations with high accuracy - some competitive advantage here :). That's why I'm asking what they think about it.
 
-Alexey-:
Again - a powerful development environment for trading calculations with high accuracy - some competitive advantage here :).

This is only from your point of view... 99.9999% do not need it

Use specialised software for this purpose....

 
AlexSTAL:

This is only from your point of view... 99.9999% do not need it

Use specialised software for this purpose....

That's the thing, MT is a specialised product for financial calculations. Financial calculations are closely linked with the use of statistical methods. And there is no need to master new products - I want to develop TS in one trading environment, rather than to deal with this and fight with types. Moreover, it seems that MQL5 counts really fast.
 
-Alexey-:
That's the thing, MT is a specialized product for financial calculations. And financial calculations are closely connected with the use of statistical methods. And there is no need to master new products - I want to develop TS in one trading environment, rather than to deal with this and fight with types. Moreover, it seems that MQL5 is really fast.

You understand that any developer is always missing something....

If 500 programmers write 10 wishes each - then it would take an office like Bill's....

to implement fantasies....

 
AlexSTAL:

You understand that any developer is always missing something....

If 500 programmers wrote 10 wishes each, it would take an office like Bill's....

to make fantasies come true....

Fantasies have absolutely nothing to do with it. My question arose about the possibility of implementing the most common method of analysis. Namely, it's working with the row that remains after removal of the trend and the cycle. This method is written about in all textbooks on financial statistics and university teaching materials without exception. This is not a fantasy, but one of the canonical approaches to analysis. And a specialized environment should have the means to implement this approach - what do you think?