Firebird EA - page 58

 
 

Hi rbchapin,

May be you are right. But "crazy day" is not Friday only. It may be anyther day.

I looked inside the settings in set file and it is written the following settings:

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 is long; Direction==11 is no more long.

Direction==2 is short; Direction==22 is no more short.

 

And look at this code

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

Thus, it is very good that at least we know the day when EA will fly: it may be 5th of every month.

 

But may be you are right.

Because we can "translate" this code

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.
 

Hedging

Hi all,

I have a question about Firebird v3.2.

I have been watching how it works and I see that it hedges against a position it has taken if it goes the wrong way. But when the hedge closes with profit it leaves the other trades on the table.

Shouldn't it close all positions when one of its positions close?

What if the price doesn't come back to the open position for a very long time?

rbc

 
newdigital:
But may be you are right.

Because we can "translate" this code

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.

Hi newdigital,

actually it is a little worse since the EA continues to trade but it has a frozen LastPrice and Myorders both of which are used later to manage your risk. With them frozen the following will result. 1. No limit on the number of orders taken and 2. if the price drifts into the strike range it will keep on striking there because Lastprice will not be following the last order.

I checked and Lastprice is not updated as it trades so it must enter the loop under the if statement to be updated.

I think the If (Day()) statement should be removed and the whole Friday block logic should be placed where the time filter logic has been placed. (not sure if it has it but V3.2 does). If it doesn't seem profitable then you could raise the risk since money management would always be working.

rbc

 

Hi rbchapin,

Thanks a lot.

I wanted to stop testing this EA last year already but i am getting many PM messages and seems many people like those "crazy days". I think the members don't understand that it is impossible case for real account to open 100 orders just for 1 minutes ...

I will continue testing this EA and will updated files' thread https://www.mql5.com/en/forum/176044/page2 with "bug found message".

 

Firebird was flying once again yesterday.

Files:
firebird065.zip  546 kb