Aroon Horn_v1

Download script
Author: tonyc2a@yahoo.com
Aroon Horn_v1

This technical tool is designed to measure the strength of a market trend by analyzing how recently the highest and lowest prices have occurred within a specific timeframe. By converting time into a numerical value, it helps traders visualize whether the price momentum is currently pushing upward, downward, or remainingsideways.

Core Mechanics

The script operates by looking back at a defined period (the "Aroon Period") to identify two key data points:

  1. The Highest High: The peak price reached during that timeframe.
  2. The Lowest Low: The bottom price reached during that timeframe.

Instead of just looking at the price itself, the logic focuses on when these peaks and valleys occurred. It calculates how many bars have passed since those specific points were hit and compares that duration to the total length of the observation period.

How the Calculations Work

The tool generates two distinct lines to represent different market forces:

  • Aroon Up: This measures the "freshness" of the recent highs. If the highest price occurred very recently (at the start of the timeframe), the value moves toward 100, signaling strong bullish momentum. If the highest price was seen a long time ago, the value drops, suggesting the upward trend is losing steam.
  • Aroon Down: This performs the opposite calculation for the lows. It tracks how recently the lowest price occurred. A high value here indicates that the market is hitting new lows frequently, signaling strong bearish momentum.

Visual Interpretation

The resulting data is displayed as two separate lines in a dedicated window:

  • Momentum Strength: When the "Up" line climbs toward the top of the indicator window, it suggests the market is actively trending higher. Conversely, when the "Down" line climbs, it indicates a prevailing downward trend.
  • Trend Shifts: Traders use these lines to identify potential transitions. For instance, when the "Up" line begins to decline while the "Down" line begins to rise, it can serve as an early signal that the current market direction may be exhausting.

In summary, this script serves as a momentum thermometer. It filters out minor price fluctuations to provide a clearer picture of whether the broader market sentiment is leaning toward a sustained move in one direction or if the price action is moving without a clear trend.

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

//+------------------------------------------------------------------+
//|                                                   Aroon Horn.mq4 |
//|                                                tonyc2a@yahoo.com |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "tonyc2a@yahoo.com"
#property link      "mailto:tonyc2a@yahoo.com"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

extern int Aroon_Period=10;

double Buffer1[];
double Buffer2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(0,Buffer1);
   SetIndexLabel(0,"Aroon Up");
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(1,Buffer2);
   SetIndexLabel(1,"Aroon Down");

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//---- TODO: add your code here
   double HighestBar,LowestBar,aroonUp,aroonDn;
   for(int shift=Bars-Aroon_Period;shift>=0;shift--){
      HighestBar = Highest(NULL,0,MODE_HIGH,Aroon_Period-1,shift);
      LowestBar = Lowest(NULL,0,MODE_LOW,Aroon_Period-1,shift);
      
      aroonUp = 100 - ((HighestBar - shift) / Aroon_Period) * 100;
      aroonDn = 100 - ((LowestBar - shift) / Aroon_Period) * 100;  
      
      if(aroonUp == 0) { aroonUp = 0.0000001; }
      if(aroonDn == 0) { aroonDn = 0.0000001; }

      Buffer1[shift]=aroonUp;
      Buffer2[shift]=aroonDn;
      
      }
      
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments