Thread: Ask!
View Single Post
  #87 (permalink)  
Old 04-17-2006, 08:43 PM
Nicholishen's Avatar
Nicholishen Nicholishen is offline
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Quote:
Originally Posted by 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!
__________________
"Anyone who has never made a mistake has never tried anything new." -Albert Einstein
Reply With Quote