Author: Copyright � 2011, EADeveloper
mnl_price

This tool is designed as a visual aid for traders to analyze price movement by creating a customized mathematical representation of the market. Rather than showing standard prices, it processes raw data into a unique format that highlights specific fluctuations.

How the Logic Works

1. The Base Calculation The script begins by looking at the relationship between two different points in time on the chart. It takes the current closing price and compares it against a previous price (determined by a user-defined "Alpha" offset). By performing a specific division of these two values, the tool calculates a relative percentage shift. This creates a foundational data set that represents how much the price has moved or shifted relative to its past position.

2. Data Smoothing Once this raw difference is calculated, the script applies two different layers of smoothing to make the data easier to read and more stable for analysis:

  • Fast Trend: It applies a Simple Moving Average to the calculated shifts. This helps in identifying immediate, short-term movements in the price momentum.
  • Slow Trend: It applies an Exponential Moving Average to the same data. Because this is an "exponential" calculation, it gives more importance to the most recent information, helping traders see the broader, weighted direction of the trend.

Visual Representation

The final output appears in a separate window below your main price chart. Instead of looking at messy candles, you see two distinct lines:

  • One line (Red) represents the fast-moving average, capturing quick reactions in the market.
  • The second line (Gold) represents the slower-moving average, providing a clearer picture of the prevailing trend.

Summary for the User

Essentially, this script filters out the "noise" of standard price action. By calculating the percentage difference between price points and then smoothing those results into two different types of averages, it allows you to see the underlying momentum of the market more clearly. It turns raw price changes into a visual "momentum map" that helps you identify when trends are strengthening or weakening.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
mnl_price
//+------------------------------------------------------------------+
//|                                                    mnl_price.mq4 |
//|                                    Copyright © 2011, EADeveloper |
//|                                                                  |
//+------------------------------------------------------------------+



#property copyright "Copyright © 2011, EADeveloper"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Gold

extern int Alpha=3;
extern int MAPeriodeFast=3;
extern int MAPeriode=25;


//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
IndicatorBuffers(3);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer2);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer3);
   SetIndexBuffer(2,ExtMapBuffer1);
   IndicatorShortName("mnl_price"); 

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double v0=0;double v1=0;
   double a1;
   int limit;
   
     int counted_bars=IndicatorCounted();
     if(counted_bars<0) return(-1);
     if(counted_bars>0) counted_bars--;
     limit=Bars-counted_bars;
   for(int i=0; i<limit; i++)
   {
   v0=Close[i];
   v1=Close[i+Alpha];   
   if (v0>0&&v1>0)
   {
   a1=(v0/(v1/100));
   ExtMapBuffer1[i]=(a1-100);
   }
   }
   for(int z=0; z<limit; z++)
   {
   ExtMapBuffer2[z]=iMAOnArray(ExtMapBuffer1,0,MAPeriodeFast,0,MODE_SMA,z) ; 
   }
   for(z=0; z<limit; z++)
   {
   ExtMapBuffer3[z]=iMAOnArray(ExtMapBuffer1,0,MAPeriode,0,MODE_EMA,z) ; 
   }
   return(0);
  }
//+------------------------------------------------------------------+

Comments