Author: Wylie
AA iMAX

The iMAX indicator is a sophisticated technical analysis tool designed to filter out market "noise" and identify underlying price trends more clearly. It is based on professional trading methodologies, specifically utilizing the "Modified Optimum Elliptic Filter" and "Optimal Detrending" concepts.

Instead of simply following the raw price action, which can often be erratic or misleading due to minor fluctuations, this script processes data to create a smoother representation of market momentum. Here is a breakdown of how the logic works:

Core Methodology

The indicator focuses on the relationship between the high and low points of price candles over a specific period. By calculating these extremes, the tool seeks to establish a "baseline" of where the price is actually heading, rather than just reacting to every small tick up or down.

Technical Execution

The logic operates through several distinct stages:

  • Data Weighting: The script assigns specific mathematical weights to the current and previous price points. This ensures that recent movements have a significant impact on the calculation while maintaining a balance with historical data to prevent the indicator from being overly reactive.
  • Smoothing & Filtering: It uses a recursive calculation method. This means that each new value is partially derived from the previous values calculated by the script. This creates a flowing, continuous line that eliminates sudden "spikes," making it easier for a trader to see the prevailing direction of the market.
  • Trend Isolation: By applying these specific coefficients (the numerical constants used in the formula), the indicator effectively "detrends" the price. It strips away the temporary volatility to reveal the smoother, longer-term trajectory.

Visual Output

The indicator renders two distinct lines on your chart:

  1. The Primary Trend Line: A solid green line that represents the filtered price action derived from the current data.
  2. The Shifted Reference Line: A magenta line that provides a slight offset of the primary trend. By comparing these two lines, traders can better observe momentum shifts, potential reversals, and the strength of the current trend.

Summary for Traders

In short, this tool is designed for clarity. Rather than forcing you to interpret every jagged movement of a price chart, the iMAX logic synthesizes complex price data into two smooth indicators. This allows you to identify the "true" direction of the market with greater precision, helping to filter out distractions and focus on the overarching trend.

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
AA iMAX
/*+-------------------------------------------------------------------+
  |                                                          iMAX.mq4 |
  |                                                                   |
  | "Modified Optimum Elliptic Filter"                                |
  | Source of calculations:                                           |
  | Stocks & Commodities vol 18:7 p20-29                              |
  | Optimal Detrending by John F. Ehlers                              |
  |                                                                   |
  |                                                    Coded by Wylie |
  |                                              dazzle.html@live.com |
  +-------------------------------------------------------------------+*/

#property copyright "Wylie"
#property link      "dazzle.html@live.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LawnGreen
#property indicator_color2 Magenta
#property indicator_width1 2
#property indicator_width2 2

extern int Ph2shiftRed = 1;

int buffers = 2;
int MinBars;

double ExtMapBuffer0[];
double ExtMapBuffer1[];

int init()
{
 IndicatorBuffers(2);

 // Index Buffer 0

 SetIndexBuffer(0,ExtMapBuffer0);
 SetIndexShift(0,0);
 SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,LawnGreen);

 // Index Buffer 1

 SetIndexBuffer(1,ExtMapBuffer1);
 SetIndexShift(1,0);
 SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2,Magenta);

 IndicatorShortName("iMAX");
 MinBars = 20;

 return (0);
} // int init()
  
int start()
{    
 if(Bars <= MinBars){return (0);}

 int countedBars = IndicatorCounted();

 if(countedBars < 0){return (-1);}
 if(countedBars > 0){countedBars--;}

 int c,limit = Bars - countedBars - 1;
 double x = 0.5;

 for(c = limit;c >= 0;c--)
     {ExtMapBuffer0[c] = (0.13785 * (2 * ((High[c]   + Low[c])   * x) - ((High[c+1] + Low[c+1]) * x)))
                       + (0.0007  * (2 * ((High[c+1] + Low[c+1]) * x) - ((High[c+2] + Low[c+2]) * x)))
                       + (0.13785 * (2 * ((High[c+2] + Low[c+2]) * x) - ((High[c+3] + Low[c+3]) * x)))
                       + (1.2103  * ExtMapBuffer0[c + 1] - 0.4867 * ExtMapBuffer0[c + 2]); 

      ExtMapBuffer1[c] = ExtMapBuffer0[c+Ph2shiftRed];
     } // for(c = limit;c >= 0;c--)

 return (0);  
} // int start()

/*+-------------------------------------------------------------------+
  |                                                                   |
  +-------------------------------------------------------------------+*/

Comments