Its ok i decided to build from scratch no need to modify i just need to add a variable and compile will work.
shortEma = iCustom(NULL, 0, DEMA.mq4, 21, 0);
If i only knew what to add. =)
ERROR
'DEMA.mq4' - variable not defined C:\Program Files (x86)\MetaTrader - Alpari UK\experts\my_first_ea.mq4 (64, 29)
Its ok i decided to build from scratch no need to modify i just need to add a variable and compile will work.
If i only knew what to add. =)
ERROR
'DEMA.mq4' - variable not defined C:\Program Files (x86)\MetaTrader - Alpari UK\experts\my_first_ea.mq4 (64, 29)
Where have you looked for info ? the documentation ? iCustom() the forum search ? or didn't you bother and you just asked here ?
"DEMA" has one extern so you need to pass that in the iCustom call . . . for example (see below) also I suspect you have the wrong buffer number (21) . . .
shortEma = iCustom(NULL, 0, DEMA, 12, 0, 0); // Symbol, timeframe, Indicator name, Extern variables, buffer number, shift
Where have you looked for info ? the documentation ? iCustom() the forum search ? or didn't you bother and you just asked here ?
"DEMA" has one extern so you need to pass that in the iCustom call . . . for example (see below) also I suspect you have the wrong buffer number (21) . . .
I have been looking how to successfully add this indicator into an EA for months now because my charts currently wake me in the middle of the night to make a trade.
All the trades are valid so i follow the signal i just wanted to automate it but looks like my lack of programming knowledge stops me from going forward here.
I have been looking on this website, google search, have joined multiple of forums. Seems none use DEMA out there.
I think you for your attention and help.
Ps. i still get the same error even if i put 12 instead of 21. tried buffer 0-8. none worked.
Ps. i still get the same error even if i put 12 instead of 21. tried buffer 0-8. none worked.
Detailed explanation of iCustom - MQL4 forum
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I would like this Ea modified. Only thing that i would like changed is instead of the Fast MA indicator to use the custom indicator DEMA.
extern string MA1Method = "Simple"; Change to ICustom DEMA from standard MA.
extern string MA2Method = "Simple"; (KEEP AS IS)
------------------------------------------------------------------------------
I guess the code below would need to be completely changed as or mode_DEMA can be added and as long as it knows to look for DEMA as a custom indicator.
int MA1MethodSelected = 0;
//------------------ CLOSE -------------------------
if(MA1Method == "Simple") {MA1MethodSelected = MODE_SMMA; } change to call DEMA Icustom
else if(MA1Method == "SIMPLE") {MA1MethodSelected = MODE_SMMA; } change to call DEMA Icustom
else if(MA1Method == "S") {MA1MethodSelected = MODE_SMMA; } change to call DEMA Icustom
else if(MA1Method == "s") {MA1MethodSelected = MODE_SMMA; } change to call DEMA Icustom
else if(MA1Method == "simple") {MA1MethodSelected = MODE_SMMA; } change to call DEMA Icustom
I will attach the EA and the custom indicator if someone can show me how to use the ICUSTOM in this situation or if you can be so kind and modify the code so that MA1 looks at value of DEMA custom indicator instead.
I currently use Prorealtime to alert me when these crosses occur and then i manually enter into a trade.
Thank you in advance.