Ask! - page 9

 

Ask????

Hi All,

EA is opening 2 positions

at the same time, same pairs.

Could u please check this.

Thanks, Bongo

int cnt = 0;

string OrderValueSymbol(int index)

{

OrderSelect(index, SELECT_BY_POS);

return(OrderSymbol());

}

int start()

{

if( Bars < 20 ) return(0);

for(cnt=1;cnt<=OrdersTotal();cnt++) {

if( OrderValueSymbol(cnt) == Symbol() )

{

Order = 1;

break;

}

else

{

Order = 0;

}

}

if( OrdersTotal() == 0 ) Order = 0;

if( OrdersTotal() < 5 && Order == 0 )

etc....

 

Hi Dave,

Getting an error message when I try to compile, obviously I am missing something. Message below

'indicator_color2' - defined value expected E:\Program Files\MetaTrader 4\experts\indicators\Heiken Ashi.mq4 (18, 1)

Gordon

 
gordon:
Hi Dave,

Getting an error message when I try to compile, obviously I am missing something. Message below

'indicator_color2' - defined value expected E:\Program Files\MetaTrader 4\experts\indicators\Heiken Ashi.mq4 (18, 1)

Gordon

Hi Gordon, please post your modified code, I will take a look at it. Also let me know, what color you like for WHITE and RED ? Hope this help

 
Bongo:
Hi All,

EA is opening 2 positions

at the same time, same pairs.

Could u please check this.

Thanks, Bongo

int cnt = 0;

string OrderValueSymbol(int index)

{

OrderSelect(index, SELECT_BY_POS);

return(OrderSymbol());

}

int start()

{

if( Bars < 20 ) return(0);

for(cnt=1;cnt<=OrdersTotal();cnt++) {

if( OrderValueSymbol(cnt) == Symbol() )

{

Order = 1;

break;

}

else

{

Order = 0;

}

}

if( OrdersTotal() == 0 ) Order = 0;

if( OrdersTotal() < 5 && Order == 0 )

etc....

IMHO the multiple entry could happen if you test it on multiple pairs. How many pairs did you run the EA on the same time ?

 
 
Bongo:
Hi All,

EA is opening 2 positions

at the same time, same pairs.

Could u please check this.

Thanks, Bongo

int cnt = 0;

string OrderValueSymbol(int index)

{

OrderSelect(index, SELECT_BY_POS);

return(OrderSymbol());

}

int start()

{

if( Bars < 20 ) return(0);

for(cnt=1;cnt<=OrdersTotal();cnt++) {

if( OrderValueSymbol(cnt) == Symbol() )

{

Order = 1;

break;

}

else

{

Order = 0;

}

}

if( OrdersTotal() == 0 ) Order = 0;

if( OrdersTotal() < 5 && Order == 0 )

etc....

Bongo. The first position in the trade pool is 0 instead of 1. The for loop should look like this : for(int i=0;i<Orderstotal();i++){

Also, are you using custom functions?

Cheers!

 
 

hi gang,

i thought this will be the right place to ask this. how can i refresh the charts from code? or how can i refresh indicators from their code? i ask this because some indicators plot ...and then when i click on refresh..change their values a bit. thanks for the help.

regards

 

Hi to all. Im new here, VERY NICE FORUM!!!!

I have a doubt, i want to color my bars acording to this criteria:

I have this Inverse fisher transform of RSI indicator witch i want to use to color the bars blue when its increasing, and red when its decreasing...

Ill try to attach the indicator i case of someone could help me..

Thanks, LC.

 

Thank you for your help Firedave.

Gordon

Reason: