//+------------------------------------------------------------------+
//|                                             Channel-Break-Up.mq4 |
//+------------------------------------------------------------------+
#property copyright "accrete"

#property indicator_chart_window
extern string LineName="PriceAlert_Previous_Low";
extern color LineColor=Red; 
extern int LineStyle=STYLE_SOLID;
extern int LineWidth=2;
extern int AlertPipRange=1;
extern string AlertWav="price-alertPL.wav";

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();

      ObjectCreate(LineName, OBJ_HLINE, 0, 0, Bid);
      ObjectSet(LineName, OBJPROP_STYLE, LineStyle);
      ObjectSet(LineName, OBJPROP_COLOR, LineColor);
      ObjectSet(LineName, OBJPROP_WIDTH, LineWidth);
        
      double val =  ObjectGet( LineName, OBJPROP_PRICE1);
      if (Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val) PlaySound(AlertWav);

//----
//----
   return(0);
  }
//+------------------------------------------------------------------+