Wpr (alerts + arrows).mq4
Wpr (alerts + arrows).mq4 FOREX MetaTrader4 Indicators Download
Wpr (alerts + arrows).mq4 download link will appear after 20 seconds.
Wpr (alerts + arrows).mq4 Programming source code.
#property copyright "www.forex-station.com" #property link "www.forex-station.com" #property indicator_separate_window #property indicator_minimum -120 #property indicator_maximum 20 #property indicator_buffers 3 #property indicator_color1 clrDodgerBlue #property indicator_color2 clrBlue #property indicator_color3 clrRed #property indicator_width1 2 #property indicator_levelcolor clrSilver #property indicator_levelstyle STYLE_DOT #property strict // // // // // extern int WprPeriod = 14; // Wpr period extern int levelOs = -80; // Oversold level extern int levelOb = -20; // Overbought level extern int ArrowSize = 2; // Arrow size extern int ArrowCodeUp = 233; // Arrow code up extern int ArrowCodeDn = 234; // Arrow code down extern bool alertsOn = true; // Turn alerts on? extern bool alertsOnCurrent = false; // Alerts on still open bar? extern bool alertsMessage = true; // Alerts should show popup message? extern bool alertsSound = false; // Alerts should play a sound? extern bool alertsEmail = false; // Alerts should send email? extern bool alertsPushNotif = false; // Alerts should send notification? double wpr[],trend[],arrowu[],arrowd[]; //+------------------------------------------------------------------ //| //+------------------------------------------------------------------ // // // // // int init() { for (int i=0; i0) counted_bars--; int limit = fmin(Bars-counted_bars,Bars-1); // // // // // for(i=limit; i>=0; i--) { double hi = High[iHighest(NULL,0, MODE_HIGH,WprPeriod,i)]; double lo = Low[iLowest(NULL, 0, MODE_LOW,WprPeriod,i)]; if (hi!=lo) wpr[i] = -100*(hi-Close[i])/(hi-lo); else wpr[i] = 0; trend[i] = (i levelOb) ? 1 : (wpr[i] =0; i--) { arrowu[i] = EMPTY_VALUE; arrowd[i] = EMPTY_VALUE; if (i =0; i--) if (tf==iTfTable[i]) return(sTfTable[i]); return(""); } //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // void doAlert(string doWhat) { static string previousAlert="nothing"; static datetime previousTime; string message; if (previousAlert != doWhat || previousTime != Time[0]) { previousAlert = doWhat; previousTime = Time[0]; // // // // // message = timeFrameToString(_Period)+" "+_Symbol+" at "+TimeToStr(TimeLocal(),TIME_SECONDS)+" Wpr "+doWhat; if (alertsMessage) Alert(message); if (alertsPushNotif) SendNotification(message); if (alertsEmail) SendMail(_Symbol+" Wpr ",message); if (alertsSound) PlaySound("alert2.wav"); } }