Author: tonyc2a@yahoo.com
Aroon Horn

This tool is designed to help traders gauge the strength of a market trend by measuring how recently the price has reached new highs or lows within a specific timeframe. Instead of just looking at where the price is going, it evaluates "momentum" by determining how quickly the asset is moving toward those extremes.

How the Logic Works

The script analyzes the market based on a user-defined period (the look-back window). It continuously scans the price action to identify two primary signals:

1. The Upward Momentum (Aroon Up) The script looks for the highest price reached during the designated period. It calculates how "fresh" that high is. If the highest price occurred very recently (near the current candle), the indicator produces a high value, suggesting a strong bullish trend. If the highest price happened a long time ago, the value decreases, indicating that the upward momentum may be weakening.

2. The Downward Momentum (Aroon Down) Similarly, the script identifies the lowest price reached during the same timeframe. It measures how recently that low was hit. A high value here suggests that the price is currently hitting new lows rapidly, signifying strong bearish momentum. If the recent lows are far back in time, the value drops, suggesting a lack of immediate selling pressure.

Visualizing the Data

The indicator produces two distinct lines on a separate window in your trading platform:

  • Blue Line: Represents the "Up" strength.
  • Red Line: Represents the "Down" strength.

By observing these two lines together, you can get a clearer picture of market sentiment. When one line is high and the other is low, it indicates a clear trend in one direction. When both lines are moving toward the middle or reacting to each other, it often suggests a period of consolidation or indecision where the market is struggling to establish a dominant direction.

Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
Aroon Horn
//+------------------------------------------------------------------+
//|                                                   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