Author: Copyright � 2010, MT-Coder.
Change

This indicator is designed to provide a clear, visual representation of price volatility by tracking the percentage change between consecutive candles on a trading chart. Instead of looking at raw price movements—which can vary significantly depending on the asset or the timeframe—this tool standardizes that movement into a relative percentage.

How it Works

The logic focuses on comparing the closing price of the most recent period to the closing price of the period immediately preceding it. By calculating this difference as a percentage, the indicator allows traders to see how much the price has moved in proportion to its previous value.

Visual Representation

The tool organizes these movements into two distinct categories to help with quick visual identification:

  • Positive Movement: When the price closes higher than the previous period, the change is calculated as a positive percentage and displayed as an upward histogram.
  • Negative Movement: When the price closes lower than the previous period, the change is calculated as a negative percentage and displayed as a downward histogram.

Key Benefits for Traders

By shifting the focus from absolute price points to percentage-based changes, this indicator helps users:

  • Normalize Volatility: Easily compare price swings across different instruments (e.g., comparing a 10-pip move in Forex to a 10-point move in Stocks).
  • Identify Momentum: Quickly gauge the strength of a trend by observing the height of the histograms.
  • Simplify Analysis: The use of separate colors for upward and downward movements allows for an immediate visual summary of market sentiment at a glance.
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
Change
//+------------------------------------------------------------------+
//|                 This has been coded by MT-Coder                  |
//|                                                                  |
//|                     Email: mt-coder@hotmail.com                  |
//|                      Website: mt-coder.110mb.com                 |
//|                                                                  |
//|       For any strategy that you have in mind, any idea,          |
//|        to make it an Expert Advisor or a Custom Indicator        |
//|                                                                  |
//|          Don't hesitate to contact me at mt-coder@hotmail.com    |
//|            Or on the Website: mt-coder.110mb.com                 |
//|                                                                  |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|   This indicator simply shows the change in percentage between   |
//|    the Close of the current period and the previous one.         |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MT-Coder."
#property link      "http://mt-coder.110mb.com/"

#property indicator_separate_window

#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red



//---- buffers
double UpBuffer[];
double DnBuffer[];
//----
int Clen=1;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
   //----                                        
   IndicatorBuffers(2);
   IndicatorDigits(Digits);
//---- indicator line
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,UpBuffer);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(1,DnBuffer);

  
   
//---- name for DataWindow and indicator subwindow label
   short_name="MT-Coder.110mb.com | Change %";
   IndicatorShortName(short_name);
   SetIndexLabel(0,"Up");
   SetIndexLabel(1,"Down");
  


//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
//----
 //----
   if(Bars<=Clen) return(0);
//---- 
  
   if(counted_bars>=Clen) i=Bars-counted_bars-1;
   while(i>=0)
     {  

   if(((Close[i]-Close[i+1])/Close[i+1])>=0)
      UpBuffer[i]=((Close[i]-Close[i+1])/Close[i+1])*100;
   else
      DnBuffer[i]=((Close[i]-Close[i+1])/Close[i+1])*100;

i++;
   }
//----

   return(0);
  }
//+------------------------------------------------------------------+

Comments