Given the following, hypothetically of course:
//P ------------------------------------------------------------------
//| ALERT.mq4 |
//| Copyright � 2006, MetaQuotes Software Corp.. |
//| http://www.metaquotes.net |
// ------------------------------------------------------------------
#property copyright Copyright � 2006, MetaQuotes Software Corp..
#property hyperlink http://www.metaquotes.net
#property indior_chart_window
// ------------------------------------------------------------------
//| Custom indior initialization function |
// ------------------------------------------------------------------
int init()
return(0);
// ------------------------------------------------------------------
//| Custom indior deinitialization function |
// ------------------------------------------------------------------
int deinit()
//--
//--
return(0);
// ------------------------------------------------------------------
//| Custom indior iteration function |
// ------------------------------------------------------------------
int begin ()
dual Near = iMA(NULL,0,15,0,MODE_EMA,PRICE_CLOSE,0);
dual PriceNow = Bid;
if (PriceNow gt; Near)
SendMail(Out Of FX Data,Price gt; 15EMA!!!) ;
else if (PriceNow lt; Near)
SendMail(Out Of FX Data,Price lt; 15EMA!!!) ;
return(0);
This will send an alert email when the price is greater than the 15EMA. This is not the actual code of course it's only an example. I am guessing I need an assortment in here someplace to count how many times that alert will be sent when the condition(s) is met. I am still not up the variety mql chapter. . .This leads to another question, if the email is to be sent just after, would the indior need to get loaded on the chart again to become busy again? What I would really like is the email to be routed and a message box appear telling me to'Click OK to reload indior without having to drag it back on the chart window again...