Chaikin's Volatility_v2

Download script
Author: Kalenzo
Chaikin's Volatility_v2

Overview of Chaikin's Volatility Logic

This technical tool is designed to analyze market behavior by measuring changes in price volatility over specific periods. Instead of looking solely at the raw price of an asset, this script focuses on the "range" of movement—the distance between the highest and lowest prices reached during a given timeframe—to determine how much energy or momentum is present in the market.

How the Logic Works

The indicator operates through a multi-step calculation process to filter out market noise and highlight significant trends:

1. Measuring Price Range The tool begins by calculating the distance between the high and low price points for every candle on the chart. This creates a foundational data set that represents the "volatility" of the market at any given moment, regardless of whether the price is moving up or down.

2. Smoothing the Data (Moving Averages) To prevent the indicator from reacting too wildly to tiny, insignificant price flickers, the script applies two different types of "smoothing" filters:

  • Fast Smooth: A quicker calculation that captures more immediate shifts in volatility.
  • Slow Smooth: A broader calculation that identifies the longer-term trend of market activity.

By applying these averages, the tool ensures that the visual data represents steady trends rather than erratic jumps.

3. Calculating Momentum (The Chaikin Calculation) The core logic then compares the current smoothed volatility against its previous values from a set number of periods ago. It calculates the percentage difference between:

  • The current fast smoothness vs. a past point in time.
  • The current slow smoothness vs. an even further point back in history.

What This Means for the User

The resulting lines on your chart represent the rate of change in volatility.

  • When these values rise, it indicates that the range of price movement is expanding significantly compared to previous periods.
  • When these values fall, it suggests that the market's movements are compressing or stabilizing.

By comparing the "Fast" and "Slow" versions of this calculation, traders can better understand if a surge in volatility is a new development or part of a long-standing trend, helping to identify areas of high interest where market activity is accelerating or decelerating.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
6 Views
0 Downloads
0 Favorites
Chaikin's Volatility_v2
/*-----------------------------+
|			       |
| 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 5
#property indicator_color1 Red
#property indicator_color2 Blue
 
//---- input parameters
extern int       iPeriod=13;
extern int       maPeriod=13;
extern int       maSlowPeriod=26;

//---- buffers
double chakin[];
double Slowchakin[];
double hl[];
double emahl[];
double Slowemahl[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(5);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,chakin);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,Slowchakin);
   
   SetIndexStyle(2,DRAW_NONE);
   SetIndexBuffer(2,hl);
   SetIndexStyle(3,DRAW_NONE);
   SetIndexBuffer(3,emahl);
   SetIndexStyle(4,DRAW_NONE);
   SetIndexBuffer(4,Slowemahl);
//----
   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);
      Slowemahl[e]= iMAOnArray(hl,0,maSlowPeriod,0,MODE_EMA,e);
   }
   
   for(int i = 0 ;i <= limit-20 ;i++)
   {
      
      chakin[i] = ( (emahl[i]-emahl[i+iPeriod])/emahl[i+iPeriod] ) *100;  
      Slowchakin[i] = ( (Slowemahl[i]-Slowemahl[i+iPeriod])/Slowemahl[i+maSlowPeriod] ) *100; 
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments