Gann HiLo ActivatorV2_Alert_Email

Download script
Author: Poul Trade Forum
Gann HiLo ActivatorV2_Alert_Email

Overview of the HoLo Activator Logic

The HoLo Activator is a specialized technical analysis tool designed to help traders identify potential trend reversals and momentum shifts on a price chart. It operates by analyzing the relationship between current price action and two distinct sets of moving averages, specifically focusing on the high and low extremes of price movement.

Core Mechanics

To determine where to place visual markers or lines on your chart, the script performs the following calculations:

  1. High/Low Trend Tracking: The tool monitors two separate "bands" based on a user-defined period (the R parameter). One band follows the highest prices reached over that timeframe, and the other follows the lowest prices.
  2. Trend Identification: The script constantly checks if the current closing price has broken above the high band or below the low band:
    • If the price closes above the high band, it signals a potential upward momentum.
    • If the price closes below the low band, it signals a potential downward momentum.
  3. The Moving Average Filter: A secondary, shorter moving average (the MA_Period) acts as a "filter" or a baseline. The script uses this to verify the strength of the signal. It looks for specific instances where the trend dots/lines cross relative to this moving average.

Visual and Notification Features

The tool is highly customizable in how it communicates these signals to the user:

  • Visual Display: Depending on your settings, the tool can display the data in two ways:
    • Dots: It places specific colored dots on the chart to highlight where trend shifts are occurring.
    • Solid Line: Instead of individual dots, it can draw a continuous line that moves with the price action to show the prevailing trend direction.
  • Automated Alerts: The script is equipped with a notification system. When a significant trend shift occurs (specifically when the signal dots or lines cross the moving average filter), the tool can perform three actions simultaneously:
    • Audio Alert: Plays a sound file through your computer speakers.
    • Pop-up Notification: Displays a visual alert message directly on the trading platform.
    • Email Notification: Sends a detailed summary of the trend change to a registered email address (if enabled).

Summary for Traders

In simple terms, this tool helps you "see" when the price is pushing into new territory (highs or lows) and alerts you immediately when that movement interacts with a primary moving average. This allows traders to react quickly to momentum changes without having to manually monitor the charts at all times.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1It plays sound alertsIt issuies visual alerts to the screenIt sends emails
8 Views
0 Downloads
0 Favorites
Gann HiLo ActivatorV2_Alert_Email
//+------------------------------------------------------------------+
//|                                               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 copyright "Alert and email function added by Sadly at http://www.forex-tsd.com/"
#property link      "http://forex.kbpauk.ru/"
#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 bool dots=true;
extern bool line=false;
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,MODE_SMA,PRICE_HIGH,shift+1);
VALUE2=iMA(NULL,0,R,0,MODE_SMA,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("HiLo dot below MA", 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("HiLo dot above MA", 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("HiLo line X below MA", 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("HiLo line X above MA", MA_Period);
         old_Swing = Swing;
         if (Email_on) SendMail(AlertMSG,"Line above MA"+MA_Period);
         }
   }  
}
}


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

Comments