This tool is a specialized technical analysis indicator designed to help traders visualize market strength and identify the prevailing trend direction by combining multiple layers of data. Rather than simply showing raw price movement, it filters market noise to provide a clearer picture of "who is in control" at any given moment.
Core Functionality
The primary logic of this script revolves around monitoring three distinct components of a standard momentum indicator (the ADX system):
- Market Strength: The overall power or "velocity" of the current price movement.
- Bullish Momentum: The specific upward pressure exerted by buyers.
- Bearish Momentum: The specific downward pressure exerted by sellers.
How It Works
The script automatically compares the strength of buyers against the strength of sellers. Instead of showing you both forces simultaneously, it chooses the dominant one and presents it visually:
- Bullish Bias (Green): When the upward momentum exceeds the downward momentum, the tool highlights the market strength in green. This suggests that buyers are currently leading the price action.
- Bearish Bias (Red): When the downward momentum exceeds the upward momentum, the tool switches the display to red, indicating that sellers are currently in control.
Multi-Timeframe Analysis
One of the most advanced features of this script is its ability to look "beyond" the current chart. It allows you to view trend data from different timeframes (such as Daily, Weekly, or Hourly) while staying on your current screen.
For example, if you are looking at a small 15-minute chart but want to see if the overall Daily trend is still bullish, this script can fetch that higher-level data and project it onto your current view. This helps traders ensure they aren't trading against a much larger, overarching market move.
Visual Indicators
To make navigation intuitive for the user, the tool includes:
- Visual Thresholds: It features horizontal levels (set at 20 and 30) which act as benchmarks to help you determine if the market trend is gaining significant strength or remains stagnant.
- Histogram Style: The data is presented as a vertical histogram, making it easy to see the "growth" of a trend over time.
Summary for Traders
In short, this tool acts as a filter. It simplifies complex market fluctuations into a clear visual signal: it tells you which side of the market (buyers or sellers) is winning and allows you to verify that your trade aligns with both the immediate price action and the larger timeframe trends.
//+------------------------------------------------------------------+
//| ADX_Advanced_WA.mq4 |
//| Copyright © 2006, Eng. Waddah Attar |
//| mtf 2007forextsd.com keris ki 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 DodgerBlue
//----
extern int ADXPeriod = 14; //wa13
extern int MaxBarsToCount =1500;
extern int TimeFrame = 0;
extern string note_TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-currentTF";
//----
double ExtBuffer1[];
double ExtBuffer2[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0, ExtBuffer1);
SetIndexStyle(0, DRAW_HISTOGRAM);
//----
SetIndexBuffer(1, ExtBuffer2);
SetIndexStyle(1, DRAW_HISTOGRAM);
//----
switch(TimeFrame)
{
case 1: string TimeFrameStr = "M1"; break;
case 5 : TimeFrameStr = "M5"; break;
case 15 : TimeFrameStr = "M15"; break;
case 30 : TimeFrameStr = "M30"; break;
case 60 : TimeFrameStr = "H1"; break;
case 240 : TimeFrameStr = "H4"; break;
case 1440 : TimeFrameStr = "D1"; break;
case 10080 : TimeFrameStr = "W1"; break;
case 43200 : TimeFrameStr = "MN1"; break;
default : TimeFrameStr = "TF 0";
}
IndicatorShortName("ADX_Adv ("+ADXPeriod+") ["+TimeFrameStr+"]");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
double ADX0,ADX1,ADX2;
if(counted_bars < 0)
return(-1);
if(counted_bars > 0)
counted_bars--;
//----
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit= Bars-counted_bars;
limit= MathMax(limit,TimeFrame/Period());
limit= MathMin(limit,MaxBarsToCount);
//----
for(i=0,y=0;i<limit;i++)
{
if (TimeFrame<Period()) TimeFrame=Period();
if (Time[i]<TimeArray[y]) y++;
ADX0 = iADX(NULL, TimeFrame, ADXPeriod, PRICE_CLOSE, MODE_MAIN, y);
ADX1 = iADX(NULL, TimeFrame, ADXPeriod, PRICE_CLOSE, MODE_PLUSDI, y);
ADX2 = iADX(NULL, TimeFrame, ADXPeriod, PRICE_CLOSE, MODE_MINUSDI, y);
//----
if(ADX1 >= ADX2)
{
ExtBuffer1[i] = ADX0;
ExtBuffer2[i] = 0;
}
else
{
ExtBuffer1[i] = 0;
ExtBuffer2[i] = ADX0;
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments