#property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Lime #property indicator_color2 Red extern bool EmailAlert=false; extern bool AudioAlert=false; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID, 4); SetIndexArrow(0,233); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID, 4); SetIndexArrow(1,234); SetIndexBuffer(1,ExtMapBuffer2); SetIndexEmptyValue(1,0.0); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int shift; bool up1,up2,down1,down2; for(shift=Bars-1;shift>=0;shift--) { ExtMapBuffer1[shift] = 0; ExtMapBuffer2[shift] = 0; double lsma1=iCustom(NULL,0,"LSMA_in_Color_2",34,500,0,shift); double lsma2=iCustom(NULL,0,"LSMA_in_Color_2",34,500,1,shift); double lsma3=iCustom(NULL,0,"LSMA_in_Color_2",34,500,2,shift); double trendpos=iCustom(NULL,0,"TrendLinearReg",34,500,0,shift); double trendneg=iCustom(NULL,0,"TrendLinearReg",34,500,1,shift); static int arrow; if (lsma2!=0 && lsma3==EMPTY_VALUE && lsma1==EMPTY_VALUE && trendpos!=EMPTY_VALUE && arrow!=1 ) {arrow=1; ExtMapBuffer1[shift] = Low[shift] - 10 * Point; } if (lsma1!=0 && lsma3==EMPTY_VALUE && lsma2==EMPTY_VALUE && trendneg!=EMPTY_VALUE && arrow!=-1) {arrow=-1; ExtMapBuffer2[shift] = High[shift] + 10 * Point; } } if (AudioAlert) { static int audio; if ((ExtMapBuffer1[1]!=0 && ExtMapBuffer1[2]==0) && audio!=1) {audio=1; Alert ("Felix BUY on ",Symbol()," ",Period()," Minute Chart");} if ((ExtMapBuffer2[1]!=0 && ExtMapBuffer2[2]==0) && audio!=-1) {audio=-1; Alert ("Felix SELL on ",Symbol()," ",Period()," Minute Chart");} } if (EmailAlert) { static int email; if ((ExtMapBuffer1[1]!=0 && ExtMapBuffer1[2]==0) && email!=1) {email=1; SendMail ("Felix BUY on "+Symbol()+" "+Period()+" Minute Chart","");} if ((ExtMapBuffer2[1]!=0 && ExtMapBuffer2[2]==0) && email!=-1) {email=-1; SendMail ("Felix SELL on "+Symbol()+" "+Period()+" Minute Chart","");} } }