Trying to call icustom for Pivot

 

Hi,

I'm trying to build an EA that use Pivot point and when I called the indicator with the Icustom I'm

getting differnt levels from what I'm seeing in the chart.

someone can help me with it, or just give me a link for a good PIVOT indicator

that I can call him from my EA and get the same result as I see in the chart,

Thanks.

 

i don't think the problem is in the indicator more likely that the problem is in the EA code show the relevant code

 

pivot indicator that uses buffers.

Normal version and NO_SUNDAY version

http://www.when-money-makes-money.com/download/

 

hi, this is the pivot indicator that I wrot, what's worng with it?

int init()

{

//---- indicators

IndicatorBuffers(8);

SetIndexBuffer(0,PIVOT);

SetIndexStyle(0,DRAW_LINE);

SetIndexLabel(0,"Pivot");


SetIndexBuffer(1,R_1);

SetIndexStyle(1,DRAW_LINE);

SetIndexLabel(1,"R1");

SetIndexBuffer(2,S_1);

SetIndexStyle(2,DRAW_LINE);

SetIndexLabel(2,"S1");

int limit=Bars-counted_bars;

}

for( i=0; i<limit; i++) {

double H=iHigh(NULL,TF,iBarShift(NULL,TF,Time[i+1]));

double L=iLow(NULL,TF,iBarShift(NULL,TF,Time[i+1]));

double C=iClose(NULL,TF,iBarShift(NULL,TF,Time[i+1]));

double Pivot=(H+L+C)/3;

double R1=2*Pivot-L;

double S1=2*Pivot-H;

PIVOT[i]=Pivot;

R_1[i]=R1;

S_1[i]=S1;

}