QQE_Cross Alert
Download scriptThis script is designed as a visual signaling tool for the MetaTrader trading platform. Its primary purpose is to identify specific "crossover" moments in market momentum, providing traders with clear, real-time notifications when price trends shift.
How it Works
The logic relies on comparing two different data streams derived from a technical indicator known as the QQE (Quantitative Qualitative Efficiency). Instead of looking at just one line, the script monitors how these two lines interact with each other over time.
- Identifying Upward Momentum: The script looks for a specific moment where the first QQE line moves above the second QQE line. When this "cross up" occurs, the tool recognizes it as a potential bullish signal (an upward trend).
- Identifying Downward Momentum: Conversely, the script monitors for when the first QQE line drops below the second QQE line. This "cross down" is interpreted as a potential bearish signal (a downward trend).
Visual and Auditory Feedback
To ensure traders don't miss these movements, the script provides immediate feedback in three different ways:
- On-Chart Markers: The tool automatically places visual arrows directly on your trading chart. Blue arrows appear below the candles to signify an upward cross, while red arrows appear above the candles to signify a downward cross. These are positioned slightly away from the price action (based on a customizable offset) so they remain easy to see.
- Sound Alerts: The script can play a specific audio file through your computer speakers at the exact moment a crossover is detected, providing an instant audible cue.
- Pop-up Notifications & Emails: You can choose to receive a visual "Alert" pop-up window on your screen or an automated email notification. These messages contain the specific details of the trade, including the asset name (e.g., EURUSD) and the exact time the signal occurred.
Key Features for the User
- Customizable Alerts: You can toggle the visual, audio, and email notifications on or off depending on your trading style.
- Historical Review: The script can be set to scan back over a specific number of historical bars, allowing you to see where these crossovers occurred in the past.
- Precision Positioning: The tool includes an adjustable offset to ensure that the visual arrows do not overlap with the actual price candles, keeping your chart clean and readable.
//+------------------------------------------------------------------+
//| QQE_Cross.mq4 |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
extern int SF = 1;
extern bool Visual_Alert=true;
extern bool Audio_Alert=true;
extern string Audio_Up_File="alert.wav";
extern string Audio_Down_File="alert.wav";
extern bool Email_Alert=true;
extern int Count_Bars=EMPTY_VALUE;
extern int Arrow_Offset=5;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
bool up=false;
bool dn=false;
datetime last_t=0;
int init()
{
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,234);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexEmptyValue(1,0.0);
return(0);
}
int deinit(){return(0);}
int start()
{
int l=0;
if (Count_Bars>Bars) {l=Bars;}else{l=Count_Bars;}
for (int i=l;i>=0;i--){
ExtMapBuffer1[i]=0;
ExtMapBuffer2[i]=0;
double qqe0_0=iCustom(Symbol(),0,"QQE",SF,0,i);
double qqe0_1=iCustom(Symbol(),0,"QQE",SF,0,i+1);
double qqe1_0=iCustom(Symbol(),0,"QQE",SF,1,i);
double qqe1_1=iCustom(Symbol(),0,"QQE",SF,1,i+1);
if (qqe0_0>qqe1_0 && qqe0_1<=qqe1_1 && !up){
ExtMapBuffer1[i]=Low[i]-Arrow_Offset*Point;
up=true;
dn=false;
}
if (qqe0_0<qqe1_0 && qqe0_1>=qqe1_1 && !dn){
ExtMapBuffer2[i]=High[i]+Arrow_Offset*Point;
dn=true;
up=false;
}
}
if (ExtMapBuffer1[0]>0){
if (Visual_Alert) Alert("Cross up on : "+Symbol()+" at "+TimeToStr(TimeCurrent()));
if (Audio_Alert) PlaySound(Audio_Up_File);
if (Email_Alert) SendMail("QQE_Cross Alert","Cross up on : "+Symbol()+" at "+TimeToStr(TimeCurrent()));
}
if (ExtMapBuffer2[0]>0){
if (Visual_Alert) Alert("Cross down on : "+Symbol()+" at "+TimeToStr(TimeCurrent()));
if (Audio_Alert) PlaySound(Audio_Down_File);
if (Email_Alert) SendMail("QQE_Cross Alert","Cross down on : "+Symbol()+" at "+TimeToStr(TimeCurrent()));
}
return(0);
}
Comments