###Gann_HiLo_Activator_v2###
Download scriptOverview of the HiLo Activator
The HiLo Activator is a technical analysis tool designed to help traders identify potential trend shifts and price extremes on a currency chart. Instead of focusing on where the price is currently sitting, this script analyzes historical "highs" and "lows" over a specific period to create visual signals for market direction.
How the Logic Works
The core logic of this tool relies on two moving averages that track the upper and lower boundaries of price action:
- High-Point Tracking: The script looks at the highest prices reached over a user-defined number of previous bars (the "R" value).
- Low-Point Tracking: Simultaneously, it tracks the lowest prices reached over that same period.
By monitoring these two boundaries, the script determines if the market is pushing toward a new ceiling or falling toward a new floor. It specifically compares the most recent closing price against these calculated high and low levels to decide how to display the information on your chart.
Visual Feedback and Behavior
Depending on your preferences, the tool provides visual data in two different ways:
- Trend Lines: If you choose to display lines, the script draws a continuous path that follows the "active" boundary of the market. When the price breaks above the expected high boundary, the line adjusts to show the new movement; when it drops below the low boundary, the line shifts to reflect that downward pressure. This helps in visualizing the current "swing" of the market.
- Signal Points (Dots): If you prefer a cleaner look without lines, the script can instead place specific markers (dots) on the chart. These appear at the exact moments the price crosses into a new high or low zone, highlighting the transition from one trend direction to another.
Summary of Purpose
The HiLo Activator acts as a visual "gatekeeper." It ignores minor market noise and only reacts when the price makes a significant enough move to breach established historical highs or lows. This allows traders to see the broader structure of the market more clearly, helping to distinguish between a temporary fluctuation and a genuine shift in momentum.
//+------------------------------------------------------------------+
//| HiLo 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 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=false;
extern bool line=true;
//---- buffers
double HighBuffer[];
double LowBuffer[];
double LineBuffer[];
double VALUE1,VALUE2,VALUE11,VALUE22;
//+------------------------------------------------------------------+
//| 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);
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 (Swing==-1) { LowBuffer[shift]=VALUE1; HighBuffer[shift]=0; }
}
if(line)
{
if (Swing==1) { LineBuffer[shift]=VALUE2; }
if (Swing==-1) { LineBuffer[shift]=VALUE1; }
}
//----
}
return(0);
}
//+------------------------------------------------------------------+
Comments