Advanced_ADX

Download script
Author: Waddah Attar
Advanced_ADX

This tool is designed to provide traders with a clearer, more visual representation of market momentum and direction. By analyzing the underlying price action, it simplifies complex data into two distinct visual components that help distinguish between bullish (upward) and bearish (downward) movements.

Core Functionality

The script utilizes three specific types of technical data to evaluate the market:

  • Main Trend Strength: It measures the overall intensity of price movement regardless of direction.
  • Positive Momentum: It tracks the upward pressure or "buying" strength in the market.
  • Negative Momentum: It tracks the downward pressure or "selling" strength in the market.

How it Works

The logic functions by comparing the positive and negative momentum values at every point in time. Instead of showing all this data simultaneously, which can often look cluttered on a chart, the script acts as a filter:

  1. Trend Identification: It looks at whether the "buying" strength is currently higher than the "selling" strength.
  2. Visual Separation:
    • If the positive momentum is stronger, the tool displays the trend strength in one color (Navy). This signals that the current market energy is leaning toward an upward move.
    • If the negative momentum is stronger, it switches the display to a different color (Maroon), signaling that the market energy is favoring a downward move.
  3. Dynamic Switching: As the market shifts and one momentum type overtakes the other, the visual bars automatically switch colors. This allows you to see not just how strong the trend is, but also exactly which way it is heading in real-time.

Practical Use

By using this logic, a trader can quickly identify the "prevailing wind" of the market. It removes the noise of constantly oscillating lines and replaces it with a clear visual distinction: you can see at a glance whether the current strength is being driven by buyers or sellers, making it easier to stay aligned with the dominant market direction.

Indicators Used
Movement directional index
Miscellaneous
Implements a curve of type %1
16 Views
0 Downloads
0 Favorites
Advanced_ADX
//+------------------------------------------------------------------+
//|                                                 Advanced_ADX.mq4 |
//|                              Copyright © 2006, Eng. Waddah Attar |
//|                                          waddahattar@hotmail.com |
//+------------------------------------------------------------------+
#property copyright "Waddah Attar"
#property link      "waddahattar@hotmail.com"
//----
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Navy
#property indicator_color2 Maroon
//----
extern int ADXPeriod = 13;
//----
double ExtBuffer1[];
double ExtBuffer2[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0, ExtBuffer1);
   SetIndexStyle(0, DRAW_HISTOGRAM, 0, 4);
//----
   SetIndexBuffer(1, ExtBuffer2);
   SetIndexStyle(1, DRAW_HISTOGRAM, 0, 4);
//----
   IndicatorShortName("Advanced_ADX (" + ADXPeriod + ")");
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int i, limit;
   double ADX0,ADX1,ADX2;
   int counted_bars = IndicatorCounted();
   if(counted_bars < 0) 
       return(-1);
   if(counted_bars > 0) 
       counted_bars--;
   limit = Bars - counted_bars; 
//----   
   for(i = 0; i < limit ; i++)
     {
       ADX0 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_MAIN, i);
       ADX1 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_PLUSDI, i);
       ADX2 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_MINUSDI, i);
       //----
       if(ADX1 >= ADX2)
         {
           ExtBuffer1[i] = ADX0;
           ExtBuffer2[i] = 0;
         }
       else
         {
           ExtBuffer1[i] = 0;
           ExtBuffer2[i] = ADX0;
         }
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments