Dear All,
This up/down PIPs count indicator counts at first the direct bid rate. It has to count 0 for both up & down pips at starting of count and then it has to count normally. Starting first counting bar is the problem can some one fix this issue? The indicator is below & also attached.
Regards,
Vinay
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
//---- buffers
//extern int MaxDrawBars=20;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double CurrentTick;
double PreviousTick;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexEmptyValue(1,0.0);
SetIndexDrawBegin(0,1);
SetIndexDrawBegin(1,1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, limit=1;
PreviousTick = CurrentTick;
CurrentTick = Bid;
//----
for(i = 0; i < limit; i++)
{
if(CurrentTick > PreviousTick) ExtMapBuffer1 += CurrentTick - PreviousTick;
if(CurrentTick < PreviousTick) ExtMapBuffer2 += PreviousTick - CurrentTick;
}
return(0);
}
//+------------------------------------------------------------------+
This up/down PIPs count indicator counts at first the direct bid rate. It has to count 0 for both up & down pips at starting of count and then it has to count normally. Starting first counting bar is the problem can some one fix this issue? The indicator is below & also attached.
Regards,
Vinay
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
//---- buffers
//extern int MaxDrawBars=20;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double CurrentTick;
double PreviousTick;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexEmptyValue(1,0.0);
SetIndexDrawBegin(0,1);
SetIndexDrawBegin(1,1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, limit=1;
PreviousTick = CurrentTick;
CurrentTick = Bid;
//----
for(i = 0; i < limit; i++)
{
if(CurrentTick > PreviousTick) ExtMapBuffer1 += CurrentTick - PreviousTick;
if(CurrentTick < PreviousTick) ExtMapBuffer2 += PreviousTick - CurrentTick;
}
return(0);
}
//+------------------------------------------------------------------+