//+------------------------------------------------------------------+
//|                                                     n-svecha.mq4 |
//+------------------------------------------------------------------+
#property copyright "Copyright � 2010, STARIGIN KONSTANTIN panelektrik@yandex.ru"
#property link      "http://pan-elektrik.inmarket.biz"
#property indicator_chart_window

 extern int nUP =50;
 extern int nDW =50; 
//------------------------------------------------------------------ SetText
void SetText(string name,string text,datetime dt,double pr,color clr,int fontsize,string font){ObjectCreate(name,OBJ_TEXT,0,0,0);
 ObjectSet(name,OBJPROP_COLOR,clr);ObjectSetText(name,text,fontsize,font,clr); ObjectSet(name,OBJPROP_TIME1,dt);ObjectSet(name,OBJPROP_PRICE1,pr);}
//------------------------------------------------------------------
int start()
 {static int time ;if(Time[0] == time)return(0);time=Time[0];
//+-------------------
 for(int i = Bars; i > 0; i--)
 {if(Close[i]-Open[i]>=nUP*Point)SetText("nUP"+i,"h",Time[i],Close[i]-(Close[i]-Open[i])/2,DodgerBlue,16,"Wingdings 3"); 
 if(Open[i]-Close[i]>=nDW*Point)SetText("nDW"+i,"i",Time[i],Close[i]+(Open[i]-Close[i])/2,OrangeRed,16,"Wingdings 3");}
//+------------------- 
 if(Close[1]-Open[1]>=nUP*Point)PlaySound("Wait.wav");
 if(Open[1]-Close[1]>=nDW*Point)PlaySound("Wait.wav");}
//+------------------------------------------------------------------+
void deinit(){for(int i=Bars;i>=0;i--){ObjectDelete("nUP"+i);ObjectDelete("nDW"+i);}}
//+------------------------------------------------------------------+