HiLo Activator

Download script
Author: Poul Trade Forum
HiLo Activator

Overview

The HoLo Activator is a visual trading tool designed to identify potential price momentum and trend shifts on a trading chart. Instead of cluttered lines or complex data points, it serves as a streamlined visual guide that highlights specific "swing" points where the market price interacts with its recent highs and lows.

How the Logic Works

The tool functions by constantly analyzing the relationship between the current market price and two moving averages calculated from the highest and lowest prices over a specific period (defined by the user as "R").

Here is the step-by-step breakdown of its internal logic:

  • Price Monitoring: The script looks at the previous candle's closing price and compares it against two distinct benchmarks:
    1. A benchmark based on the highest prices reached recently.
    2. A benchmark based on the lowest prices reached recently.
  • Trend Detection (The "Swing"):
    • Bullish Signal: If the market price closes above the high-price benchmark, the script identifies a potential upward swing. In this scenario, it places a visual marker at the low-price level to signal a point of interest.
    • Bearish Signal: If the market price closes below the low-price benchmark, the script identifies a potential downward swing. It then places a visual marker at the high-price level to indicate this shift.
  • Visual Output: The tool translates these mathematical calculations into simple symbols on your chart. By displaying these markers only when specific price "breakouts" occur, it helps traders see where the market is reacting to key levels of support and resistance in real-time.

Summary for Traders

Essentially, this script filters out the "noise" of minor price fluctuations. It only activates a visual cue when the price moves significantly enough to clear recent highs or lows. This allows you to see at a glance whether the market is showing signs of strength (moving up) or weakness (moving down), providing a clearer picture of the current trend direction.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
8 Views
0 Downloads
0 Favorites
HiLo Activator
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                               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