
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How to use this ZigZag indicator from EA
Hi all,
I have this indicator which I want to use from my EA.
ZigZag.mq4 - original
ZigZagAlex.mq4 - I tried to add one more buffer to read value
I tried to read value with something like this:
alMNAL0 = iCustom(NULL,15,"ZigZagAlex",1,0);
alMNAL1 = iCustom(NULL,15,"ZigZagAlex",1,1);
but I always get alMNAL1 = 0 ... and alMNAL0=21........... (huge number)
Can somebody help me to fix indicator so when it is setup from indicator CrossC = 1; that my alMNAL0 read 1 and for CrossC = -1; that my alMNAL0 is -1 ... in all other situations (when arrow is not printed) that alMNAL0 to be 0.
Thanks in advance
Sorted
Hi,
I solved it by:
alMNAL0 = iCustom(NULL,alperiod,"ZigZag",0,0);
alMNAL1 = iCustom(NULL,alperiod,"ZigZag",1,0);
So I check just last bar if any arrow so I buy or sell.
If I can help to somebody somehow - please let me know.
Aleksandar
nice post.. do onething.. if you use zigzag indicator please use rsi or stoch indicator for trend confirmation.. other wise it will repaint
Hi,
I solved it by:
alMNAL0 = iCustom(NULL,alperiod,"ZigZag",0,0);
alMNAL1 = iCustom(NULL,alperiod,"ZigZag",1,0);
So I check just last bar if any arrow so I buy or sell.
If I can help to somebody somehow - please let me know.
AleksandarHi Aleksandar!
Where excatly you add these two lines?
Thanks in advance!
meroka
Hi Aleksandar!
Where excatly you add these two lines?
Thanks in advance!
merokaHi,
Easiest for me is to have one calling function on the top of START function such as: TakeValues();
and on the bottom to have that function:
void TakeValues()
{
alMNAL0 = iCustom(NULL,alperiod,"ZigZag",0,0);
alMNAL1 = iCustom(NULL,alperiod,"ZigZag",1,0);
//--------------------------------------------------------------------
return(0);
}
So everywhere in code you can use those two global variables
Hope it helps
Hi Aleksandar,
All this happen because I'm beginner.
I put those lines (colored red) bottom like this
}
GSignals=GSignalUP+GSignalDOWN;
GSignalsP=GSignals/AllSignal;
GSignalUPP=(GSignalUP/SignalUP);
GSignalDOWNP=(GSignalDOWN/SignalDOWN);
int www=GSignalsP*100 ;
}
void TakeValues()
{
alMNAL0 = iCustom(NULL,alperiod,"ZigZag",0,0);
alMNAL1 = iCustom(NULL,alperiod,"ZigZag",1,0);
//--------------------------------------------------------------------
return(0);
}
BUT I got 4 errors
'alMNAL0' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (188, 1)
'alperiod' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (188, 24)
'alMNAL1' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (189, 1)
'alperiod' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (189, 24)
Thanks again
BUT I got 4 errors
'alMNAL0' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (188, 1)
'alperiod' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (188, 24)
'alMNAL1' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (189, 1)
'alperiod' - variable not defined C:\Program Files\NordMarkets MetaTrader\experts\indicators\ZigZagAlex.mq4 (189, 24)
Thanks againOn the top of the script you have to define those three variables like:
int alperiod= 5;
double alMNAL0 = 0.01;
double alMNAL1 = 0.01;
On the top of the script you have to define those three variables like:
int alperiod= 5;
double alMNAL0 = 0.01;
double alMNAL1 = 0.01;Hi,
Thanks Aleksandar. Now it works.
meroka
No problem
ANY code for identify zigzag
i'm newbie here and now ihave problem for zigzag indicator
about identified
last top and bottom of zigzag line (or if ican identified other as top 1 ,top 2 , top3 from zigzag indicator ) and use it into calculation such last top + last bottom /2
so plz give me that code
ps.1 i post cause can't find any result from my own serch so plz post the code here , thk for any help
ps.2 "Wave Power EA" is the free EA that i see it really run smooth growth , don't sure load from where