//+------------------------------------------------------------------+
//|                                                     e-MSound.mq4 |
//|                                                   Melkor & KimIV |
//|                                              http://www.kimiv.ru |
//|                                                                  |
//|    14.01.2006                                                    |
//|  Двухуровневое звуковое сопровождение хода инструмента.          |
//+------------------------------------------------------------------+
#property copyright "Melkor & KimIV"
#property link      "http://www.kimiv.ru"

//------- Внешние параметры советника --------------------------------
extern string _P_Expert = "---------- Параметры советника";
extern int    MoveLevel_1 = 5;
extern string Sound_1_up  = "expert";
extern string Sound_1_dn  = "ok";
extern int    MoveLevel_2 = 15;
extern string Sound_2_up  = "alert2";
extern string Sound_2_dn  = "alert";

//---- Глобальные переменные советника -------------------------------
double prevBid1, prevBid2;

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
void start() {
  if (prevBid1!=0) {
    if (Bid-prevBid1>MoveLevel_1*Point) {
      PlaySound(Sound_1_up); prevBid1=Bid;
    }
    if (prevBid1-Bid>MoveLevel_1*Point) {
      PlaySound(Sound_1_dn); prevBid1=Bid;
    }
  } else prevBid1=Bid;

  if (prevBid2!=0) {
    if (Bid-prevBid2>MoveLevel_2*Point) {
      PlaySound(Sound_2_up); prevBid2=Bid;
    }
    if (prevBid2-Bid>MoveLevel_2*Point) {
      PlaySound(Sound_2_dn); prevBid2=Bid;
    }
  } else prevBid2=Bid;
}
//+------------------------------------------------------------------+

