ZigZag

 

How would I go about getting data from the default custom indicator "ZigZag" in my expert advisor? I know how to use the iCustom function, but don't know what to use for the last 3 variables.

Any help would be greatly appreciated.

 
Kesh:
How would I go about getting data from the default custom indicator "ZigZag" in my expert advisor? I know how to use the iCustom function, but don't know what to use for the last 3 variables. Any help would be greatly appreciated.

the last patameter to iCustom is the bar shift, the one before it is the indicator buffer (starting from 0).

Before the last 2 parameters (that I just describe, u enter the values of all the extern values of the indicator. In your case look at the indicator and find the lines

//---- indicator parameters

extern int ExtDepth=12;

extern int ExtDeviation=5;

extern int ExtBackstep=3;

//---- indicator buffers

double ExtMapBuffer[];

double ExtMapBuffer2[];

as u can see there are 3 values and 2 buffers.

the line of code should look like:

double zzUpper = iCustome(NULL,0,"ZigZag",12,5,3,0,0); // from 1st buffer

double zzLower = iCustome(NULL,0,"ZigZag",12,5,3,1,0); // from 2nd buffer

Most of the values will be 0 (when there is no zigzag value)

Hope it will help you

Eli

 
elihayun:
the last patameter to iCustom is the bar shift, the one before it is the indicator buffer (starting from 0).

Before the last 2 parameters (that I just describe, u enter the values of all the extern values of the indicator. In your case look at the indicator and find the lines

//---- indicator parameters

extern int ExtDepth=12;

extern int ExtDeviation=5;

extern int ExtBackstep=3;

//---- indicator buffers

double ExtMapBuffer[];

double ExtMapBuffer2[];

as u can see there are 3 values and 2 buffers.

the line of code should look like:

double zzUpper = iCustome(NULL,0,"ZigZag",12,5,3,0,0); // from 1st buffer

double zzLower = iCustome(NULL,0,"ZigZag",12,5,3,1,0); // from 2nd buffer

Most of the values will be 0 (when there is no zigzag value)

Hope it will help you

Eli

Thanks for your help!

I have gotten my expert advisor to output data from the indicator, but am having trouble making sense of it. It usually outputs 0 for both upper and lower, but sometimes it displays a value (i.e. 1.3423) for the upper and occasionaly the lower. When does it output data? What is the diffrence beetween upper and lower?

 

ZigZag is a serial of upper and lower values. If u see a line from one price to another, then in the indicator you will get the lower price in the "lowpricebuffer" and the higher price in the "highpricebuffer" . So, between the low and high u get zeros.

 

Hi,

I want to code an EA based on the Zigzag indicator. So if I want to know the last high or the last low, then I can simply create a loop, increasing the shift, and stop as soon as I get a value? Is that right?

What do the ZigzagBuffer, HighMapBuffer and LowMapBuffer contain? in the example above, mode should be 1 and 2 instead of 0 and 1 for the mode, no?

cheers,

Daniel

 

Please somebody who knows the code for it, simply post the code for the usage of ZigZag to find last 6 values of ZigZag custom indicator. I think it will be interesting to many. 6 because we ignore the last value (it is being redrawn) and need 2 last highs and 2 last lows. 6-th value just in case.

 

zigzag

Kesh:
How would I go about getting data from the default custom indicator "ZigZag" in my expert advisor? I know how to use the iCustom function, but don't know what to use for the last 3 variables. Any help would be greatly appreciated.

int n, i;

double zag, zig;

i=0;

while(n<2)

{

if(zig>0) zag=zig;

zig=iCustom(NULL, 0, "ZigZag", 0, i);

if(zig>0) n+=1;

i++;

}now you have two numbers zig -- last value and zag -- value before that

if(zag>zig) indicator shows down

if(zig>zag) indicator shows up

 

Zig-zag Ea

Hey There,

I to am trying to find someone to help me build an EA with a non-lagging zig-zag indicator & a zig-zag pointer.

I have been using them manually with pretty good results.

The can be used on short term charts but are way better on 4 hour or higher.

I can show you how its works if you are interested.

Any reply would be greatly appreciated.

Bear-

 
bigbear3391:
Hey There,

I to am trying to find someone to help me build an EA with a non-lagging zig-zag indicator & a zig-zag pointer.

I have been using them manually with pretty good results.

The can be used on short term charts but are way better on 4 hour or higher.

I can show you how its works if you are interested.

Any reply would be greatly appreciated.

Bear-

I`ve been always a fan of Zig Zag indicators can you pls share Non lagging Zig Zag indicator. Thx.

 

MultiZigZag by nen

Mladen,

I have this MultiZigZag but it seems not working anymore on MT4 build 670... Could you check it please? Thanks.

multizigzag.mq4

Files:
multizigzag.mq4  20 kb
 
wccmcd:
Mladen,

I have this MultiZigZag but it seems not working anymore on MT4 build 670... Could you check it please? Thanks.

multizigzag.mq4

wccmcd

It works for me on build 670 without any change :

Files:
Reason: