Can Some Help me with adding alert to this arrow indicator for metatrader4 - page 2

 
please help add alerts to this arrow indicator
Files:
KM-SA.mq4  3 kb
 

I have coded a custom indicator based on Ichimoku and added an alert for buy and/or sell conditions. However the alert loops nonstop. Can someone help me on anything I have missed.

 if(IsStopped())

      return(0);

      for(int i=startBar; i<rates_total && !IsStopped();i++)

   {  

       ExtChikouBuffer[i] = EMPTY_VALUE; 

       }  

       buycondition = (ExtTenkanBuffer[i]>ExtKijunBuffer[i] && Bid>ExtTenkanBuffer[i]);

       sellcondition = (ExtTenkanBuffer[i]<ExtKijunBuffer[i] && Ask<ExtTenkanBuffer[i] );

 } 

       if(buycondition)

          {     if (EnableNativeAlerts) Alert("BUY");

                if (EnableSoundAlerts) PlaySound(SoundFileName);

                LastAlertTime=iTime(Symbol(),Period(),3);

                LastAlertDirection = 1;

                

      }else

       if (sellcondition)   

       

       { if (EnableNativeAlerts) Alert("SELL");

                if (EnableSoundAlerts) PlaySound(SoundFileName);

               LastAlertTime=iTime(Symbol(),Period(),3);

              

                LastAlertDirection =-1;

        }

    


//--- return value of prev_calculated for next call

   return(rates_total);

  }

 
51207935:

I have coded a custom indicator based on Ichimoku and added an alert for buy and/or sell conditions. However the alert loops nonstop. Can someone help me on anything I have missed.

Please edit your post and

use the code button (Alt+S) when pasting code

 
51207935: However the alert loops nonstop. C
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  2. Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.

  3.       for(int i=startBar; i<rates_total && !IsStopped();i++){  
             ExtChikouBuffer[i] = EMPTY_VALUE; 
           }  
    
           buycondition = (ExtTenkanBuffer[i]>ExtKijunBuffer[i] && Bid>ExtTenkanBuffer[i]);
    You have exited the loop, then you use the index (array[rates_total]), you are reading garbage. You would know that if you had used strict.

    Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.

  4. You are alerting on a signal. Act on a change of signal.
              MQL4 (in Strategy Tester) - double testing of entry conditions - MQL5 programming forum #1 2017.12.12

 
Hello I need adding alert to this indicator when the signal is shown thanks
Files:
 
paypal Sip: Hello I need adding alert to this indicator when the signal is shown thanks
That ZIP archive only has the executable and it is for MT5, not MT4. You can only change it with the source code! Contact the author/creator!
Reason: