//+------------------------------------------------------------------+
//|                                                        Rails.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
extern int  dev      =  5;

datetime prevtime;

int OnInit()
  {

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   double H1=0,H2=0,L1=0,L2=0;
   
   if(Time[0] != prevtime)
   {
      H1 = High[1];
      H2 = High[2];
      L1 = Low[1];
      L2 = Low[2];
      
      if(MathAbs(H1-H2)/_Point <= dev && MathAbs(L1-L2)/_Point <= dev)
      {
         //Print(TimeToString(Time[0],TIME_DATE|TIME_MINUTES)," signal");
         Alert("Signal ", _Symbol , " ",TimeToString(Time[0],TIME_DATE|TIME_MINUTES));
      }   
      prevtime = Time[0];
   }
   
}
//+------------------------------------------------------------------+
