hihi.... finally i made the ea. - page 2

 
extern bool    OnlyOneDirection  = true;


if(OnlyOneDirection==true) && (how should i code into here ??....
 
Kane59:

You can introduce this:

Hope it will help you.


@@。。。

it doesnt open any trade even i use 1 pip as size wanted. 

 

i simplified it like this...

no error on coding,

but why didnt open any trades ?? 

//---------------------------------------------------   
   extern double  MinimumSize          = 50;
//---------------------------------------------------
   double PriceClose= iClose(Symbol(),Period(),0);
   double PriceOpen= iOpen(Symbol(),Period(),0);

   double BullCandleSize = PriceClose - PriceOpen;
   double BearCandleSize = PriceOpen - PriceClose;
//---------------------------------------------------
// detect candle size
   if (BullCandleSize < MinimumSize)
   {
   return(0);
   }
   
   if (BearCandleSize < MinimumSize)
   {
   return(0);
   }
//---------------------------------------------------
// following with open trade condition ......
 
albert_lim83:

i simplified it like this...

no error on coding,

but why didnt open any trades ?? 

Before asking why don't you make some effort to find out for yourself ?  add some print statements do you can see the values held by your variables,  or simply take the values from any 2 adjacent bars off any chart and calculate the values that your code calculates . . .  then you should understand what is going on.

Coding is about problem solving,  if you have zero aptitude for that you shouldn't bother trying to code . . .   or if you just can't be bothered trying to solve your coding issues then give up already. 

 
RaptorUK:

Before asking why don't you make some effort to find out for yourself ?  add some print statements do you can see the values held by your variables,  or simply take the values from any 2 adjacent bars off any chart and calculate the values that your code calculates . . .  then you should understand what is going on.

Coding is about problem solving,  if you have zero aptitude for that you shouldn't bother trying to code . . .   or if you just can't be bothered trying to solve your coding issues then give up already. 


yea... i should add print statement to see what's wrong with that.

thanks. RaptorUK