Discussion of article "The ZigZag Indicator: Fresh Approach and New Solutions" - page 2

 
launic:

Formar o seu editor de ir verificar onde os indicadores são realmente armazenados

1. botão direito do mouse clique no arquivo de origem indicador

2. À esquerda, clique em Propriedades 

 

 3. Selecione a cópia valor Localização e colar na barra de endereços do Windows Explorer

 

Very Thanks Sir!

Now is working correct!

 

 
Total newbie question but how can I use automate this EA to open positions based on the indicator???
 

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.


 

Hi,

Can you please correct the source code and upload again?

I tried to compile and it showed 30 errors!

Thanks

 
there are errors on this code how do we sort this out thanks for such a brilliant ideathere are errors on the code anyway you can assist with this 
 

In order to fix   MqlZigZag error change the file advancedzigzag.mqh as show below, the right file is attached.



     MqlZigZag Nzz;

     Nzz.price = zz[i].value;

     Nzz.t = zz[i].time;

      if(zz[i].type>0)

        {

         zzH[h]=Nzz;

         h++;

        }

      else

        {

         zzL[l]=Nzz;

         l++;

        }
Files:
 
Livio Alves #:

In order to fix   MqlZigZag error change the file advancedzigzag.mqh as show below, the right file is attached.



Thank you for the quick fix, Livio Alves.

@ Sergey Pavlov, you have opened up another dimension of coding to me. Thank you to the extent of that dimension!

Sergey Pavlov
  • 2023.10.02
  • www.mql5.com
Trader's profile
Reason: