Download MetaTrader 5
To add comments, please log in or register
Have you installed MetaTrader 5? Find out more about it!
texoro
113
texoro 2016.08.24 17: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] && Close[i+2]<=(Open[i+1]+Margine*Poin) && Close[i+2]>=(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+2] && Close[i+1]>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?

whroeder1
13653
whroeder1 2016.08.25 13:44  
texcs: I get the alert each time a bar closes
  1. Then drop your loop and only look at bars 1 and 2.
  2. Your text is almost incomprehensible. If you are using mechanical translation, you must use simple sentence structure.
texoro
113
texoro 2016.08.25 17:33  
WHRoeder:
texcs: I get the alert each time a bar closes
  1. Then drop your loop and only look at bars 1 and 2.
  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. 
Fernando Carreiro
1571
Fernando Carreiro 2016.08.25 17: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
  1. Then drop your loop and only look at bars 1 and 2.
/
To add comments, please log in or register