how to keep saving an indicator value in mql4 - page 2

 
KIOS #:

Please find the attached Screen shot I want to keep these values forever, however the chart is moving 

There's some meaning lost in the translator i think .

What i understand is you want to keep scanning but keep some zigzag points not all .

The question is to keep 1 zig zag point , the criteria is related to the surrounding zig zag points or only other factors ?

If it is, then you will need to keep a linear list of the zigzags and compare every new one within that list to what is before it (or after it if you are going further back)

 
Lorentzos Roussos #:

There's some meaning lost in the translator i think .

What i understand is you want to keep scanning but keep some zigzag points not all .

The question is to keep 1 zig zag point , the criteria is related to the surrounding zig zag points or only other factors ?

If it is, then you will need to keep a linear list of the zigzags and compare every new one within that list to what is before it (or after it if you are going further back

Thanks you Lorentzos

You got my point. when some conditions  are coming out, I need to keep these values to use them in trading.

 
KIOS #:

Thanks you Lorentzos

You got my point. when some conditions  are coming out, I need to keep these values to use them in trading.

Yeah , why 6 though ? ([6]) why do you need 6 ? is it a pattern ? need a bit more info 

 
Lorentzos Roussos #:

Yeah , why 6 though ? ([6]) why do you need 6 ? is it a pattern ? need a bit more info 

yes it's a pattern

 
Could anyone help me please
 
KIOS #:

I have deleted the new topic that you have started re getting values for the zigzag.

Please continue your discussion here and not start new topics with the same subject matter.

 
KIOS #:
Could anyone help me please

i have an hour to kill until the ⚽️.

So if there is a linear list of zigzags will you be able to search in them and extract your pattern ? since you don't wish to reveal the pattern (so its a pattern about size of wave or zigzag higher / lower than other zigzag )? 

 
Lorentzos Roussos #:

i have an hour to kill until the ⚽️.

So if there is a linear list of zigzags will you be able to search in them and extract your pattern ? since you don't wish to reveal the pattern (so its a pattern about size of wave or zigzag higher / lower than other zigzag )? 

Thanks for reply 

There is no list for values I want the EA to check the values of zigzag for example( two top pattern )  is complete on the chart, I want it to keep these values and don't check any more for new patterns unless another condition is shown on the chart

 
KIOS #:

Thanks for reply 

There is no list for values I want the EA to check the values of zigzag for example( two top pattern )  is complete on the chart, I want it to keep these values and don't check any more for new patterns unless another condition is shown on the chart

void OnTick()
  {
//---
double arr[6]={0.0,0.0,0.0,0.0,0.0,0.0};
      for (int i = 0;i<1000;i++)
      {
      
      double ZigZag = iCustom(_Symbol,PERIOD_CURRENT,"ZigZag",0,i);
        if(ZigZag != EMPTY_VALUE && ZigZag != 0)
        {
        if (arr[0] == 0.0)
        {
        arr[0]=ZigZag;
        }
         else if (arr[1] == 0.0)
          {
           arr[1] = ZigZag;
          }
           else if (arr[2] == 0.0)
           {
            arr[2] = ZigZag;
           }
            else if (arr[3] == 0.0)
            {
             arr[3] = ZigZag;
            }
             else if (arr[4] == 0.0)
             {
              arr[4] = ZigZag;
             }
              else if (arr[5] == 0.0)
               {
                arr[5] = ZigZag;
               break;
               }
      
         }
       }
 
  
//Comment ("\narr[0]: ",DoubleToString(arr[0],4),
        //  "\narr[1]: ",DoubleToString(arr[1],4),
        //  "\narr[2]: ",DoubleToString(arr[2],4),
        //  "\narr[3]: ",DoubleToString(arr[3],4),
        //  "\narr[4]: ",DoubleToString(arr[4],4));
           
           
           double L0 = 0 , L1 = 0, L2=0, L3=0;
          
           if(arr[2]<arr[3] &&Close[1]<arr[2])
           {
           L1 = L1 + arr[1];
           L2 = L2 + arr[2];
           L3 = L3 + arr[3];
           
           Comment("\n",L1,"\n",L2,"\n",L3);
         
           }
           
            

            }
       
//+------------------------------------------------------------------+
 
KIOS #:

For L1 & L2 & L3


 I want the EA to keep these values and doesn't check for any values unless Close[1] is not break L3

Reason: