Author: Copyright � 2006, Nick Bilak
HMA_angle

This script is designed as a visual aid for traders who want to measure the intensity or "steepness" of a specific market trend. Rather than simply showing where the price is going, it focuses on how fast and aggressively the price is moving in a particular direction.

How it Works

The logic relies on two main components: a specific type of moving average (the Hull Moving Average) and a mathematical calculation of change.

1. Identifying the Trend Movement The script looks at the "Hull Moving Average," which is a popular technical tool used to smooth out price fluctuations while minimizing the delay usually found in standard averages. By using this, the script captures the underlying "flow" of the market more smoothly than raw price action alone.

2. Measuring the Angle (Momentum) Instead of drawing a line that follows the price directly, this script calculates the difference between the current moving average value and the previous one.

  • It looks at where the trend stands right now.
  • It looks at where the trend stood exactly one step ago.
  • It subtracts the old value from the new value to find the "gap."

3. Visualizing the Result The script takes that "gap" and converts it into an absolute number (meaning it only shows the magnitude of the move, regardless of whether it is moving up or down). This result is then plotted on a separate window at the bottom of your trading chart.

What this means for the Trader

When you look at the resulting line in the indicator window:

  • High Peaks: Represent strong, aggressive momentum where the price is moving rapidly.
  • Low Valleys/Flat Lines: Represent periods of consolidation, stagnation, or very slow movement where the market lacks clear direction.

Essentially, this tool acts as a "speedometer" for the trend, allowing you to see at a glance whether the current market move has significant strength or if it is losing steam.

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
HMA_angle
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                    HMA_angle.mq4 |
//|                Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
//|                                    http://metatrader.50webs.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Nick Bilak"
#property link      "http://metatrader.50webs.com/"

//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Aqua
//---- indicator parameters
extern int _maPeriod=20;
extern int price = PRICE_OPEN;
//---- indicator buffers
double e1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0,DRAW_LINE);
   SetIndexEmptyValue(0,0);
   if(
   	!SetIndexBuffer(0,e1)
      )
      Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("HMA_angle("+_maPeriod+")");
//---- initialization done
   return(0);
   
  }

int start()
  {
   int i,limit;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-_maPeriod-1-counted_bars;
	double hma1,hma2,y;
   for(i=limit; i>=0; i--) {
		hma1=iCustom(NULL,0,"HMA",_maPeriod,price,0,i);
		hma2=iCustom(NULL,0,"HMA",_maPeriod,price,0,i+1);
		y=MathAbs(hma1-hma2);
   	e1[i]=y;
   }
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

Comments