to work with some conditions

 

hi guy

i am working with my EA on EUR/USD with timeframe 15min. i have only a question :

how can i use more conditions inside the same EA ??

i mean... if ( cond1 )

ordersend ( buy...)

if ( cond2)

ordersend(buy...)

clearly only one order at the same time for the same condition. have you some idea to solve this problem?? i use other EA for other pairs and i have not problems to work simultanealy but i use only one condition for EA.

help me :-)))))

 
giulioron:

hi guy

i am working with my EA on EUR/USD with timeframe 15min. i have only a question :

how can i use more conditions inside the same EA ??

i mean... if ( cond1 )

ordersend ( buy...)

if ( cond2)

ordersend(buy...)

clearly only one order at the same time for the same condition. have you some idea to solve this problem?? i use other EA for other pairs and i have not problems to work simultanealy but i use only one condition for EA.

help me :-)))))

if( (cond1) && (cond2) )

{

ordersend...

}

 
robofx.org:

if( (cond1) && (cond2) )

{

ordersend...

}

remember


&& = and

if( (cond1) && (cond2) )

where cond1 = true and cond2 = true


|| = or

if( (cond1) || (cond2) )

where cond1 = true or cond2 = true

 
jmhendrix1983 wrote >>

remember

&& = and

if( (cond1) && (cond2) )

where cond1 = true and cond2 = true

|| = or

if( (cond1) || (cond2) )

where cond1 = true or cond2 = true

no...it's not the solution because in this way i can send 2 orders of cond1. i mean maximun 2 orders ( one for conditions) but not 2 orders of the same condition

 

Before sending orders:

int x,y,i;

for(i=0;i<OrderTotal();i++)

{

OrderSelect(...);

if(OrderSymbol()==Symbol()&&OrderMagic()==magic1)x++;

if(OrderSymbol()==Symbol()&&OrderMagic()==magic2)y++;

}

then

if(cond1&&x==0)OrderSend(....,magic1,....);

if(cond2&&y==0)OrderSend(....,magic2,....);

 
ok thanks roger...... i try ....never used the command ordermagic anyway thanks :-)))
Reason: