Volume Ticks Separate
Download scriptThe TicksSeparateVolume indicator is designed to provide traders with a more nuanced view of market activity by breaking down the total trading volume into two distinct categories: "Buy" and "Sell" pressure. Rather than showing you a single lump sum of total volume, this tool attempts to differentiate how much of that activity was driven by upward price movement versus downward price movement.
How the Logic Works
The indicator operates by analyzing the relationship between three key data points for every bar on your chart:
- Total Volume: The actual amount of 거래 (trading) activity.
- Opening Price: Where the price started for that period.
- Closing Price: Where the price ended for that period.
To determine the split, the script calculates the "price range" covered during a specific period. It then uses this range to mathematically estimate how much of the total volume was contributed by "Up" movements and how much was contributed by "Down" movements.
Essentially, it takes the total volume and splits it into two proportions based on the price movement observed within that timeframe. This allows you to visualize whether a specific candle was fueled more by aggressive buying or heavy selling pressure.
Visual Presentation
The tool provides two primary ways to view this data:
- Historical Histogram: The indicator generates a dual-color histogram at the bottom of your trading window. One color represents the estimated "Up Ticks" (buying pressure) and the other represents "Down Ticks" (selling pressure). This makes it easy to see historical trends and shifts in market sentiment over time.
- Real-Time Data Labels: In addition to the visual bars, the script generates live text labels on your screen. These labels provide the exact numerical values for both the "Buy Volume" and "Sell Volume" for the most recent candle, allowing for a quick, glanceable summary of current market pressure without having to interpret the histogram alone.
By using this indicator, you can better identify whether a price move is being supported by strong buying conviction or if it is being pushed primarily by selling momentum, helping you make more informed decisions during volatile market conditions.
//+------------------------------------------------------------------+
//| TicksSeparateVolume.mq4 |
//| Copyright © 2008, FOREXflash. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, FOREXflash Software Corp."
#property link "http://www.metaquotes.net"
//-----
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_minimum 0
#property indicator_color1 SteelBlue
#property indicator_color2 Red
double UpTicks[];
double DownTicks[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorShortName("TicksVolume("+Symbol()+")");
SetIndexBuffer(0,UpTicks);
SetIndexBuffer(1,DownTicks);
SetIndexStyle(0,DRAW_HISTOGRAM,0,1);
SetIndexStyle(1,DRAW_HISTOGRAM,0,1);
SetIndexLabel(0,"UpTicks");
SetIndexLabel(1,"DownTicks");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("UpTicks1");
ObjectDelete("DownTicks1");
ObjectDelete("UpTicks2");
ObjectDelete("DownTicks2");
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| Ticks Volume Indicator |
//+------------------------------------------------------------------+
int start()
{
ObjectDelete("UpTicks1");
ObjectDelete("DownTicks1");
ObjectDelete("UpTicks2");
ObjectDelete("DownTicks2");
int i,counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
//----
for(i=0; i<limit; i++)
{
UpTicks[i]=(Volume[i]+(Close[i]-Open[i])/Point)/2;
DownTicks[i]=Volume[i]-UpTicks[i];
}
string BV="BUY VOLUME : "+DoubleToStr(UpTicks[0],0)+"";
string SV="SELL VOLUME: "+DoubleToStr(DownTicks[0],0)+"";
ObjectCreate("UpTicks2", OBJ_LABEL, WindowFind("TicksVolume("+Symbol()+")"), 0, 0);
ObjectSetText("UpTicks2",StringSubstr((BV),0), 7, "Tahoma Bold" ,White);
ObjectSet("UpTicks2", OBJPROP_CORNER, 0);
ObjectSet("UpTicks2", OBJPROP_XDISTANCE, 5);
ObjectSet("UpTicks2", OBJPROP_YDISTANCE, 15);
ObjectCreate("DownTicks2", OBJ_LABEL, WindowFind("TicksVolume("+Symbol()+")"), 0, 0);
ObjectSetText("DownTicks2",StringSubstr((SV),0), 7, "Tahoma Bold" ,White);
ObjectSet("DownTicks2", OBJPROP_CORNER, 0);
ObjectSet("DownTicks2", OBJPROP_XDISTANCE, 5);
ObjectSet("DownTicks2", OBJPROP_YDISTANCE, 25);
//----
return(0);
}
//+------------------------------------------------------------------+
Comments