Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
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.
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)
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.
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?
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.
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