Need help with coding

 

Hi,

 

I want to add a condition in my EA...it look for the trend and then it trades in this direction until the trend has changed...but sometimes it trades too much and the last trades (closer to the end of the trend) are always losers...

I would like the EA to only trade 3 times per trend...can anyone help me to write this condition?

Tks e best tradings. 

 
fcg237:

Hi,

 

I want to add a condition in my EA...it look for the trend and then it trades in this direction until the trend has changed...but sometimes it trades too much and the last trades (closer to the end of the trend) are always losers...

I would like the EA to only trade 3 times per trend...can anyone help me to write this condition?

Tks e best tradings. 

you can use 'if'

initialize counter=0;

if(counter<mycountparameter)

{

   //your code here

   counter=counter+1;

}

Reason: