Please help me!! Add Alert to indicator

 

Hi guys, can someone help me add Alert to the indicator?

Condition: Notice appears when Momentum is in the range of 48-52.

Thank you very much.

Files:
 
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help
          urgent help.

Or pay someone. Top of every page is the link Freelance.

 
//+------------------------------------------------------------------+
//|                                             Momentum Pinboll.mq4 |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2007, Karakurt"

#property  indicator_separate_window
#property  indicator_buffers 1

#property  indicator_color1 Blue

#property  indicator_level1 70
#property  indicator_level2 30

#property  indicator_minimum   0
#property  indicator_maximum 100

//---- indicator parameters
extern int ExtPeriodRSI = 7;
extern int ExtPeriodROC = 4;

//---- indicator buffers
double BufferRSI[];
double BufferROC[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
  IndicatorBuffers( 2 );
  
  SetIndexStyle( 0, DRAW_LINE );
  SetIndexDrawBegin( 0, ExtPeriodRSI );
  IndicatorDigits( Digits + 1 );
  
  SetIndexBuffer( 0, BufferRSI );
  SetIndexBuffer( 1, BufferROC );
  
  IndicatorShortName( "Momentum Pinboll(" + ExtPeriodRSI + "," + ExtPeriodROC + ")" );
  
  return ( 0 );
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
int start()
{
  int counted_bars = IndicatorCounted();
  int iCount;
  int i;
  
  if ( counted_bars < 0 ) 
    return ( -1 );
  if ( counted_bars > 0 )
    counted_bars--;
    
  iCount = Bars - counted_bars - ExtPeriodROC;
  
  //---- Çàïîëíåíèå âñïîì.áóôåðà ROC
  for ( i = 0; i < iCount; i++ ) {
    BufferROC[i] = Close[ i ] - Close[ i + ExtPeriodROC ];
  } // for
  
  //---- Ðàñ÷¸ò RSI îò ROC
  for ( i = 0; i < iCount; i++ ) {
    BufferRSI[i] = iRSIOnArray( BufferROC, 0, ExtPeriodRSI, i );
  } // for
  
  return ( 0 );
}

Currently I am not eligible to pay, if anyone can help me for free, please help me.

I want a message to appear, with audio when the Momentum indicator has a value between 48-52.

Thank you so much.

 
  1.   int counted_bars = IndicatorCounted();
      iCount = Bars - counted_bars - ExtPeriodROC;
    After the first run, counted_bars will be zero, iCount negative, and your for loops do nothing.
              How to do your lookbacks correctly.

  2. You should stop using the old event handlers and IndicatorCounted and start using the new ones.
              Event Handling Functions - Functions - Language Basics - MQL4 Reference
              How to do your lookbacks correctly.

  3. phamtracanh: if anyone can help me for free, please help me.
    What part of "Show us your attempt (using the CODE button) and state the nature of your problem." was unclear?
Reason: