English

## Double Max and Double Min:

 34 texcs 2016.08.24 19:09    Hello everyone, I have the following function that gives me a allert when when you come to form the double up and double min: ```void DoppioMinMax(int DistanzaFrecciaRib=5, int DistanzaFrecciaRia=5, ) {   int dpmindmax =0;   int i, countDmax=0, countdpmin=0;    for (i = Bars-10; i >= 0; i--)     {          // CercoDoppioMassimo      if (Close[i+2]>Open[i+2] && Close[i+1]=(Open[i+1]-Margine*Poin)){          DoppioMassimo[i+1]=High[i+1]+DistanzaFrecciaRib*Poin;          dpmindmax=1;          countDmax++;          //Alert("Sell su:"+Symbol()+" a TF "+IntegerToString(Period(),0,0));          if (NuovaCandela()==True)             Alert("Sell su:"+Symbol()+" a TF "+IntegerToString(Period(),0,0));             }           if (Close[i+2]Open[i+1] && Close[i+2]<=(Open[i+1]+Margine*Poin) && Close[i+2]>=(Open[i+1]-Margine*Poin)){          DoppioMinimo[i+1]=Low[i+1]-DistanzaFrecciaRia*Poin;          dpmindmax=2;          //Alert("Buy su:"+Symbol()+" a TF "+IntegerToString(Period(),0,0));          countdpmin++;          if (NuovaCandela()==True)              Alert("Buy su:"+Symbol()+" a TF "+IntegerToString(Period(),0,0));                                        }                   Comment("doppio max:"+ countDmax +"\ndoppio min:" +countdpmin+"\ndoppiominmax:" +dpmindmax);        }                                          } ``` The problem is that the function I from the allert each time you that closes a bar even if it is not a double dip or a double top to me would serve the allert only when there is a double min or a double top, you know help me?
13000
WHRoeder 2016.08.25 15:44 #

 texcs: I get the alert each time a bar closes Then drop your loop and only look at bars 1 and 2. Your text is almost incomprehensible. If you are using mechanical translation, you must use simple sentence structure.
34
texcs 2016.08.25 19:33 #

WHRoeder:
 texcs: I get the alert each time a bar closes Then drop your loop and only look at bars 1 and 2. Your text is almost incomprehensible. If you are using mechanical translation, you must use simple sentence structure.

The problem with this function is that it gives me the alert signal each time you close a candel and it opens a new one;
Instead of this I need to have the alert signal every time it forms a double minus or a double maxium, only in these two cases.
1215
FMIC 2016.08.25 19:40 #

texcs:

The problem with this function is that it gives me the alert signal each time you close a candel and it opens a new one;
Instead of this I need to have the alert signal every time it forms a double minus or a double maxium, only in these two cases.

WHRoeder has already given you the answer (and you even quoted him), yet you did not do it!

WHRoeder:
 texcs: I get the alert each time a bar closes Then drop your loop and only look at bars 1 and 2.