I-Regr_Notifier

Download script
Author: Copyright � 2011, Neudis Neukrug
I-Regr_Notifier

This script is designed as a real-time monitoring tool for the MetaTrader platform that provides instant notifications when market prices cross specific statistical boundaries. Its primary purpose is to alert traders to significant price movements based on a regression analysis model.

Core Functionality

The script works by constantly tracking two specific price levels: an upper boundary and a lower boundary. These levels are derived from an external regression calculation, which identifies the current "corridor" of market activity. By monitoring these levels, the tool helps traders identify when the price is pushing beyond its expected range.

Key Operational Logic

  • Price Monitoring: The script continuously checks the current "Ask" price (the price at which a trade can be executed) against the calculated upper and lower boundaries.
  • Breakout Detection:
    • If the market price climbs above the upper boundary, the script recognizes an upward breakout.
    • If the market price falls below the lower boundary, the script recognizes a downward breakout.
  • Smart Alerting System: To prevent overwhelming the user with repetitive notifications (which can occur in highly volatile markets), the script includes a "delay" mechanism. It only triggers an alert if a specific number of price updates have passed since the last notification, ensuring you receive timely information without excessive noise.
  • Visual Feedback: In addition to sending audible/pop-up alerts, the script provides a live visual display on your trading chart. It renders three distinct text labels that show:
    1. The title of the notification system.
    2. The exact numerical value of the current upper boundary.
    3. The exact numerical value of the current lower boundary.

User Experience

From a user's perspective, this tool acts as an automated "lookout." Instead of having to manually watch the charts to see if the price is breaking out of a range, the script monitors the data in the background and pings you immediately when a significant move occurs, while simultaneously displaying the current active limits clearly on your screen.

Miscellaneous
It issuies visual alerts to the screen
4 Views
0 Downloads
0 Favorites
I-Regr_Notifier
//+------------------------------------------------------------------+
//| Version 3                                     IregrNotifier.mq4  |
//|                                         Copyright © 2011,NN      |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Neudis Neukrug"

double regup, regdown; 
extern int delayBetweenAlerts =240;
extern int degree = 3;
extern double kstd = 2.0;
extern int bars = 250;
extern int shift = 0;
extern color IndicatorColor=White; 
int counter=0;

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
      ObjectDelete("I-regr Notifier");
      ObjectDelete("RegrUp");
      ObjectDelete("RegrDown");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
  
  counter++;

  regup = iCustom(NULL,0,"i-Regr",degree,kstd,bars,shift,1,0);
  regdown = iCustom(NULL,0,"i-Regr",degree,kstd,bars,shift,2,0);
  
  if(Ask>regup && counter>delayBetweenAlerts){
  Alert("IREGR BROKE UP: ",Symbol()," M",Period()," Price: ",Ask);
          counter=0;
  }
  
  if(Ask<regdown && counter>delayBetweenAlerts){
  Alert("IREGR BROKE DOWN: ",Symbol()," M",Period()," Price: ",Ask);
         counter=0;
  }
      ObjectCreate("I-regr Notifier", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("I-regr Notifier","I-regr Notifier",8,"Arial Black", IndicatorColor);
      ObjectSet("I-regr Notifier", OBJPROP_CORNER, 3);
      ObjectSet("I-regr Notifier", OBJPROP_XDISTANCE, 4);
      ObjectSet("I-regr Notifier", OBJPROP_YDISTANCE, 13);
      
      
      ObjectCreate("RegrUp", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("RegrUp",DoubleToStr(regup,Digits),8,"Arial Black", IndicatorColor);
      ObjectSet("RegrUp", OBJPROP_CORNER, 3);
      ObjectSet("RegrUp", OBJPROP_XDISTANCE, 4);
      ObjectSet("RegrUp", OBJPROP_YDISTANCE, 47);

      ObjectCreate("RegrDown", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("RegrDown",DoubleToStr(regdown,Digits),8,"Arial Black", IndicatorColor);
      ObjectSet("RegrDown", OBJPROP_CORNER, 3);
      ObjectSet("RegrDown", OBJPROP_XDISTANCE, 4);
      ObjectSet("RegrDown", OBJPROP_YDISTANCE, 34);
   
      return(0);
  }
//+------------------------------------------------------------------+

Comments