Firebird EA - pagina 58

 
 

Ciao rbchapin,

Forse hai ragione. Ma il "giorno pazzo" non è solo il venerdì. Può essere qualsiasi altro giorno.

Ho guardato all'interno delle impostazioni nel file set e ci sono scritte le seguenti impostazioni:

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;

}

Direction==1 è lungo; Direction==11 non è più lungo.

Direction==2 è corto; Direction==22 non è più corto.

 

E guardate questo codice

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) )
 

Così, è molto buono che almeno sappiamo il giorno in cui EA volerà: può essere il 5 di ogni mese.

 

Ma forse hai ragione.

Perché possiamo "tradurre" questo codice

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.
 

Copertura

Ciao a tutti,

Ho una domanda su Firebird v3.2.

Ho osservato come funziona e vedo che si copre contro una posizione che ha preso se va nella direzione sbagliata. Ma quando la copertura si chiude con profitto, lascia le altre operazioni sul tavolo.

Non dovrebbe chiudere tutte le posizioni quando una delle sue posizioni si chiude?

E se il prezzo non torna alla posizione aperta per molto tempo?

rbc

 
newdigital:
Ma forse hai ragione.

Perché possiamo "tradurre" questo codice

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.

Ciao newdigital,

in realtà è un po' peggio, poiché l'EA continua a scambiare ma ha un LastPrice e un Myorders congelati, entrambi utilizzati in seguito per gestire il rischio. Con essi congelati il risultato sarà il seguente. 1. 1. Nessun limite al numero di ordini presi e 2. se il prezzo va alla deriva nel range di strike, continuerà a colpire lì perché Lastprice non seguirà l'ultimo ordine.

Ho controllato e Lastprice non viene aggiornato durante gli scambi, quindi deve entrare nel ciclo sotto l'istruzione if per essere aggiornato.

Penso che l'istruzione If (Day()) dovrebbe essere rimossa e l'intera logica del blocco Friday dovrebbe essere collocata dove è stata collocata la logica del filtro temporale. (non sono sicuro che ce l'abbia, ma la V3.2 sì). Se non sembra redditizio, allora si potrebbe aumentare il rischio poiché il money management sarebbe sempre in funzione.

rbc

 

Ciao rbchapin,

Grazie mille.

Volevo smettere di testare questo EA già l'anno scorso, ma sto ricevendo molti messaggi PM e sembra che a molte persone piacciano quei "giorni folli". Penso che i membri non capiscano che è un caso impossibile per un conto reale aprire 100 ordini solo per 1 minuto ...

Continuerò a testare questo EA e aggiornerò il thread dei file https://www.mql5.com/en/forum/176044/page2 con il messaggio "bug trovato".

 

Firebird volava ancora una volta ieri.

File:
firebird065.zip  546 kb
 
Motivazione: