ADXcrosses_v2

Download script
Author: Copyright � 2004, MetaQuotes Software Corp.
ADXcrosses_v2

This tool is designed to act as a visual guide on your trading charts, helping you identify specific shifts in market momentum. Rather than cluttering the screen with complex lines or moving averages, it works behind the scenes to detect "crossovers"—moments where the prevailing trend changes direction.

How the Logic Works

The script relies on a technical analysis method that measures the strength and direction of price movement. It specifically monitors two opposing forces:

  1. Positive Momentum: The upward pressure or "bullish" strength in the market.
  2. Negative Momentum: The downward pressure or "bearish" strength in the market.

By constantly comparing these two forces against each other, the script looks for a "cross." For example, if the upward momentum was previously stronger than the downward momentum but suddenly flips to become weaker, the tool recognizes a potential shift in sentiment.

Visual Signals on Your Chart

Instead of showing you every fluctuation in the market, the script only reacts when a definitive crossover occurs. When these conditions are met, it places visual markers directly on your candles:

  • Bearish Signal: When the upward momentum drops below the downward momentum, a marker is placed near the top of the price candle. This serves as a visual cue that the selling pressure may be taking over.
  • Bullish Signal: When the downward momentum drops below the upward momentum, a marker is placed near the bottom of the price candle. This serves as a visual cue that buying pressure may be becoming dominant.

Summary for the Trader

Think of this script as an automated "trend-watcher." It filters out the daily noise and only alerts you when the balance of power shifts from buyers to sellers (or vice versa). By highlighting these specific transition points, it aims to help you identify potential entry or exit zones where the market's direction might be changing.

Indicators Used
Movement directional index
Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
ADXcrosses_v2
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//| FirstIndicator.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_color2 Red
//---- input parameters
extern int a=14;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];

double b4plusdi,b4minusdi,nowplusdi,nowminusdi;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW,EMPTY);
SetIndexArrow(0,233);
SetIndexBuffer(0, ExtMapBuffer1);

SetIndexStyle(1,DRAW_ARROW,EMPTY);
SetIndexArrow(1,234);
SetIndexBuffer(1, ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
ObjectDelete("up cross"); 
ObjectDelete("down cross"); 


//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);

//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=1000-counted_bars;
//---- macd counted in the 1-st buffer

 for(int i=limit; i>=0; i--)
{
   b4plusdi=iADX(NULL,0,a,PRICE_CLOSE,MODE_PLUSDI,i-1);
   nowplusdi=iADX(NULL,0,a,PRICE_CLOSE,MODE_PLUSDI,i);
   
   b4minusdi=iADX(NULL,0,a,PRICE_CLOSE,MODE_MINUSDI,i-1);
   nowminusdi=iADX(NULL,0,a,PRICE_CLOSE,MODE_MINUSDI,i);
    
 if(b4plusdi>b4minusdi &&
         nowplusdi<nowminusdi)
     //       {
            ExtMapBuffer1[i]=Low[i]-5*Point;
      //      }
 if(b4plusdi<b4minusdi &&
         nowplusdi>nowminusdi)
      //   {
            ExtMapBuffer2[i]=High[i]+5*Point;
     //    }
}
//----
return(0);
}


Comments