//+----------------------------------------------------------------------------+//| Автор : Ким Игорь В. aka KimIV, http://www.kimiv.ru |//+----------------------------------------------------------------------------+//| Версия : 07.10.2006 |//| Описание : Возвращает экстремум ЗигЗага по его номеру. |//+----------------------------------------------------------------------------+//| Параметры: |//| sy - наименование инструмента (NULL или "" - текущий символ) |//| tf - таймфрейм ( 0 - текущий ТФ) |//| ne - номер экстремума ( 0 - последний) |//| dp - ExtDepth |//| dv - ExtDeviation |//| bs - ExtBackstep |//+----------------------------------------------------------------------------+double GetExtremumZZPrice(string sy="", int tf=0, int ne=0, int dp=12, int dv=5, int bs=3) {
if (sy=="" || sy=="0") sy=Symbol();
double zz;
int i, k=iBars(sy, tf), ke=0;
for (i=1; i<k; i++) {
zz=iCustom(sy, tf, "ZigZag", dp, dv, bs, 0, i);
if (zz!=0) {
ke++;
if (ke>ne) return(zz);
}
}
Print("GetExtremumZZPrice(): Экстремум ЗигЗага номер ",ne," не найден");
return(0);
}
Hello.
Can you tell me how I can paste the function attached here into the EA code to make it work?
I tried just to copy and paste it after Int Start(). I guess it's not that simple?
int start()
{
// ...double ZZ = GetExtremumZZPrice(Symbol(), 0, 0, 12, 5, 3);
// ...
}
// а функцию можно вставить например сюда:
//+----------------------------------------------------------------------------+//| Автор : Ким Игорь В. aka KimIV, http://www.kimiv.ru |//+----------------------------------------------------------------------------+//| Версия : 07.10.2006 |//| Описание : Возвращает экстремум ЗигЗага по его номеру. |//+----------------------------------------------------------------------------+//| Параметры: |//| sy - наименование инструмента (NULL или "" - текущий символ) |//| tf - таймфрейм ( 0 - текущий ТФ) |//| ne - номер экстремума ( 0 - последний) |//| dp - ExtDepth |//| dv - ExtDeviation |//| bs - ExtBackstep |//+----------------------------------------------------------------------------+double GetExtremumZZPrice(string sy="", int tf=0, int ne=0, int dp=12, int dv=5, int bs=3) {
if (sy=="" || sy=="0") sy=Symbol();
double zz;
int i, k=iBars(sy, tf), ke=0;
for (i=1; i<k; i++) {
zz=iCustom(sy, tf, "ZigZag", dp, dv, bs, 0, i);
if (zz!=0) {
ke++;
if (ke>ne) return(zz);
}
}
Print("GetExtremumZZPrice(): Экстремум ЗигЗага номер ",ne," не найден");
return(0);
}
Yes, it was inside Start, now it's at the end. When compiling, you get an error: is not referenced and will be removed from exp-file
That's right - this error means that your fie is not being called for execution from your EA code and will be removed. Read the order of fie calls from my link in the previous post.
That's right - this error means that your fie is not being called for execution from your EA code and will be deleted, see the order of fie calls from my link in the previous post.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please advise if Alert works when testing EAs,
For some reason Comment works but Alert does not????
Please advise if Alert works when testing EAs,
For some reason Comment works but Alert does not????
It logs
Hello.
Can you tell me how I can paste the function attached here into the EA code to make it work?
I tried just to copy and paste it after Int Start(). I guess it's not that simple?
Hello.
Can you tell me how I can paste the function attached here into the EA code to make it work?
I tried just to copy and paste it after Int Start(). I guess it's not that simple?
1). I need to copy the function into the code.
2). And where you need to call the function, write, for example:
Hello.
Can you tell me how I can paste the function attached here into the EA code to make it work?
I tried just to copy and paste it after Int Start(). I guess it's not that simple?
It's hard to understand what you mean by inserting it after int Start(), aren't you inserting it inside Start?
Just paste it at the very end of your code
It's hard to understand what you mean by inserting it after int Start(), aren't you inserting it inside Start?
Insert it just at the end of your code
Yes, was inside Start, now put it at the end. When compiling an error: is not referenced and will be removed from exp-file
Hello.
Can you tell me how I can paste the function attached here into the EA code to make it work?
I tried just to copy and paste it after Int Start(). I guess it's not that simple?
Yes, it was inside Start, now it's at the end. When compiling, you get an error: is not referenced and will be removed from exp-file
That's right - this error means that your fie is not being called for execution from your EA code and will be removed. Read the order of fie calls from my link in the previous post.
That's right - this error means that your fie is not being called for execution from your EA code and will be deleted, see the order of fie calls from my link in the previous post.
That's it, it's working. Thank you very much.