QQE Alert v3

Download script
Author: Skyline, 2007
QQE Alert v3

This tool is designed to monitor market trends and provide real-time notifications when specific momentum shifts occur. It functions by analyzing price action data to identify "crossover" events between two distinct moving signals—essentially looking for the moment a fast-moving trend overtakes a slower-moving one.

Core Logic and Analysis

The script operates by calculating the relationship between two components of the Quantitative E-Merge (QQE) system. It continuously scans price history to determine:

  • Relative Movement: It identifies a "fast" signal and a "slow" signal. When these two signals intersect, it indicates a potential change in market direction.
  • Dynamic Range Calculation: The tool automatically measures the recent volatility (the average range of high and low prices over a specific period). This ensures that the visual markers placed on your chart are positioned accurately relative to the current price action.
  • Confirmation Filtering: To reduce "false positives," the script does not simply alert on every touch. It checks for a three-point confirmation: it verifies that the crossover happened in the current moment, was not present in the previous bar, and is sustained in the following position.

Visual and Audible Feedback

When the logic confirms a trend shift, the script provides immediate feedback in several ways:

  • On-Chart Markers: The tool places visual arrows on the chart. These appear above or below the candles depending on whether the trend is shifting upwards (bullish) or downwards (bearish).
  • Sound Notifications: Users can receive instant audio cues. The script is programmed to play specific sound files (e.g., "long" or "short") based on the direction of the crossover.
  • Pop-up Alerts: If enabled, a visual notification will appear directly on the trading platform screen to grab the user's attention immediately.

Automated Notifications

For traders who are not constantly watching their screens, the script includes an automated communication layer:

  • Email Alerts: The tool can be configured to send an automated email to your designated mail server. These emails include specific details such as the asset being traded (e.g., EURUSD) and the specific timeframe (e.g., H1 or M15), allowing you to react to market changes even when away from your desk.
  • Smart Tracking: To prevent your notifications from becoming overwhelmed, the script uses "tags." This ensures that you only receive one alert per candle/signal, preventing the system from sending multiple repetitive messages for the same move.
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screenIt sends emails
5 Views
0 Downloads
0 Favorites
QQE Alert v3
//+------------------------------------------------------------------+
//|                                                 QQE Alert v3.mq4 |
//|                                                    Skyline, 2007 |
//|                                             www.forexpertutti.it |
//+------------------------------------------------------------------+
#property copyright "Skyline, 2007"
#property link      "www.forexpertutti.it"

#property indicator_chart_window

#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Magenta

extern string Comment1             = "QQEA Alert v3 compiled by Skyline on 31 Oct 2007";
extern string Comment2             = "email : glicci@yahoo.it"; 
//extern bool   ShowCrossQQE_RSISlow = true;
extern int    QQE_SF               = 1;
extern int    QQE_RSI_Period       = 14;
extern double QQE_DARFACTOR        = 4.236; 
extern int    QQE_Width            = 1;
extern double QQE_Position         = 0.5;
extern bool   EnableSoundAlert     = true;
extern bool   EnableVisualAlert    = false;
extern bool   EnableEmailAlert     = true;

double CrossUp[];
double CrossDown[];

static datetime alertTag = D'1980.01.01'; 
static datetime soundTag = D'1980.01.01';
static datetime emailTag = D'1980.01.01';

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
    SetIndexStyle(0, DRAW_ARROW, EMPTY,QQE_Width);
    SetIndexArrow(0, 241);
    SetIndexBuffer(0, CrossUp);
    SetIndexStyle(1, DRAW_ARROW, EMPTY,QQE_Width);
    SetIndexArrow(1, 242);
    SetIndexBuffer(1, CrossDown);   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start() 
{
   int limit, i, counter;
   //double fasterEMAnow, slowerEMAnow, fasterEMAprevious, slowerEMAprevious, fasterEMAafter, slowerEMAafter;
   double fasterRSInow,slowerRSInow,fasterRSIprevious,slowerRSIprevious,fasterRSIafter,slowerRSIafter;
   double Range, AvgRange;
   
   int counted_bars=IndicatorCounted();
//---- check for possible errors

   if(counted_bars<0) return(-1);
   
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   limit=Bars-counted_bars;
   
   for(i = 0; i <= limit; i++) 
   {
   
      counter=i;
      Range=0;
      AvgRange=0;
      for (counter=i ;counter<=i+9;counter++)
      {
         AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
      }
      Range=AvgRange/10;
      
      fasterRSInow      = iCustom(NULL,0,"QQEA",QQE_SF,QQE_RSI_Period,QQE_DARFACTOR,0,i);
      fasterRSIprevious = iCustom(NULL,0,"QQEA",QQE_SF,QQE_RSI_Period,QQE_DARFACTOR,0,i+1); 
      fasterRSIafter    = iCustom(NULL,0,"QQEA",QQE_SF,QQE_RSI_Period,QQE_DARFACTOR,0,i-1); 

      slowerRSInow      = iCustom(NULL,0,"QQEA",QQE_SF,QQE_RSI_Period,QQE_DARFACTOR,1,i);
      slowerRSIprevious = iCustom(NULL,0,"QQEA",QQE_SF,QQE_RSI_Period,QQE_DARFACTOR,1,i+1); 
      slowerRSIafter    = iCustom(NULL,0,"QQEA",QQE_SF,QQE_RSI_Period,QQE_DARFACTOR,1,i-1); 


      if ((fasterRSInow > slowerRSInow) && (fasterRSIprevious < slowerRSIprevious) && (fasterRSIafter > slowerRSIafter)) 
      {
         CrossUp[i] = Low[i] - Range*QQE_Position;
      }
      else 
      if ((fasterRSInow < slowerRSInow) && (fasterRSIprevious > slowerRSIprevious) && (fasterRSIafter < slowerRSIafter)) 
      {
          CrossDown[i] = High[i] + Range*QQE_Position;
      }
      /*  if (SoundON==true && i==1 && CrossUp[i] > CrossDown[i] && alertTag!=Time[0])
        {
         Alert("EMA Cross Trend going Down on ",Symbol()," ",Period());
         alertTag = Time[0];
        }
        if (SoundON==true && i==1 && CrossUp[i] < CrossDown[i] && alertTag!=Time[0])
        {
         Alert("EMA Cross Trend going Up on ",Symbol()," ",Period());
         alertTag = Time[0];
        } */
        
        // Gestione Alert visivo //
        if (EnableVisualAlert==true && i==1 && CrossUp[i] > CrossDown[i] && alertTag!=Time[0])
        {
         Alert("QQE Cross Trend going DOWN on ",Symbol()," ",Periodo(Period()));
         alertTag = Time[0];
        }
        if (EnableVisualAlert==true && i==1 && CrossUp[i] < CrossDown[i] && alertTag!=Time[0])
        {
         Alert("QQE Cross Trend going UP on ",Symbol()," ",Periodo(Period()));
         alertTag = Time[0];
        }   
          
        // Gestione Alert sonoro //      
        if (EnableSoundAlert==true && i==1 && CrossUp[i] > CrossDown[i] && soundTag!=Time[0])
        {
         PlaySound ("short.wav");
         soundTag = Time[0];
        }
        if (EnableSoundAlert==true && i==1 && CrossUp[i] < CrossDown[i] && soundTag!=Time[0])
        {
         PlaySound ("long.wav");
         soundTag = Time[0];
        } 
        
        // Gestione Alert con email //      
        if (EnableEmailAlert==true && i==1 && CrossUp[i] > CrossDown[i] && emailTag!=Time[0])
        {
         SendMail("Supernova alert signal!","QQE Cross Trend going DONWN on " + (StringConcatenate(Symbol()," ",Periodo(Period()))));
         emailTag = Time[0];
        }
        if (EnableEmailAlert==true && i==1 && CrossUp[i] < CrossDown[i] && emailTag!=Time[0])
        {
         SendMail("Supernova alert signal!","QQE Cross Trend going UP on " + (StringConcatenate(Symbol()," ",Periodo(Period()))));
         emailTag = Time[0];
        } 
  }
   return(0);
}

string Periodo(int TF)
{
 if (TF==1)    { return("M1"); }
 if (TF==5)    { return("M5"); }
 if (TF==15)   { return("M15"); }
 if (TF==30)   { return("M30"); } 
 if (TF==60)   { return("H1"); } 
 if (TF==240)  { return("H4"); } 
 if (TF==1440) { return("D1"); }  
}

Comments