Элитные показатели :) - страница 199

 

Цифровые фильтры EA информация

Младен, MrTools,

Цифровые фильтры, показанные в #1987 - #1989, очень впечатляют.

Я хотел бы попробовать советник с их использованием - не могли бы вы объяснить, как настроить iCustom для извлечения значений?

Хорошим выбором могут быть цифровые фильтры на сглаженном графике - режим 1 (SATL) и режим 0 (FATL).

Логика советника может быть простой - покупать, когда FATL > SATL и наклон обоих положителен; наоборот, продавать; закрываться, когда наклон FATL = 0.

Есть какие-либо рекомендации по тому, как лучше всего рассчитать наклон?

Спасибо!

Рекс

 
mladen:
Рекс

Чтобы узнать наклоны в не сглаженной версии, можно использовать что-то вроде этого

int price = PRICE_CLOSE;

int filterType;

filterType = 0;

double fatlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double fatlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

filterType = 1;

double satlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double satlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

filterType = 2;

double rftlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double rftlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

filterType = 3;

double rstlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double rstlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

//

//

// slope of any of the values, fatl in this case

//

//

bool slopeUp = false;

bool slopeDown = false;

if (fatlCurrent>fatlPrevious) slopeUp = true;

if (fatlCurrent<fatlPrevious) slopeUp = true;

[/php]to find it out in the smoothed version use something like this (additional parameters needed in iCustom() call)

int length = 5;

int phase = 0

int price = PRICE_CLOSE;

int filterType;

filterType = 0;

double fatlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double fatlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

filterType = 1;

double satlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double satlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

filterType = 2;

double rftlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double rftlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

filterType = 3;

double rstlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double rstlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

//

//

// slope of any of the values, fatl in this case

//

//

bool slopeUp = false;

bool slopeDown = false;

if (fatlCurrent>fatlPrevious) slopeUp = true;

if (fatlCurrent<fatlPrevious) slopeUp = true;

[/php]Both examples are using current (open) bar value. To avoid it change the last parameter from 0 and 1 to 1 and 2. Also, included even unnecessary values calculations (as you can see all the digital filters types are calculated) in order to show how to retreive every value

To compare values of different filters simply compare (for example) if (fatlCurrent>rftlCurrent) or if (fatlCurrent<rftlCurrent) but that just shows their relative values. It does not show if they just crossed one above/bellow the other

______________________

To find crossings of a different filters, it gets a bit more complicated and the best way is to write a new indicator. It is more complicated because it depends how do you treat eventual equal values of two indicators. I prefer to treat them as a trend continuation and not as a possible trend reversal. Attaching an indicator that will show you "trends" (a simple "bigger"/ "smaller" relation) of 2 digital filters. To use it all you need is to check the value that is even not going to be displayed anywhere on chart, like this

[php] int price = PRICE_CLOSE;

int filterType1 = 0; // fatl

int filterType2 = 2; // rftl

int filtersTrendCurrent = iCustom(NULL,0,"Digital filters - on chart trend","",filterType1,FilterType2,price,5,0); // retrieve value from trend buffer

int filtersTrendPrevious = iCustom(NULL,0,"Digital filters - on chart trend","",filterType1,FilterType2,price,5,1); //

if (filterTrendCurrent!= filterTrendPrevious) // trend just changed

{

if (filtersTrendCurrent== 1) ....// trend changed to up

if (filtersTrendCurrent==-1) ....// trend changed to down

}

Also, the remark for a opened bar stands for this example too, so change the last parameter to desired value (1 for closed bar, for example) if you do not want to use opened bar signals. The target indicator is the histogram down on the picture (fatl / rftl crosses in this case on a 5 minute chart)
And in the end, you could do something like this :

[php] if (filterTrendCurrent!= filterTrendPrevious) // trend just changed

{

if ( fatlCurrent>fatlPrevious && rftlCurrent>rftlPrevious && filtersTrendCurrent== 1) Buy...

if ( fatlCurrent<fatlPrevious && eftlCurrent<rftlPrevious && filtersTrendCurrent==-1) Sell....

}

//

// the danger is that the slope and the crosses are not going to change in the same

// moment and buying or selling on every bar when slopes are equal would cause an

// EA to "overtrade"

//

Но, на мой взгляд, достаточно просто проверить крестики и использовать для фильтрации какой-то совершенно другой наклон (в данном примере использован быстрый цифровой фильтр, тогда в качестве фильтрации "наклона" можно использовать медленные цифровые фильтры (satl или rstl)).

______________________

PS: когда речь идет о советнике, вы даже можете рассмотреть возможность написания индикатора, который не отображает никаких значений (это сэкономит 2 буфера в этой histo версии в этом случае), но в этом случае вы должны быть на 101% уверены, что вы делаете с кодом (нет "визуального контроля").

с уважением,

Младен

Рекс,

Просто хочу сказать, что эти цифровые индикаторы от Младена очень хороший выбор для Ea, все уже заметили, насколько они легки на Cpu по сравнению с другими старыми версиями. Я сделал ряд Ea;s со старыми цифровыми версиями, особенно используя STLM наклон на нескольких таймфреймах, компьютер страдал, эти кажутся такими же хорошими или лучше, но намного легче.

С уважением,

инструменты

 

Младен, Mrtools,

Это именно то, на что я надеялся!

Это большая помощь.

Еще раз спасибо.

Рекс

 

Рекс

Для определения наклонов в не сглаженной версии можно использовать что-то вроде этого

int price = PRICE_CLOSE;

int filterType;

filterType = 0;

double fatlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double fatlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

filterType = 1;

double satlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double satlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

filterType = 2;

double rftlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double rftlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

filterType = 3;

double rstlCurrent = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,0);

double rstlPrevious = iCustom(NULL,0,"Digital filters - on chart","",filterType,price,0,1);

//

//

// slope of any of the values, fatl in this case

//

//

bool slopeUp = false;

bool slopeDown = false;

if (fatlCurrent>fatlPrevious) slopeUp = true;

if (fatlCurrent<fatlPrevious) slopeUp = true;

[/php]to find it out in the smoothed version use something like this (additional parameters needed in iCustom() call)

int length = 5;

int phase = 0

int price = PRICE_CLOSE;

int filterType;

filterType = 0;

double fatlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double fatlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

filterType = 1;

double satlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double satlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

filterType = 2;

double rftlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double rftlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

filterType = 3;

double rstlCurrent = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,0);

double rstlPrevious = iCustom(NULL,0,"Digital filters smoothed - on chart","",filterType,price,length,phase,0,1);

//

//

// slope of any of the values, fatl in this case

//

//

bool slopeUp = false;

bool slopeDown = false;

if (fatlCurrent>fatlPrevious) slopeUp = true;

if (fatlCurrent<fatlPrevious) slopeUp = true;

[/php]Both examples are using current (open) bar value. To avoid it change the last parameter from 0 and 1 to 1 and 2. Also, included even unnecessary values calculations (as you can see all the digital filters types are calculated) in order to show how to retreive every value

To compare values of different filters simply compare (for example) if (fatlCurrent>rftlCurrent) or if (fatlCurrent<rftlCurrent) but that just shows their relative values. It does not show if they just crossed one above/bellow the other

______________________

To find crossings of a different filters, it gets a bit more complicated and the best way is to write a new indicator. It is more complicated because it depends how do you treat eventual equal values of two indicators. I prefer to treat them as a trend continuation and not as a possible trend reversal. Attaching an indicator that will show you "trends" (a simple "bigger"/ "smaller" relation) of 2 digital filters. To use it all you need is to check the value that is even not going to be displayed anywhere on chart, like this

[php] int price = PRICE_CLOSE;

int filterType1 = 0; // fatl

int filterType2 = 2; // rftl

int filtersTrendCurrent = iCustom(NULL,0,"Digital filters - on chart trend","",filterType1,FilterType2,price,5,0); // retrieve value from trend buffer

int filtersTrendPrevious = iCustom(NULL,0,"Digital filters - on chart trend","",filterType1,FilterType2,price,5,1); //

if (filterTrendCurrent!= filterTrendPrevious) // trend just changed

{

if (filtersTrendCurrent== 1) ....// trend changed to up

if (filtersTrendCurrent==-1) ....// trend changed to down

}

Also, the remark for a opened bar stands for this example too, so change the last parameter to desired value (1 for closed bar, for example) if you do not want to use opened bar signals. The target indicator is the histogram down on the picture (fatl / rftl crosses in this case on a 5 minute chart)
And in the end, you could do something like this :

[php] if (filterTrendCurrent!= filterTrendPrevious) // trend just changed

{

if ( fatlCurrent>fatlPrevious && rftlCurrent>rftlPrevious && filtersTrendCurrent== 1) Buy...

if ( fatlCurrent<fatlPrevious && eftlCurrent<rftlPrevious && filtersTrendCurrent==-1) Sell....

}

//

// the danger is that the slope and the crosses are not going to change in the same

// moment and buying or selling on every bar when slopes are equal would cause an

// EA to "overtrade"

//

Но, на мой взгляд, достаточно просто проверить крестики и использовать для фильтрации какой-то совершенно другой наклон (в данном примере использован быстрый цифровой фильтр, тогда в качестве фильтрации "наклона" можно использовать медленные цифровые фильтры (satl или rstl)).

______________________

PS: когда речь идет о советнике, вы даже можете рассмотреть возможность написания индикатора, который не отображает никаких значений (это сэкономит 2 буфера в этой histo версии в этом случае), но в этом случае вы должны быть уверены на 101%, что вы делаете с кодом (нет "визуального контроля").

______________________

PPS: правильный индикатор "цифровые фильтры - на трендах графика" можно найти в этом посте https://www.mql5.com/en/forum/general

с уважением

Младен

rdoane:
Младен, MrTools,

Цифровые фильтры, показанные в #1987 - #1989, очень впечатляют.

Я хотел бы попробовать создать советника, использующего их - не могли бы вы объяснить, как настроить iCustom для извлечения значений?

Хорошим выбором могут быть цифровые фильтры на сглаженном графике - режим 1 (SATL) и режим 0 (FATL).

Логика советника может быть простой - покупать, когда FATL > SATL и наклон обоих положителен; наоборот, продавать; закрываться, когда наклон FATL = 0.

Есть ли какие-либо рекомендации по тому, как лучше всего рассчитать наклон?

Спасибо!

Рекс
Файлы:
 

В статье "Цифровые фильтры - на графике трендов", первоначально размещенной на этом сайте: https: //www.mql5.com/en/forum/general, была допущена одна ошибка. Эта ошибка исправлена, поэтому, пожалуйста, используйте ее.

с уважением

Младен

 

Младен,

Можете ли вы добавить в этот индикатор неперерисовывающуюся раскраску и опцию mtf? Спасибо.

Файлы:
rsi_ma.mq4  4 kb
 

Pc-breakout

Младен,

Я использую советник на виртуальном частном сервере. У меня иногда появляется сообщение "PC-Breakout", когда я навожу мышь на номер билета.

Что это значит? Это потеря связи или может быть перезагрузка сервера?

спасибо

с уважением,

 
casaliss:
Привет Младен

Пожалуйста, добавьте стрелки пересечения нулевой линии на текущий график.

Спасибо

Привет Младен

Пост 1997

Спасибо

 

Tradefx1

Я предполагаю, что это комментарий, который ваш советник помещает к ордеру (попробуйте также проверить "комментарии", когда вы щелкаете правой кнопкой мыши в списке ордеров, а затем посмотрите, соответствует ли комментарий всплывающему тексту, который вы получаете).

с уважением

Младен

Tradefx1:
Младен,

Я использую советник на виртуальном частном сервере. У меня иногда появляется сообщение "PC-Breakout", когда я навожу курсор на номер тикета.

Что это значит? Это потеря связи или может быть перезагрузка сервера?

спасибо

пожелания,
 

биддик

Вот, пожалуйста,
PS: упустил из виду часть "mtf". Прилагаю версию для mtf тоже

с уважением

Младен

biddick:
Mladen, Можете ли вы добавить в этот индикатор неперерисовывающуюся раскраску и опцию mtf? Спасибо.
Файлы: