Indicators with alerts/signal - page 1583

 

Hi mladen,


Can you please add aerts to this indicator which shows previous day high and low. It should alert only once when price crosses high or low for first time .

Or please provide me if any such indicator is already programmed. 

Thanks for all your excellent work in this forum.

<ex4 file deleted>

 

Hi everybody,

Can you please add green and red dots when the attached indicator gives signal.

It is Rsi filter.

Please add option pf selecting the colour, size and distance of the dots from candles also.

Thanks.

Files:
 

Two Rivers Alert - indicator for MetaTrader 5

Two Rivers Alert - indicator for MetaTrader 5

Two Rivers uses two iMA (Moving Average, MA) indicators in its calculations - one is calculated at High prices, and the second at Low prices. We will call these indicators iMA High and iMA Low, respectively.

The signal comes only if the minimum bar price is lower than the iMA Low indicator, and the maximum bar price is higher than the iMA High indicator:

  • bullish bar - an arrow is drawn in the indicator buffer " Up "
  • bearish bar - an arrow is drawn in the indicator buffer " Down "
Two Rivers Alert
Two Rivers Alert
  • www.mql5.com
Two Rivers использует в своих расчётах два индикатора iMA (Moving Average, MA) - один рассчитывается по ценам High, а второй по ценам Low. Назовём эти индикаторы iMA High и iMA Low соответственно.. Входные параметры, одинаковые для обоих индикаторов: MA's: averaging period - период усреднения обоих  MA's: horizontal shift - смещение...
 
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_width1 1
#property indicator_color2 Red
#property indicator_width2 1
#define  SH_BUY   1
#define  SH_SELL  -1


extern int           AllBars=0;     //How many bars should be counted. 0 - all the bars.
extern int           Otstup=30;     //Step back.
extern int           Per=9;         //Period.
extern bool          UseSoundBuy=true;
extern bool          AlertSoundBuy=true;
extern bool          UseSoundSell=true;
extern bool          AlertSoundSell=true;
extern string        SoundFileBuy ="tada.wav";
extern string        SoundFileSell="email.wav";
extern bool          SendMailPossible = false;
extern int           SIGNAL_BAR= 1;

bool SoundBuy  = False;
bool SoundSell = False;


int            SH,NB,i,UD,x=0,y=0,a=0,b=0;
double         R,SHMax,SHMin;
double         BufD[];
double         BufU[];
//+------------------------------------------------------------------+
//|                                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexBuffer(0,BufU);
   SetIndexBuffer(1,BufD);
   PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_ARROW);
   PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_ARROW);
   PlotIndexSetInteger(0,PLOT_ARROW,217);
   PlotIndexSetInteger(1,PLOT_ARROW,218);
      return(INIT_SUCCEEDED);
   

   return(0);
  }
//+------------------------------------------------------------------+
//|                                         |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,      
                const int prev_calculated,  
                const datetime &time[],     // Time
                const double &open[],       // Open
                const double &high[],       // High
                const double &low[],        // Low
                const double &close[],      // Close
                const long &tick_volume[],  // Tick Volume
                const long &volume[],       // Real Volume
                const int &spread[]         // Spread
               )
  {
   int limit;
   limit = prev_calculated>0? rates_total - 2 : MathMax(Per,10);
   for(SH=limit; SH<=rates_total; SH++) 
     {
      R=0;
      for(i=SH; i>SH-10; i--)

         R+= (high[i]-low[i]) * (10-(i-SH));

      R/=55;

      SHMax = high[SH];
      SHMin = low[SH];
      for(i=SH-1; i>SH-Per; i--)
        {
         if(high[i] > SHMax)
            SHMax = high[i];
         if(low[i] < SHMin)
            SHMin = low[i];
        }


      if(Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY)
        {
         BufD[SH]=High[SH]+R*0.5;
         if(Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY)
         UD=SH_BUY;
          if(Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY)
         y=0;
         x=x+1;



        }
      //*else


      if(Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL)
        {
         BufU[SH]=Low[SH]-R*0.5;
         if(Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL)
         UD=SH_SELL;
          if(Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL)
         x=0;
         y=y+1;

        }
     }

//----------------------- ALERT ON UP / DOWN DOT


//string AlertComment;
   string  message  =  StringConcatenate(" Buy Signal (", Symbol(), ", ", Period(), ")  -  BUY!!!","-",TimeToStr(TimeLocal(),TIME_SECONDS));
   string  message2 =  StringConcatenate(" Sell Signal (", Symbol(), ", ", Period(), ")  -  SELL!!!","-",TimeToStr(TimeLocal(),TIME_SECONDS));

   if(BufU[rates_total - SIGNAL_BAR - 1] != EMPTY_VALUE && BufU[rates_total - SIGNAL_BAR - 1] != 0 && SoundBuy)
     {
      SoundBuy = false;
      if(UseSoundBuy)
         PlaySound(SoundFileBuy);
      if(AlertSoundBuy)
        {
         Alert(message);
         if(SendMailPossible)
            SendMail(Symbol(),message);
        }
     }
   if(!SoundBuy && (BufU[rates_total - SIGNAL_BAR - 1] == EMPTY_VALUE || BufU[rates_total - SIGNAL_BAR - 1] == 0))
      SoundBuy = true;


   if(BufD[rates_total - SIGNAL_BAR - 1] != EMPTY_VALUE && BufD[rates_total - SIGNAL_BAR - 1] != 0 && SoundSell)
     {
      SoundSell = false;
      if(UseSoundSell)
         PlaySound(SoundFileSell);
      if(AlertSoundSell)
        {
         Alert(message2);
         if(SendMailPossible)
            SendMail(Symbol(),message2);
        }
     }
   if(!SoundSell && (BufD[rates_total - SIGNAL_BAR - 1] == EMPTY_VALUE || BufD[rates_total - SIGNAL_BAR - 1] == 0))
      SoundSell = true;

   return(rates_total);
  }
//+------------------------------------------------------------------+

Dear Coders,


I have made some changes in code, not showing any errors, compiled without errors.

But arrows not showing on chart.  please rectify the code

 
ECURRENCY TEAM:

But arrows not showing on chart.  please rectify the code

#property indicator_chart_window
#property indicator_buffers 2
/*
#property indicator_color1 Blue
#property indicator_width1 1
#property indicator_color2 Red
#property indicator_width2 1*/
//--- plot Arrow 1
#property indicator_label1  "Arrow 1"
#property indicator_type1   DRAW_ARROW
#property indicator_color1  clrBlue
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- plot Arrow 2
#property indicator_label2  "Arrow 2"
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrRed
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1

#define  SH_BUY   1
#define  SH_SELL  -1


extern int           AllBars=0;     //How many bars should be counted. 0 - all the bars.
extern int           Otstup=30;     //Step back.
extern int           Per=9;         //Period.
extern bool          UseSoundBuy=true;
extern bool          AlertSoundBuy=true;
extern bool          UseSoundSell=true;
extern bool          AlertSoundSell=true;
extern string        SoundFileBuy ="tada.wav";
extern string        SoundFileSell="email.wav";
extern bool          SendMailPossible = false;
extern int           SIGNAL_BAR= 1;

bool SoundBuy  = False;
bool SoundSell = False;


int            SH,NB,i,UD,x=0,y=0,a=0,b=0;
double         R,SHMax,SHMin;
double         BufD[];
double         BufU[];
//+------------------------------------------------------------------+
//|                                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexBuffer(0,BufU);
   SetIndexBuffer(1,BufD);
   SetIndexArrow(0, 217);
   SetIndexArrow(1, 218);
   /*PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_ARROW);
   PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_ARROW);
   PlotIndexSetInteger(0,PLOT_ARROW,217);
   PlotIndexSetInteger(1,PLOT_ARROW,218);*/
      return(INIT_SUCCEEDED);
   

   //return(0);
  }
 
Thank you... thank you
 

Hi Everyone

Someone know this indicator send me

 

Hi Everyone

Someone know this indicator send me

 

 

can someone make this indicator that arrow on chart open on the same candle?

thank you

 
Sergey Golubev:

Multi Pair Pivot Point Scanner Alerts 1.9 - indicator for MetaTrader 5


please sir no version for mt4

thanks

Reason: