Got a problem with the alerts on that code.., can someone help me and make the alerts not to freeze the mt4, thanks!
Inserted Code
#property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 White #property indicator_width1 1 #property indicator_color2 White #property indicator_width2 1 int barsLeftOfCurrent =25; int barsRightOfCurrent = 25; int Arrowup=110; int Arrowdown=110; bool Five_digit_broker=true; int distance = 10; int Countbars=2500; double b1[]; double b2[]; int init() { SetIndexStyle(0,DRAW_ARROW); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,Arrowup); SetIndexArrow(0,Arrowdown); SetIndexBuffer(0,b1); SetIndexBuffer(1,b2); return(0); } int start() { int k,i,j,limit,hhb,llb,limit2,Distancefin; int counted_bars = IndicatorCounted(); if (counted_bars < 0) return (-1); if (counted_bars> 0) counted_bars--; if (i> limit2) limit2= i; if (limit2 < Countbars - 1) limit = Countbars - 1; for (i=limit;i>=0;i--) { b1[i]=0; b2[i]=0; } if (Five_digit_broker==true){ Distancefin=distance*0.1; } else{ Distancefin=distance; } for (i=limit;i>=1;i--) { hhb = iHighest(0,0,MODE_CLOSE,barsLeftOfCurrent + 0 + barsRightOfCurrent,i - barsRightOfCurrent); llb = iLowest(0,0,MODE_CLOSE,barsLeftOfCurrent + 0 + barsRightOfCurrent,i - barsRightOfCurrent); if (i==hhb) { b1[i]=High[hhb]+Distancefin*Point; //PlaySound("news.wav"); Alert("["+Symbol()+"] [M"+Period()+"] #PUT"); } if (i==llb) { b2[i]=Low[llb]-Distancefin*Point; //PlaySound("news.wav"); Alert("["+Symbol()+"] [M"+Period()+"] #CALL"); } } if (i> limit2) limit2= i; return(0); }