Dear All,
This up/down PIPs count indior counts at first the lead bid rate. It must count 0 up down pips at starting of count and after that it's to count normally. Starting first counting bar is the problem can some 1 fix this situation? The indior is under attached.
Regards,
Vinay
#property indior_separate_window
#property indior_buffers 2
#property indior_color1 Green
#property indior_color2 Crimson
//-- buffers
//extern int MaxDrawBars=20;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double CurrentTick;
double PreviousTick;
// ------------------------------------------------------------------
//| Custom indior initialization function |
// ------------------------------------------------------------------
int init()
//-- indiors
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 indior deinitialization function |
// ------------------------------------------------------------------
int deinit()
//--
//--
return(0);
// ------------------------------------------------------------------
//| Custom indior iteration serve |
// ------------------------------------------------------------------
int start()
int I, limit=1;
PreviousTick = CurrentTick;
CurrentTick = Bid;
//--
for(I = 0; I lt; limit; I )
if(CurrentTick gt; PreviousTick) ExtMapBuffer1 = CurrentTick - PreviousTick;
if(CurrentTick lt; PreviousTick) ExtMapBuffer2 = PreviousTick - CurrentTick;
return(0);
// ------------------------------------------------------------------