Gann HiLo Activator

Download script
Author: Poul Trade Forum
Gann HiLo Activator

The HoLo Activator is a visual trading tool designed to help market participants identify potential trend reversals by pinpointing specific "swing" points in price action. Rather than cluttering the chart with complex lines, it uses a system of visual markers (arrows) to highlight moments where the market price breaks out of its immediate recent range.

How the Logic Works

The core functionality of this script relies on identifying two dynamic boundaries based on the market's high and low prices over a specific period:

  • The Upper Boundary: The tool calculates a moving average of the highest prices reached over a set number of candles (defined by the "R" parameter).
  • The Lower Boundary: Simultaneously, it calculates a moving average of the lowest prices reached over that same period.

By constantly monitoring these two boundaries, the script looks for instances where the current market price moves beyond what has been considered the "normal" range recently.

Identifying Market Signals

The tool generates visual cues based on the relationship between the closing price and these moving boundaries:

  • Bullish Signals (Upward Momentum): When the market price closes above the calculated Upper Boundary, the script identifies this as a potential shift toward an upward trend. It then places a specific marker on the chart to signal this "swing" high.
  • Bearish Signals (Downward Momentum): Conversely, if the market price closes below the calculated Lower Boundary, the script recognizes a potential shift toward a downward trend and places a corresponding marker to signal this "swing" low.

Summary of Visual Output

Instead of providing constant data points, the HoLo Activator acts as a filter. It waits for a definitive break in price structure—where the price moves significantly enough to clear the recent highs or lows—and alerts the user with visual arrows. This allows traders to see at a glance where the market has transitioned from one state of momentum to another.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
Gann HiLo Activator
//+------------------------------------------------------------------+
//|                                               HoLo Activator.mq4 |
//|                               Copyright © 2004, Poul_Trade_Forum |
//|                                                         Aborigen |
//|                                          http://forex.kbpauk.ru/ |
//+------------------------------------------------------------------+
#property copyright "Poul Trade Forum"
#property link      "http://forex.kbpauk.ru/"
#property indicator_chart_window
#property indicator_buffers 2

//---- input parameters
extern int R=3;
//---- buffers
double HighBuffer[];
double LowBuffer[];
double VALUE1,VALUE2,VALUE11,VALUE22;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   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);

//---- name for DataWindow and indicator subwindow label
   short_name="HiLo";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);

//----
   SetIndexDrawBegin(0,10);
   SetIndexDrawBegin(1,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);

if (Close[shift+1]<VALUE2 ) Swing=-1;
if (Close[shift+1]>VALUE1 ) Swing=1;

if (Swing==1) { HighBuffer[shift]=VALUE2; LowBuffer[shift]=0;  }
if (Swing==-1) { LowBuffer[shift]=VALUE1; HighBuffer[shift]=0; }


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

Comments