#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, 2); SetIndexArrow(0,233); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID, 2); 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 i; bool up1,up2,down1,down2; for(i=Bars-1;i>=0;i--) { ExtMapBuffer1[i] = 0; ExtMapBuffer2[i] = 0; double MeanYellow = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 0,i); double High1Lime = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 1,i); double Low1Lime = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 2,i); double High2Orange = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 3,i); double Low2Orange = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 4,i); double High3Red = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 5,i); double Low3Red = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 6,i); double MeanYellow2 = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 0,i+1); double High1Lime2 = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 1,i+1); double Low1Lime2 = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 2,i+1); double High2Orange2 = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 3,i+1); double Low2Orange2 = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 4,i+1); double High3Red2 = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 5,i+1); double Low3Red2 = iCustom(NULL, 0, "Past Regression Deviated",0, 55,0.809, 1.618,2.618, 6,i+1); double cci=iCCI(NULL,0,55,PRICE_CLOSE,i); static int arrow; if ((Close[i]>Low2Orange && Close[i+1]-100) {arrow=1; ExtMapBuffer1[i] = Low[i] - 15 * Point; } if ((Close[i]High2Orange2) && cci<100) {arrow=-1; ExtMapBuffer2[i] = High[i] + 15 * Point; } } if (AudioAlert) { static int arrow2; if ((ExtMapBuffer1[1]!=0 && ExtMapBuffer1[2]==0) && arrow2!=1) {arrow2=1; Alert ("PRD BUY signal on ",Symbol()," ",Period()," Minute Chart");} if ((ExtMapBuffer2[1]!=0 && ExtMapBuffer2[2]==0) && arrow2!=-1) {arrow2=-1; Alert ("PRD SELL signal on ",Symbol()," ",Period()," Minute Chart");} } if (EmailAlert) { static int arrow3; if ((ExtMapBuffer1[1]!=0 && ExtMapBuffer1[2]==0) && arrow3!=1) {arrow3=1; SendMail ("PRD BUY on "+Symbol()+" "+Period()+" Minute Chart","");} if ((ExtMapBuffer2[1]!=0 && ExtMapBuffer2[2]==0) && arrow3!=-1) {arrow3=-1; SendMail ("PRD SELL on "+Symbol()+" "+Period()+" Minute Chart","");} } }