//+------------------------------------------------------------------+ //| qsxyj.mq4 | //| Copyright ?2006, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "WYF - Trendline break alert" #property link "http://www.metaquotes.net" #property indicator_chart_window extern bool AllowSound=1; extern bool AllowAlertWindow=0; extern int AlertInterval_Minute=15; extern int KeepText_Minute=10; extern string linename="Tr"; int PrevAlertTime = 0; int Prevtext=0; int init() { return(0); } int deinit() { Comment(" "); if(ObjectFind("tpl")==0) ObjectDelete("tpl"); return(0); } //+------------------------------------------------------------------+ int start() { int j,yjx=0; double price1,dh,dl,price0; string name1; if(AllowSound) Comment("WYF - Trendline break alert: Sound On"); else Comment("WYF - Trendline break alert: Sound Off") ; //------------find all trendlines and alert---------------------------------------------------------------------- for (j=0; jAlertInterval_Minute*60) { if (Close[1]<=price1 && Close[0]>price0) { if(AllowSound) PlaySound("alert.wav"); if(AllowAlertWindow) Alert(Symbol(),"--- UP"); // Print(Symbol(),"--- UP"); PrevAlertTime = TimeCurrent(); ObjectCreate("tpl",OBJ_LABEL,0,0,0); ObjectSet("tpl", OBJPROP_XDISTANCE,10); ObjectSet("tpl", OBJPROP_YDISTANCE,20); ObjectSet("tpl", OBJPROP_CORNER,3); ObjectSetText("tpl","This Currency Breaks UP ",16,"Times New Roman",Red); } if (Close[1]>=price1 && Close[0]KeepText_Minute*60) { if(ObjectFind("tpl")==0) ObjectDelete("tpl"); Prevtext = TimeCurrent(); } } } return(0); }