Gann HiLo ActivatorV2_Alert_Email_v1.1

Download script
Author: Poul Trade Forum
Gann HiLo ActivatorV2_Alert_Email_v1.1

The HoLo Activator is a specialized technical analysis tool designed to identify market trends and potential trend reversals by tracking the relationship between price action and moving averages. It essentially acts as a visual and audible signaling system that helps traders distinguish between bullish (upward) and bearish (downward) momentum.

Core Logic and Methodology

The script functions by analyzing three distinct data points simultaneously:

  1. High and Low Averages: It calculates the average of the highest prices and lowest prices over a specific timeframe (defined by the "R" parameter).
  2. Closing Prices: It monitors where the current market price closes relative to those highs and lows.
  3. Moving Average Reference: It utilizes a secondary moving average (based on closing prices) as a "filter" to confirm the strength of the trend.

How it Identifies Trends

The indicator determines the current market "swing" by comparing the closing price to the calculated high and low averages:

  • Bullish State: When the closing price moves above the high average, the script identifies a positive swing.
  • Bearish State: When the closing price moves below the low average, the script identifies a negative swing.

Visual Outputs

Depending on your settings, the tool provides two types of visual feedback:

  • Dots Mode: This displays specific markers on the chart to highlight each swing point individually.
  • Line Mode: This draws a continuous line on the chart that follows the trend, providing a smoother visual representation of the price movement.

Alerting and Notification System

The primary utility of this script is its proactive notification system. It doesn't just show data; it monitors for specific "crossover" events. When the market trend switches (from high to low or vice versa) and intersects with the secondary moving average, the script triggers multiple types of alerts:

  • Audible Alerts: Plays a sound file to grab your attention immediately.
  • Pop-up Alerts: Generates a visual notification window on your trading platform containing details about the currency pair and timeframe.
  • Email Notifications: If enabled, the tool can send an automated email to your registered address, ensuring you are notified of trend changes even when you are away from your computer.

Summary for the User

In simple terms, this script acts as a "trend watchdog." It watches the price history to see if the market is leaning upwards or downwards and alerts you the moment those trends cross key mathematical thresholds. This allows traders to react faster to momentum shifts without having to manually monitor every tick of the market.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1It plays sound alertsIt issuies visual alerts to the screenIt sends emails
14 Views
0 Downloads
0 Favorites
Gann HiLo ActivatorV2_Alert_Email_v1.1
//+------------------------------------------------------------------+
//|                                               HoLo Activator.mq4 |
//|                               Copyright © 2004, Poul_Trade_Forum |
//|                                                         Aborigen |
//|                                          http://forex.kbpauk.ru/ |
//+------------------------------------------------------------------+
// Modified Aug14,2007 Kenneth Hookham to provide solid line option

#property copyright "Poul Trade Forum"
#property link      "http://forex.kbpauk.ru/"
#property copyright "Gann + MA cross alert and email function added by Sadly at http://www.forex-tsd.com/"
#property copyright "Gann MA Mode input settings added by Sadly at http://www.forex-tsd.com/"
#property indicator_chart_window
#property indicator_buffers 3

#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Navy


//---- input parameters
extern int R=10; // default value for auslanco system
extern int Gann_MA_mode = MODE_SMA; // MODE_SMA 0 Simple moving average, MODE_EMA 1 Exponential moving average, MODE_SMMA 2 Smoothed moving average, MODE_LWMA 3 Linear weighted moving average. 
extern bool dots=false;
extern bool line=true;
extern bool Alert_On = true;
extern bool Email_on = false;
extern int  MA_Period = 5;
extern int  MA_method = MODE_SMA;



//---- buffers
double HighBuffer[];
double LowBuffer[];
double LineBuffer[];
double VALUE1,VALUE2,VALUE11,VALUE22;
double MA_Period_val;
int old_Swing;
string AlertMSG = "Gann HiLo Activator alert";
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   if(dots)
   {
   SetIndexStyle(0,DRAW_ARROW,EMPTY,1,Blue);
   SetIndexStyle(1,DRAW_ARROW,EMPTY,1,Red);
   
   SetIndexArrow(0, 0x9F);
   SetIndexArrow(1, 0x9F);

   SetIndexBuffer(0,HighBuffer);
   SetIndexBuffer(1,LowBuffer);

   SetIndexEmptyValue(0,0);
   SetIndexEmptyValue(1,0);
   }
   if(line)
   {
   SetIndexStyle(2,DRAW_LINE,EMPTY,2,Navy);
   SetIndexBuffer(2,LineBuffer);
   SetIndexEmptyValue(2,0);
   }   
//---- name for DataWindow and indicator subwindow label
   short_name="HiLoV2";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);

//----
   SetIndexDrawBegin(0,10);
//----

   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
 ObjectsDeleteAll(0);   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted(),i,shift,Swing;
   

//---- TODO: add your code here
i=(Bars-counted_bars)-1;

for (shift=i; shift>=0;shift--)
{


VALUE1=iMA(NULL,0,R,0,Gann_MA_mode,PRICE_HIGH,shift+1);
VALUE2=iMA(NULL,0,R,0,Gann_MA_mode,PRICE_LOW,shift+1);
MA_Period_val=iMA(NULL,0,MA_Period,0,MA_method,PRICE_CLOSE,shift+1);

if (Close[shift+1]<VALUE2 ) Swing=-1;
if (Close[shift+1]>VALUE1 ) Swing=1;
if(dots)
{
if (Swing==1) { 
   HighBuffer[shift]=VALUE2;
   LowBuffer[shift]=0;  
   if(VALUE1 > MA_Period_val){ 
      if(Alert_On && Swing != old_Swing){
         PlaySound("Alert.wav");
         Alert(" MA cross Gann down"+Symbol()+" "+Period()+", "+MA_Period+"");
         old_Swing = Swing;
         if (Email_on) SendMail(AlertMSG,"Dot below MA"+MA_Period);
      }
   }  
}
if (Swing==-1) {
   LowBuffer[shift]=VALUE1;
   HighBuffer[shift]=0; 
   if(VALUE2 < MA_Period_val){ 
      if(Alert_On && Swing != old_Swing){ 
         PlaySound("Alert.wav");
         Alert("MA cross GANN up"+Symbol()+" "+Period()+", "+MA_Period+"");
         old_Swing = Swing;
         if (Email_on) SendMail(AlertMSG,"Dot above MA"+MA_Period);
      }
   }  
}

}

if(line)
{
if (Swing==1) { 
   LineBuffer[shift]=VALUE2;   
   if(VALUE1 > MA_Period_val){ 
      if(Alert_On && Swing != old_Swing){ 
         PlaySound("Alert.wav");
         Alert("MA cross hi-lo line", MA_Period);
         old_Swing = Swing;
         if (Email_on) SendMail(AlertMSG,"Line below MA"+MA_Period);
         }
   }  
}


if (Swing==-1) { 
   LineBuffer[shift]=VALUE1;  
   if(VALUE2 < MA_Period_val){ 
      if(Alert_On && Swing != old_Swing){
         PlaySound("Alert.wav");
         Alert("MA cross hi-lo line", MA_Period);
         old_Swing = Swing;
         if (Email_on) SendMail(AlertMSG,"Line above MA"+MA_Period);
         }
   }  
}
}


 //----
}
   return(0);
  }
//+------------------------------------------------------------------+

Comments