ADX_Advanced_WA

Download script
Author: Waddah Attar
ADX_Advanced_WA

Overview

The Advanced ADX indicator is a specialized technical analysis tool designed to help traders visualize the strength and direction of market trends. Rather than providing a single, cluttered data point, this script separates the momentum of the market into two distinct visual components, allowing for a clearer understanding of whether the current price action is driven by buyers or sellers.

How the Logic Works

The core functionality of this tool relies on three specific mathematical calculations performed simultaneously:

  • Trend Strength (ADX): The script calculates the overall intensity of the market movement. This tells you if the market is in a strong trend or moving sideways in a "choppy" manner.
  • Buying Pressure (+DI): It measures the momentum specifically generated by buying activity.
  • Selling Pressure (-DI): It measures the momentum specifically generated by selling activity.

Visual Representation and Interpretation

The script takes these three calculations and filters them into a dual-color histogram display:

  1. Bullish Momentum (Green): When the buying pressure (+DI) is higher than the selling pressure (-DI), the indicator highlights the trend strength in green. This suggests that the upward movement is currently dominant.
  2. Bearish Momentum (Red): When the selling pressure (-DI) exceeds the buying pressure (+DI), the indicator switches to red. This signals that downward momentum is taking control of the market.

Key Trading Features

  • Dynamic Switching: The indicator automatically toggles between red and green based on which side has more strength, providing an immediate visual cue of the "dominant" force in the market.
  • Reference Thresholds: The tool includes pre-set horizontal levels (20 and 30). These serve as benchmarks to help traders determine if the current trend is significant enough to act upon or if it is too weak to be considered a reliable move.
  • Customizable Sensitivity: The period over which the data is calculated can be adjusted, allowing users to tune the indicator to react faster to short-term price changes or more slowly to capture long-term movements.
Indicators Used
Movement directional index
Miscellaneous
Implements a curve of type %1
7 Views
0 Downloads
0 Favorites
ADX_Advanced_WA
//+------------------------------------------------------------------+
//|                                              ADX_Advanced_WA.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 Green
#property indicator_color2 Red
#property indicator_style1    0
#property indicator_width1    2
#property indicator_style2    0
#property indicator_width2    2
#property indicator_level1 20
#property indicator_level2 30
#property indicator_levelcolor  SlateGray


//----
extern int ADXPeriod = 13;
//----
double ExtBuffer1[];
double ExtBuffer2[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0, ExtBuffer1);
   SetIndexStyle(0, DRAW_HISTOGRAM);
//----
   SetIndexBuffer(1, ExtBuffer2);
   SetIndexStyle(1, DRAW_HISTOGRAM);
//----
   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