¿Cómo codificar? - página 193

 

Necesito ayuda para una alerta

Hola,

primero: lo siento por mi Inglés. iam realy mal en Inglés.

pero mi pregunta es: ¿como puedo programar una señal de alerta si el tenkan y el senkou se cruzan?

¡alguien puede ayudarme, por favor!

muchas gracias,

bye benjamin

Archivos adjuntos:
ichimoku.mq4  5 kb
 

Pequeño problema..

¿Puede alguien ayudarme a hacer la función para actuar en barbecho-

Tengo: A=0

Cuando el indicador llega a cierto punto nr1: A=1.

Y cuando el indicador deja este punto: A=1 (A sigue manteniendo su valor).

Cuando el indicador llega a cierto punto nr2: A=0.

Cualquier idea será bienvenida.

Gracias.

 
ohir:
Alguien puede ayudarme a hacer una función que actúe de forma descendente.

Tengo: A=0

Cuando el indicador llega a cierto punto nr1: A=1.

Y cuando el indicador dejó este punto determinado: A=1 (A sigue manteniendo su valor).

Cuando el indicador llega a cierto punto nr2: A=0.

¡Cualquier idea es bienvenida!

Gracias.

Es difícil saber exactamente lo que quieres con tan poco.

¿Qué tal si

A=0;

si (Oferta >= nr1 && Oferta < nr2) A=1;

si (Puja >= nr2) A=0;

Sustituye Bid por O,H,L,C o cualquier otra variable que quieras.

Pero también hay que pensar en lo que sucede si el precio llega a nr1 y luego cae en lugar de ir a nr2.

Sólo recuerda que sólo estoy adivinando lo que quieres.

Espero que haya sido de ayuda

 

¿Cómo puedo acceder a un archivo en mi disco duro que no está en la carpeta /expertos/archivos?

por cierto, ¿es posible ejecutar comandos de windows (por ejemplo, copiar) en mql4? tal vez con un archivo dll?

Gracias de antemano :-)

 

Re swgman1

¡Gracias, swgman1!

... pero sigue siendo un problema para mí.

Lo que estoy tratando de decir-

Inicio

El valor del Indicador1 es 0

El valor del Indicador2 es 0

A=0

Paso1

El valor del indicador1 es 1

El valor del indicador 2 es 0

A=1

Paso 2

El valor del indicador1 es 0

El valor del indicador 2 es 0

A=1

Paso 3

El valor del indicador1 es 0

El valor del indicador 2 es 1

A=0

Espero que esté más claro

Gracias.

 

Bucle raro..

He hecho un bucle raro en mi programa de prueba:

int A=1

for(A=0, A=1; A==(condición de compra); A++)

Comprar if(A=1)

Cerrar if(Bid>0)

Se negocia después de que la contición desaparece... PERO, no cierra las operaciones justo después de la apertura (como debería- Bid>0). Ahora mi programa cierra todas las operaciones sólo si aparece la condición de compra.

¿Qué hace este bucle en realidad?

 
ohir:
Hice algún bucle raro en mi programa de prueba:

int A=1

for(A=0, A=1; A==(condición de compra); A++)

Comprar if(A=1)

Cierra si(Oferta>0)

Opera después de que desaparezca la contición... PERO, no cierra las operaciones justo después de la apertura (como debería- Bid>0). Ahora mi programa cierra todas las operaciones sólo si la condición de compra aparece.

¿Qué hace realmente este bucle?

Hola ohir,

Nunca he mirado realmente en la escritura de EA, sólo he hecho indicadores, así que no soy la mejor persona para preguntar.

Sin embargo, con un bucle for se establece el punto de partida (número de barra), a continuación, su condición para mantener el bucle en funcionamiento, a continuación, aumentar su punto de partida para el siguiente bucle.

for (x=barras-1;x>0;x--) este bucle recorrerá todas las barras del gráfico desde la primera hasta la última.

for (x=0;x<barras-1;x++) hace un bucle a la inversa

x es sólo el contador del bucle

el tuyo comienza en la barra 0 o 1 (no estoy seguro de cómo funciona con la coma allí) entonces mientras tu contador es igual a la condición de compra (imposible, creo) continúa el bucle, entonces incrementa el contador.

Intenta algo como

for (x=0;x<=barras-1;x++)

{

if (A[x]==1) OrderSend(blah,blah,blah)

if (Oferta[x]>0) OrderClose(blah,.....)

}

No sé si algo de esto ayuda pero es lo mejor que puedo hacer. Quizás alguien con más conocimientos pueda ayudar más.

Buena suerte

Swagman

 

Ayuda por favor

Ok lo tengo --descartar este post

Archivos adjuntos:
trenddetect.mq4  14 kb
 

Metatrader y números negativos

Alguien sabe una mejor manera de codificar esto???? No puedo conseguir que metatrader lea los números exactos, algunos son positivos y otros son números negativos.

if (Use_Entry_Delay == true) {

//if (trendis == 0 | trendis == -0) {

//EntryAllowed= True;

//Imprimir ("Entrada permitida");

//}

if (trendis == 0.0010){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0011){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0012){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0013){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0014){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0015){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0016){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0017){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0018){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0019){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0020){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0021){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0022){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0023){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0024){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0025){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0026){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0010){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0011){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0012){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0013){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0014){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0015){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0016){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0017){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0018){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0019){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0020){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0021){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0022){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0023){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0024){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0025){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0026){ EntryAllowed= true; Print ("Entry Allowed"); }

}else{

EntryAllowed= false;

Imprimir ("Entrada no permitida");

}

}

-----------------------------------------

así que básicamente si es -0.0010 o inferior no lo hagas

si está por encima de 0,0026 o por encima de -0,0026 no lo haga.

Intentado muchas cosas no puedo conseguir que lo haga.

Cualquier ayuda por favor, por favor, por favor.

 
niteuser:
¿Alguien sabe una mejor manera de código de este???? No puedo conseguir que metatrader lea los números exactos, algunos son positivos y otros son números negativos.

if (Use_Entry_Delay == true) {

//if (trendis == 0 | trendis == -0) {

//EntryAllowed= True;

//Imprimir ("Entrada permitida");

//}

if (trendis == 0.0010){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0011){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0012){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0013){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0014){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0015){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0016){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0017){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0018){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0019){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0020){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0021){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0022){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0023){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0024){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0025){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == 0.0026){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0010){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0011){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0012){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0013){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0014){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0015){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0016){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0017){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0018){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0019){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0020){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0021){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0022){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0023){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0024){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0025){ EntryAllowed= true; Print ("Entry Allowed"); }

if (trendis == -0.0026){ EntryAllowed= true; Print ("Entry Allowed"); }

}else{

EntryAllowed= false;

Imprimir ("Entrada no permitida");

}

}

-----------------------------------------

así que básicamente si es -0.0010 o inferior no lo hagas

si está por encima de 0,0026 o por encima de -0,0026 no lo haga.

Intentado muchas cosas no puedo conseguir que lo haga.

Cualquier ayuda, por favor, por favor.
if ((trendis = 0.0026)) { EntryAllowed= true; Print ("Entry Allowed"); }
Razón de la queja: