Chaikin's Volatility_v1

Download script
Author: Kalenzo
Chaikin's Volatility_v1

This technical tool is designed to analyze market behavior by focusing on price fluctuations and the momentum behind those movements. Rather than looking at simple price points, it calculates the intensity of "volatility"—essentially measuring how much the price is swinging over a specific period of time.

The logic follows a three-step process to derive its final data:

1. Measuring Price Spread First, the script looks at each individual candle on your chart to determine the difference between the highest and lowest prices reached. This provides a raw measurement of the "range" for that specific moment in time.

2. Smoothing the Data Because raw price swings can be erratic and "noisy," the script applies a moving average to those ranges. This smooths out the data, making it easier to identify the general trend of volatility rather than getting distracted by minor, insignificant spikes.

3. Calculating Momentum Change The final output is generated by comparing the smoothed volatility of the current period against its value from a set number of bars back. By calculating the percentage difference between these two points, the script reveals whether the market's volatility is expanding or contracting.

Summary for the Trader In practical terms, this indicator helps you visualize the "energy" of the market. Instead of just showing you where the price is going, it highlights how aggressively the price is moving. A rising trend in this indicator suggests increasing market activity and wider price swings, while a falling trend indicates that the market is becoming quieter or more consolidated.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
Chaikin's Volatility_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                         Chaikin's Volatility.mq4 |
//|                                                          Kalenzo |
//|                                      bartlomiej.gorski@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link      "bartlomiej.gorski@gmail.com"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DeepSkyBlue
 
//---- input parameters
extern int       iPeriod=10;
extern int       maPeriod=10;
//---- buffers
double chakin[];
double hl[];
double emahl[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(3);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,chakin);
   
   SetIndexBuffer(1,hl);
   SetIndexBuffer(2,emahl);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars<0) counted_bars=0;
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
   for(int c = 0 ;c <= limit ;c++) hl[c]=High[c]-Low[c];
   for(int e = 0 ;e <= limit ;e++) emahl[e]= iMAOnArray(hl,0,maPeriod,0,MODE_EMA,e);
   
   for(int i = 0 ;i <= limit-20 ;i++)
   {
      
      chakin[i] = ( (emahl[i]-emahl[i+iPeriod])/emahl[i+iPeriod] ) *100;  
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments