Discussion of article "Statistical Distributions in MQL5 - taking the best of R" - page 14

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Forum on trading, automated trading systems and testing trading strategies
Help with correlation
Quantum, 2016.12.01 12:53 pm.
Math.mqh file should be put in terminal_data_folder\MQL5\Include\Math\Stat\ folder.It does not compile under MT4. #property strict does not help
'MathLog1p' - no one of the overloads can be applied to the function call Math.mqh 4655 17
'MathLog1p' - no one of the overloads can be applied to the function call Math.mqh 4676 16
'MathExpm1' - no one of the overloads can be applied to the function call Math.mqh 4702 17
'MathExpm1' - no one of the overloads can be applied to the function call Math.mqh 4723 16
'MathSinh' - no one of the overloads can be applied to the function call Math.mqh 4750 17
'MathSinh' - no one of the overloads can be applied to the function call Math.mqh 4772 16
'MathCosh' - no one of the overloads can be applied to the function call Math.mqh 4799 17
'MathCosh' - no one of the overloads can be applied to the function call Math.mqh 4821 16
'MathTanh' - no one of the overloads can be applied to the function call Math.mqh 4848 17
'MathTanh' - no one of the overloads can be applied to the function call Math.mqh 4870 16
'MathArcsinh' - no one of the overloads can be applied to the function call Math.mqh 4897 17
'MathArcsinh' - no one of the overloads can be applied to the function call Math.mqh 4919 16
'MathArccosh' - no one of the overloads can be applied to the function call Math.mqh 4946 17
'MathArccosh' - no one of the overloads can be applied to the function call Math.mqh 4968 16
'MathArctanh' - no one of the overloads can be applied to the function call Math.mqh 4995 17
'MathArctanh' - no one of the overloads can be applied to the function call Math.mqh 5017 16
16 error(s), 0 warning(s) 17 1
This is an MQL5 library without MQL4 support.
Classes are not needed in this matrix library.
This is an MQL5 library without MQL4 support.
But it works 99% in MQL4, just like GraphPlot. It would be 100% if they fixed the bug in MQL4 - none of the overloads can be applied to the function call.
I looked carefully, but this is not a bug of MQL4, but a bug of MQL5!
//| MathLog1p|
//+------------------------------------------------------------------+
//| The function calculates log(1+x) for the elements from the array.||
//||
//| Arguments:|
//| array[] : Array with values|
//| result[] : Output array with calculated values |
//||
//| Return value: true if successful, otherwise false |
//+------------------------------------------------------------------+
bool MathLog1p(const double &array[],double &result[])
{
int size=ArraySize(array);
if(size==0)
return(false);
//--- prepare target array
if(ArraySize(result)<size)
if(ArrayResize(result,size)!=size)
return(false);
//--- calculate values
for(int i=0; i<size; i++)
result[i]=MathLog1p(array[i]);
//---
return(true);
}
//+------------------------------------------------------------------+
//| MathLog1p|
//+------------------------------------------------------------------+
//| The function calculates log(1+x) for the elements from the array.||
//||
//| Arguments:|
//| array[] : Array with values|
//||
//| Return value: true if successful, otherwise false |
//+------------------------------------------------------------------+
bool MathLog1p(double &array[])
{
int size=ArraySize(array);
if(size==0)
return(false);
//--- calculate values
for(int i=0; i<size; i++)
array[i]=MathLog1p(array[i]);
//---
return(true);
}
MQL4 correctly cusses - no one of the overloads can be applied to the function call. But MQL5 is silent when there is an obvious error. @Renat Fatkhullin, a bug?
MQL4 correctly warns - no one of the overloads can be applied to the function call. And MQL5 is silent when there is an obvious error.
This is not an error. MQL5 has these functions.
This is not an error. MQL5 has these functions.
Hello,
encountered a problem when calculating the quantile of gamma distribution
in R:
> qgamma(0.05,2,scale=1)
[1] 0.3553615
> qgamma(0.05,10,scale=1)
[1] 5.425406
in mql5:
Results:
0.3553615106986621
Error 4
build 1596
Hi,
encountered a problem when calculating the quantile of the gamma distribution
Good afternoon, thank you for your message.
Error 4 means convergence problems in Newton's back iteration algorithm, which is used to find quantiles. We will look into it.