Hi,
I use standard Zigzag indy in my EA. I use the following code to determine the Zigzag nodes. I noticed that sometimes the MT4 returns the Zigzag nodes from the wrong time frame. I use loop to change TF value from PERIOD_H1 to PERIOD_H4, and to PERIOD_M15.
I am not sure if anyone has similar problem with MT4 returning wrong Zigzag values. Any help will be appreciated. Many Thanks.
FFJason
I use standard Zigzag indy in my EA. I use the following code to determine the Zigzag nodes. I noticed that sometimes the MT4 returns the Zigzag nodes from the wrong time frame. I use loop to change TF value from PERIOD_H1 to PERIOD_H4, and to PERIOD_M15.
PHP Code
void vGetNode2(int TF,double& lwnd2[2],double& hgnd2[2]) { int t=0; int p=0; int q=0; double nd2i; for (i=0; i<=150; i++) { nd2i=iCustom(NULL,TF,"ZigZag",13,8,5,0,i); if (nd2i==iLow(NULL,TF,i)) {if (p<=1) {lwnd2=nd2i; p++;}} if (nd2i==iHigh(NULL,TF,i)) {if (q<=1) {hgnd2[q]=nd2i; q++;}} if (p==2 && q==2) break; } return; }
FFJason