Hi. I read the new post "Pivot signal" by LordTwig where he mentions "how many Buys and How many Sells have occurred in timeframes" and I have found the TicksSeparateVolume which shows how many up and down ticks for every candle in a chosen time frame with green (buyers) and red (sellers) bars and a numbers display. I addition I repost the TheTick oscillator which shows the result or weight of each volume in relations to a zero line. I think both indicators together gives a very good picture and perspective of what is going on.
The TicksSeparateVolume confirms that the TheTick is exactly the kind of tick oscillator I have been looking for. The thing I do not like about the MT4 version of TheTick is that because of the auto scale function of MT4 the lower volume lines sometimes gets too truncated when higher volume lines appears. Maybe this would be better in a Marketscope version.
If you guys could make both these indicators, that would be great. I have added the MT4 formulas for both and two pictures below for different time frames which shows how the two indicators looks like and confirms each other.
Thanks,
Laurus12
*******************************************************************************
TicksSeparateVolume:
**************************
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_minimum 0
#property indicator_color1 SeaGreen
#property indicator_color2 Crimson
double UpTicks[];
double DownTicks[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorShortName("TicksSeparateVolume("+Symbol()+")");
SetIndexBuffer(0,UpTicks);
SetIndexBuffer(1,DownTicks);
SetIndexStyle(0,DRAW_HISTOGRAM,0,3);
SetIndexStyle(1,DRAW_HISTOGRAM,0,2);
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="BUYERS (GREEN VOLUME): "+DoubleToStr(UpTicks[0],0)+"";
string SV="SELLERS (RED VOLUME): "+DoubleToStr(DownTicks[0],0)+"";
ObjectCreate("UpTicks2", OBJ_LABEL, WindowFind("TicksSeparateVolume("+Symbol()+")"), 0, 0);
ObjectSetText("UpTicks2",StringSubstr((BV),0), 10, "Tahoma" ,Black);
ObjectSet("UpTicks2", OBJPROP_CORNER, 0);
ObjectSet("UpTicks2", OBJPROP_XDISTANCE, 6);
ObjectSet("UpTicks2", OBJPROP_YDISTANCE, 22);
ObjectCreate("DownTicks2", OBJ_LABEL, WindowFind("TicksSeparateVolume("+Symbol()+")"), 0, 0);
ObjectSetText("DownTicks2",StringSubstr((SV),0), 10, "Tahoma" ,Black);
ObjectSet("DownTicks2", OBJPROP_CORNER, 0);
ObjectSet("DownTicks2", OBJPROP_XDISTANCE, 6);
ObjectSet("DownTicks2", OBJPROP_YDISTANCE, 42);
//----
return(0);
}
//+------------------------------------------------------------------+
*******************************************************************************
TheTick:
**********
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
double TheTick[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,TheTick);
SetIndexDrawBegin(0,5);
SetLevelStyle(1,1,Black);
SetLevelValue(0, 0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//---- Loop Prep
int Limit; int Count; int PrevDay;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1); // Check for error
if(counted_bars>0) counted_bars--; // Last counted bar will be recounted
Limit = Bars-counted_bars;
double Multiplier = 0;
if( StringFind( Symbol(), "JPY", 0) != -1 )
{
Multiplier = 0.1;
}
else
{
Multiplier = 100.0;
}
for( int i = 0; i < Limit; i++ )
{
TheTick[i] = ( ( Close[i] - Open[i] ) * Volume[i] ) * Multiplier ;
}
//----
return(0);
}
//+------------------------------------------------------------------+