Indicadores de élite :) - página 199

 

Filtros digitales EA info

Mladen, MrTools,

Los Filtros Digitales mostrados en #1987 a #1989 son muy impresionantes.

Me gustaría probar un EA utilizando estos - ¿puede explicar cómo configurar iCustom para extraer los valores?

Una buena opción podrían ser los Filtros Digitales en Gráfico Suavizado - Modo 1 (SATL) y Modo 0 (FATL).

La lógica del EA podría ser simple - Comprar cuando FATL > SATL y la pendiente de ambos es positiva; lo contrario para vender; cerrar cuando la pendiente de FATL = 0.

¿Alguna recomendación sobre la mejor manera de calcular la pendiente aquí?

Gracias.

Rex

 
mladen:
Rex

Para averiguar las pendientes en la versión no suavizada se puede utilizar algo como esto

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"

//

Pero en mi opinión es suficiente con comprobar los cruces y utilizar alguna otra pendiente para filtrar (en este ejemplo se utilizan filtros digitales rápidos, luego se podrían utilizar filtros digitales lentos (satl o rstl) como filtros de "pendiente")

______________________

PS: cuando se trata de EA, incluso podría considerar la escritura de un indicador que no muestra ningún valor (se ahorraría 2 búferes en esta versión histo en ese caso), pero en ese caso usted tiene que ser 101% seguro de lo que está haciendo con el código (no "control visual")

saludos

Mladen

Rex,

Sólo quiero decir que estos indicadores digitales por Mladen muy buena elección para Ea todos han notado lo ligero en Cpu son en comparación con las otras versiones antiguas. He hecho un número de Ea;s con las versiones digitales de edad, especialmente el uso de la pendiente STLM en múltiples marcos de tiempo el hombre el equipo estaba sufriendo, estos parecen tan bueno o mejor, pero mucho más ligero.

Saludos

herramientas

 

Mladen, Mrtools,

¡Eso es exactamente lo que esperaba!

Esto es una gran ayuda.

Gracias de nuevo.

Rex

 

Rex

Para averiguar las pendientes en la versión no suavizada se puede utilizar algo como esto

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"

//

Pero en mi opinión es suficiente con comprobar los cruces y utilizar alguna pendiente completamente diferente para el filtrado (en este ejemplo se utilizan filtros digitales rápidos, luego se podrían utilizar filtros digitales lentos (satl o rstl) como filtros de "pendiente")

______________________

PS: cuando se trata de EA, incluso se podría considerar la posibilidad de escribir un indicador que no muestra ningún valor (se ahorraría 2 búferes en esta versión histo en ese caso), pero en ese caso usted tiene que ser 101% seguro de lo que está haciendo con el código (sin "control visual")

______________________

PPS: el indicador correcto de "filtros digitales - on chart trends" se encuentra en este post https://www.mql5.com/en/forum/general

saludos

Mladen

rdoane:
Mladen, MrTools,

Los filtros digitales mostrados en #1987 a #1989 son muy impresionantes.

Me gustaría probar un EA utilizando estos - ¿puede explicar cómo configurar iCustom para extraer los valores?

Una buena opción podrían ser los Filtros Digitales en Gráfico Suavizado - Modo 1 (SATL) y Modo 0 (FATL).

La lógica del EA podría ser simple - Comprar cuando FATL > SATL y la pendiente de ambos es positiva; lo contrario para vender; cerrar cuando la pendiente de FATL = 0.

¿Alguna recomendación sobre la mejor manera de calcular la pendiente aquí?

Gracias.

Rex
Archivos adjuntos:
 

En los "filtros digitales - sobre las tendencias de los gráficos" publicados originalmente en este post : https://www.mql5.com/en/forum/general había un error. Este es el corregido, así que por favor use este

saludos

Mladen

Archivos adjuntos:
 

Mladen,

¿Puedes añadir la opción de no repintar y mtf a este indicador? Gracias.

Archivos adjuntos:
rsi_ma.mq4  4 kb
 

Pc-breakout

Mladen,

Estoy usando un EA en un servidor privado virtual. A veces tengo el mensaje "PC-Breakout", cuando pongo el ratón en el número de ticket.

¿Qué significa esto? ¿Es una pérdida de conexión o puede ser un reinicio del servidor?

Gracias

Saludos,

 
casaliss:
Hola mladen

Por favor, añada las flechas de cruce de la línea cero en el gráfico actual.

Gracias

Hola Mladen

Puesto 1997

Gracias

 

Tradefx1

Mi opinión es que es el comentario que su EA está colocando en la orden (trate de comprobar "comentarios" también cuando haga clic derecho en la lista de órdenes y luego ver si el comentario se corresponde con el texto emergente que está recibiendo)

saludos

Mladen

Tradefx1:
Mladen,

Estoy utilizando un EA en un servidor privado virtual. A veces tengo el mensaje "PC-Breakout", cuando pongo el ratón sobre el número de la entrada.

¿Qué significa esto? ¿Es una pérdida de conexión o puede ser un reinicio del servidor?

Gracias

saludos,
 

biddick

Aquí tienes
PD: se me pasó por alto la parte "mtf". Adjunto una versión mtf también

saludos

Mladen

biddick:
Mladen, ¿Puedes añadir la opción de no repintar y mtf a este indicador?
Archivos adjuntos: