Firebird EA - página 58

 
 

Hola rbchapin,

Puede que tengas razón. Pero el "día loco" no es sólo el viernes. Puede ser cualquier otro día.

He mirado dentro de la configuración en el archivo de configuración y se escribe la siguiente configuración:

extern int MAtype=0;//0=close, 1=HL

extern int TradeOnFriday =0; // >0 trades on friday[/CODE]

But inside the code I found the following:

if(MAtype==0)

{

double myMA =iMA(NULL,MA_timeframe,MA_length,0,MODE_SMA,PRICE_OPEN,0);[/CODE]

So, according to my limited programming knowledge, if MAtype=0 so EA is using MA indicator on open price for current open bar.

And some other codes:

[CODE]KeepStopLoss=OrderStopLoss();

And more:

[CODE]if(KeepStopLoss!=0)

{

spread=MathAbs(KeepAverage-KeepStopLoss)/2;

dummy=(Bid+Ask)/2;

if (KeepStopLoss(dummy-spread))

{

// a stoploss was hit

if(Direction==1) Direction=11;// no more longs

if(Direction==2) Direction=22;// no more shorts

}

KeepStopLoss=0;

}

Dirección==1 es larga; Dirección==11 no es más larga.

Dirección==2 es corta; Dirección==22 no es más corta.

 

Y mira este código

if((myMA*(1+Percent/100))<Bid && Direction!=22 && (Bid>=(LastPrice+(CurrentPipStep*Point)) || myTotal==0) )[/CODE]

So, it is not surprise when EA is openning too many orders sometimes. It is open price and when market is moving very quickly so we may have condition for open the order 100 times on open bar.

May be it should be && instead of or (||) here?

[CODE]....|| myTotal==0) )
 

Así, es muy bueno que al menos sepamos el día en que EA volará: puede ser el 5 de cada mes.

 

Pero puede que tengas razón.

Porque podemos "traducir" este código

if (Day()!=5 || TradeOnFriday >0)[/CODE]

as the following:

"if it is not 5th of the month, or if we are trading on Friday."

And int Day( ) is the following:

Returns the current day of the month, i.e., the day of month of the last known server time.

So, EA will trade is it is not 5th of the month (5th of October for example) or TradeOnFriday>0 (we are having TradeOnFriday=0).

I think it should be DayOfWeek( ) instead of Day( ):

[CODE]int DayOfWeek( )

Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.
 

Cobertura

Hola a todos,

Tengo una pregunta sobre Firebird v3.2.

He estado viendo cómo funciona y veo que se cubre contra una posición que ha tomado si va mal. Pero cuando la cobertura se cierra con beneficio deja las otras operaciones sobre la mesa.

¿No debería cerrar todas las posiciones cuando una de ellas se cierra?

¿Y si el precio no vuelve a la posición abierta durante mucho tiempo?

rbc

 
newdigital:
Pero puede que tengas razón.

Porque podemos "traducir" este código

if (Day()!=5 || TradeOnFriday >0)[/CODE]

as the following:

"if it is not 5th of the month, or if we are trading on Friday."

And int Day( ) is the following:

Returns the current day of the month, i.e., the day of month of the last known server time.

So, EA will trade is it is not 5th of the month (5th of October for example) or TradeOnFriday>0 (we are having TradeOnFriday=0).

I think it should be DayOfWeek( ) instead of Day( ):

[CODE]int DayOfWeek( )

Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.

Hola newdigital,

en realidad es un poco peor ya que el EA sigue operando pero tiene congelados el LastPrice y el Myorders que se usan después para gestionar el riesgo. Con ellos congelados se produce lo siguiente. 1. 1. No hay límite en el número de órdenes tomadas y 2. si el precio se desplaza hacia el rango de strike seguirá golpeando allí porque Lastprice no estará siguiendo la última orden.

Lo he comprobado y Lastprice no se actualiza a medida que se negocia por lo que debe entrar en el bucle bajo la sentencia if para que se actualice.

Creo que la sentencia If (Day()) debería eliminarse y toda la lógica del bloque del viernes debería colocarse donde se ha colocado la lógica del filtro de tiempo. (no estoy seguro de que lo tenga pero la V3.2 lo tiene). Si no te parece rentable entonces podrías subir el riesgo ya que la gestión monetaria siempre estaría funcionando.

rbc

 

Hola rbchapin,

Muchas gracias.

Yo quería dejar de probar este EA el año pasado ya, pero estoy recibiendo muchos mensajes PM y parece que muchas personas como los "días locos". Creo que los miembros no entienden que es un caso imposible para la cuenta real para abrir 100 órdenes sólo para 1 minutos ...

Continuaré probando este EA y actualizaré el hilo de los archivos https://www.mql5.com/en/forum/176044/page2 con el mensaje de "error encontrado".

 

Firebird volvió a volar ayer.

Archivos adjuntos:
firebird065.zip  546 kb