CDRW Volume
Download scriptThis tool is designed to provide traders with a visual representation of market activity by analyzing changes in trading volume over time. Rather than simply showing how much volume occurred, it categorizes that volume into three distinct behaviors to help identify shifts in market momentum.
How the Analysis Works
The logic operates by looking at the current bar's volume and comparing it to the volume of the two preceding bars. By establishing this three-point comparison, the script determines whether the intensity of trading is increasing, decreasing, or remaining steady.
The tool classifies these movements into three specific categories:
- Expanding Volume (Growth): This occurs when the current volume is higher than both of the previous two bars. It signifies a surge in activity, often indicating that aggressive buying or selling pressure is entering the market.
- Contracting Volume (Recession): This is triggered when the current volume is lower than both of the previous two bars. This suggests a cooling-off period where market participation is drying up.
- Neutral Volume: If the current volume does not meet the specific "higher than both" or "lower than both" criteria, it is categorized as neutral. This represents stable activity where no significant trend shift in volume is detected.
Visual Representation
To make these insights easy to read at a glance, the tool uses a color-coded histogram displayed in a separate window on your chart:
- Lime Green: Highlights "Expanding Volume" (Increasing momentum).
- Red: Highlights "Contracting Volume" (Decreasing momentum).
- Yellow: Represents "Neutral Volume" (Steady activity).
Key Features
- Historical Context: The tool scans a specific number of past bars (customizable by the user) to ensure you can see trends over a significant period rather than just looking at the most recent tick.
- Simplified Data: By filtering out the "noise" of standard volume charts, this script allows you to focus specifically on the acceleration and deceleration of market participation.
#property copyright ""
#property link ""
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Yellow
extern int NumberOfBars = 300;
double up[],dn[],flat[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,up);
SetIndexStyle(0,DRAW_HISTOGRAM,0,3);
SetIndexLabel(0,"Expanding Volume");
SetIndexBuffer(1,dn);
SetIndexStyle(1,DRAW_HISTOGRAM,0,3);
SetIndexLabel(1,"Contracting Volume");
SetIndexBuffer(2,flat);
SetIndexStyle(2,DRAW_HISTOGRAM,0,3);
SetIndexLabel(2,"Neutral Volume");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double v0,v1,v2;
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=NumberOfBars; //Bars-counted_bars;
for(int i=0; i<limit; i++)
{
up[i] = 0; dn[i] = 0;
v0 = iVolume(NULL,0,i);
v1 = iVolume(NULL,0,i+1);
v2 = iVolume(NULL,0,i+2);
flat[i] = v0;
if ( v0<v1 && v0<v2 )
{
dn[i] = v0;
flat[i] = 0;
}
if ( v0>v1 && v0>v2 )
{
up[i] = v0;
flat[i] = 0;
}
}
//----
//----
return(0);
}
//+------------------------------------------------------------------+
Comments