ALERT PROBLEM PLZZ HELP ME

 

HI DEAR,

I AM FACING ALERT PROBLEM,IT IS GIVING CONTINUE ALERTS(NON STOP),

I NEED IT ONLY ONE TIME ALERT WHEN ARROW APPEARS IN ALLTIME FRAME,

PLZZ CORRECT MY CODE,

HELP ME PLZZ

//+------------------------------------------------------------------+
//|                                                       222222.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkBlue
#property indicator_color2 Red
#property indicator_width1 3
#property indicator_width2 3

extern int       FastEMA = 12;
extern int       SlowEMA = 26;
extern int       SignalSMA = 9;
extern int       ARROWWIDTH = 3;

double buy[];
double sell[];
double m;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW,EMPTY,4,DarkBlue);
   SetIndexArrow(0,217);
   SetIndexBuffer(0,buy);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW,EMPTY,4,Red);
   SetIndexArrow(1,218);
   SetIndexBuffer(1,sell);
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
 
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
  double Osma0,Osma1;
  for (int i = Bars - 1; i >= 0; i --)
  {
    Osma0 = iOsMA(NULL , 0 , FastEMA , SlowEMA ,SignalSMA , PRICE_WEIGHTED ,i);
    Osma1 = iOsMA(NULL , 0 , FastEMA , SlowEMA ,SignalSMA , PRICE_WEIGHTED ,i+1);
    buy [i] = 0; sell [i] = 0;
    
     if (Osma0 > 0 && Osma1 < 0)
    {
      buy [i] = High [i];
    }

    if (Osma0 < 0 && Osma1 > 0)
    {
      sell [i] = Low [i];
    }     
  }
  {
  if (SYMBOL_ARROWDOWN) Alert ("SELL! ",Symbol()," TF M",Period()," @ ",Ask); 
  if (SYMBOL_ARROWUP) Alert ("BUY! ",Symbol()," TF M",Period()," @ ",Bid); 
  }
  
return(0);
}
 
//+------------------------------------------------------------------+
 
Use a bool to remember you did the Alert, on the next bar reset the bool so you can do another Alert . . .
 
makkala: PLZZ CORRECT MY CODE,
  1. it says
    Copyright 2012, MetaQuotes Software Corp.
    So I doubt it's YOUR CODE

  2. WHY ARE YOU SHOUTING AT US?
  3. What you posted won't even compile, no such variable SYMBOL_ARROWDOWN

  4. Where is your attempt? Since there are no slaves here, there are only two choices: learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
Reason: