Line 74: zzH[h]=(MqlZigZag)zz[i]; to zzH[h].price=zz[i].value;
Line 80: zzL[l]=(MqlZigZag)zz[i]; to zzL[l].price=zz[i].value;
Also in the main program two_comment.mq5 the code block
//--- check for integrity of preliminary calculations - the CopyBuffer function results in an error thus err=-1 and it returns thus the rest of the program does not execute..
I just commented out the error checking or just set int err=1 so the program block does not run. and now the EA works for me.
//--- check for integrity of preliminary calculations
if(err<0)
{
//--- calculate the sums of deviations of the nodes from MA for ZigZag peaks
replace line 74 with the piece of code marked in red.
I know you didn't ask, but the <advancedzigzag.mqh> and <getextremums.mqh> files should be copied to the <...\MQL5\Include\> directory. I recommend renaming the files advancedzigzag.mqh to AdvancedZigZag.mqh, getextremums.mqh to GetExtremums.mqh and finally two_comets.mq5 to AdvancedZigZag.mq5. As this last one is an expert, I copied it to the <...\MQL5\Experts\Advisors\Downloads\ZigZag\> directory to better organise the plugins.
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.
in the AdvancedZigZag.mqh i had to change
Line 74: zzH[h]=(MqlZigZag)zz[i]; to zzH[h].price=zz[i].value;
Line 80: zzL[l]=(MqlZigZag)zz[i]; to zzL[l].price=zz[i].value;
Also in the main program two_comment.mq5 the code block
//--- check for integrity of preliminary calculations - the CopyBuffer function results in an error thus err=-1 and it returns thus the rest of the program does not execute..
I just commented out the error checking or just set int err=1 so the program block does not run. and now the EA works for me.
//--- check for integrity of preliminary calculations
if(err<0)
{
//--- calculate the sums of deviations of the nodes from MA for ZigZag peaks
ArrayInitialize(sumHi,0.0);
for(int j=H-1; j>=0; j--)
{
for(int i=0; i<NUMBER_MA; i++)
{
err=CopyBuffer(handle_MA_H[i],0,Azz.zzH[j].t,1,MA);
if(err<0) return;
sumHi[i]+=Azz.zzH[j].price-MA[0];
//Print("No error! sumHi: ", sumHi[i]);
}
}
//--- calculate the sums of deviations of the nodes from MA for ZigZag troughs
Print("Error Number: ", err);
ArrayInitialize(sumLo,0.0);
for(int j=L-1; j>=0; j--)
{
for(int i=0; i<NUMBER_MA; i++)
{
err=CopyBuffer(handle_MA_L[i],0,Azz.zzL[j].t,1,MA);
if(err<0) return;
sumLo[i]+=MA[0]-Azz.zzL[j].price;
}
}
}
Please use the </> button to insert your above code.
Dear all,
I've compiled the files and I'm getting the following error message, how could I solve it?
Hello parkus,
replace line 74 with the piece of code marked in red.
I know you didn't ask, but the <advancedzigzag.mqh> and <getextremums.mqh> files should be copied to the <...\MQL5\Include\> directory. I recommend renaming the files advancedzigzag.mqh to AdvancedZigZag.mqh, getextremums.mqh to GetExtremums.mqh and finally two_comets.mq5 to AdvancedZigZag.mq5. As this last one is an expert, I copied it to the <...\MQL5\Experts\Advisors\Downloads\ZigZag\> directory to better organise the plugins.
Hi,
Can you please correct the source code and upload again?
I tried to compile and it showed 30 errors!
Thanks
zzH[h]=(MqlZigZag)zz[i];
h++;
}
else
{
& nbsp; zzL[l]=(MqlZigZag)zz[i]; cannot cast 'dextremum' to 'MqlZigZag'
cannot cast 'dextremum' to 'MqlZigZag' AdvancedZigZag.mqh 74 17
cannot cast 'dextremum' to 'MqlZigZag' AdvancedZigZag. mqh 79 17
cannot be read