I'm using the class CTradeStatistics to get some specific statistics about the trades, but, in certain moment I got the error "zero divide in 'ctradestatistics.mqh'".
Investigating the situation, I discovered in the code:
A quicker way to get the Z-score percent. No looping.
double CTradeStatistics::CalcZScorePercent(double z_score)
{
int total=ArrayRange(Laplas,0);
double value=NormalizeDouble(MathAbs(z_score),2);
int index = (int) (value*100.0);
if ( index < total )
{
return Laplas[index][1];
}
return(0);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello,
I'm using the class CTradeStatistics to get some specific statistics about the trades, but, in certain moment I got the error "zero divide in 'ctradestatistics.mqh'".
Investigating the situation, I discovered in the code:
{
if(m_balance_data.At(i)!=0.0)
{
HPR[i-1]=m_balance_data.At(i)/m_balance_data.At(i-1);
m_ahpr+=HPR[i-1];
}
}
that, the "m_balance_data.At(i-1)" could be zero, eventually.
So, I changed to:
{
if(m_balance_data.At(i)!=0.0)
{
if(m_balance_data.At(i-1)==0){
HPR[i-1]=1;
}
else{
HPR[i-1]=m_balance_data.At(i)/m_balance_data.At(i-1);
}
m_ahpr+=HPR[i-1];
}
}
Is correct to assume that when the balance is 0, the HPR is equal to 1?
Thanks in advance.
Thanks for great work.can you add calculate correlation(profit,MFE) , correlation(profit,MAE) ,correlation(MFE,MAE) in Class?
A quicker way to get the Z-score percent. No looping.
This adds several more entries to the Laplas multidimensional array, i.e. entries 3.02 to 3.70.
I only had access to 4 digits of precision.