STOCHASTIC_X8

 

Can anyone add an alert to this indicator when all are over 85 and less than 15 ?

Files:
 

Hope the following will help:


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   if(Bars<=Stoch_D) return(0);
   int ExtCountedBars=IndicatorCounted();
//---- check for possible errors
   if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
   if (ExtCountedBars>0) ExtCountedBars--;
//----
   for(int i=0;i<Bars-Stoch_D;i++)
      {
       Buf0[i] = iStochastic(NULL,0,D10,K10,S10,3,1,0,i);
       Buf1[i] = iStochastic(NULL,0,D11,K11,S11,3,1,0,i);
       Buf2[i] = iStochastic(NULL,0,D12,K12,S12,3,1,0,i);
       Buf3[i] = iStochastic(NULL,0,D13,K13,S13,3,1,0,i);
       Buf4[i] = iStochastic(NULL,0,D14,K14,S14,3,1,0,i);
       Buf5[i] = iStochastic(NULL,0,D15,K15,S15,3,1,0,i);
       Buf6[i] = iStochastic(NULL,0,D16,K16,S16,3,1,0,i);
       Buf7[i] = iStochastic(NULL,0,D17,K17,S17,3,1,0,i);
      
      }
//---- alerts popups
   if(Buf0[0]>85||Buf0[0]<15)Alert("Overbougt/Oversold");
   if(Buf1[0]>85||Buf1[0]<15)Alert("Overbougt/Oversold");
   if(Buf2[0]>85||Buf2[0]<15)Alert("Overbougt/Oversold");
   if(Buf3[0]>85||Buf3[0]<15)Alert("Overbougt/Oversold");
   if(Buf4[0]>85||Buf4[0]<15)Alert("Overbougt/Oversold");
   if(Buf5[0]>85||Buf5[0]<15)Alert("Overbougt/Oversold");
   if(Buf6[0]>85||Buf6[0]<15)Alert("Overbougt/Oversold");
   if(Buf7[0]>85||Buf7[0]<15)Alert("Overbougt/Oversold");
//----
   return(0);
  }


Note that paid developer will give you the full support.




https://www.mql5.com/en/job

Freelance service at MQL5.com
Freelance service at MQL5.com
  • www.mql5.com
Orders for the development of automated trading programs
 
Mohammad Soubra:

Hope the following will help:



Note that paid developer will give you the full support.




https://www.mql5.com/en/job

Thank you but it does not work as it should, it has to give the alert only when all at the same time are over 85 or under 15
 

int start()

  {

   if(Bars<=Stoch_D) return(0);

   int ExtCountedBars=IndicatorCounted();

//---- check for possible errors

   if (ExtCountedBars<0) return(-1);

//---- last counted bar will be recounted

   if (ExtCountedBars>0) ExtCountedBars--;

//----

   for(int i=0;i<Bars-Stoch_D;i++)

      {

       Buf0[i] = iStochastic(NULL,0,D10,K10,S10,3,1,0,i);

       Buf1[i] = iStochastic(NULL,0,D11,K11,S11,3,1,0,i);

       Buf2[i] = iStochastic(NULL,0,D12,K12,S12,3,1,0,i);

       Buf3[i] = iStochastic(NULL,0,D13,K13,S13,3,1,0,i);

       Buf4[i] = iStochastic(NULL,0,D14,K14,S14,3,1,0,i);

       Buf5[i] = iStochastic(NULL,0,D15,K15,S15,3,1,0,i);

       Buf6[i] = iStochastic(NULL,0,D16,K16,S16,3,1,0,i);

       Buf7[i] = iStochastic(NULL,0,D17,K17,S17,3,1,0,i);

      

      }

//---- alerts popups

   if (Buf0[0]>85 && Buf1[1]>85 &&  Buf2[2]>85 &&  Buf3[3]>85 && Buf4[4]>85 &&  Buf5[5]>85 && Buf6[6]>85 &&  Buf7[7]>85 )  Alert("Overbougt");

   if (Buf0[0]<15 && Buf1[1]<15 &&  Buf2[2]<15 &&  Buf3[3]<15 && Buf4[4]<15 &&  Buf5[5]<15 && Buf6[6]<15 &&  Buf7[7]<15 )  Alert("Oversold");



 

   return(0);

  }

//+------------------------------------------------------------------+

string Ds_0(double DOUBLE) {return(DoubleToStr(DOUBLE,0));}

//+------------------------------------------------------------------+

             




So it works as it should but how to do it to show the popup only once ?






 
Dan Abuzan:

.......

   if (Buf0[0]>85 && Buf1[1]>85 &&  Buf2[2]>85 &&  Buf3[3]>85 && Buf4[4]>85 &&  Buf5[5]>85 && Buf6[6]>85 &&  Buf7[7]>85 )  Alert("Overbougt");

   if (Buf0[0]<15 && Buf1[1]<15 &&  Buf2[2]<15 &&  Buf3[3]<15 && Buf4[4]<15 &&  Buf5[5]<15 && Buf6[6]<15 &&  Buf7[7]<15 )  Alert("Oversold");



 

   return(0);

  }

//+------------------------------------------------------------------+

string Ds_0(double DOUBLE) {return(DoubleToStr(DOUBLE,0));}

//+------------------------------------------------------------------+

             




So it works as it should but how to do it to show the popup only once ?







the best way is to open a job and hire a developer for top quality