1141

Code is as below: When Signal is 1, and Orders numbers traded by this EA is 0, then send OP_BUY order; this is very simple logic.

now I have attached this EA to demo account and living account, what is surprising is that:

at the same time, this EA only trades one order on demo account and trades many orders on living account, what is the matter?

some people tell me that this is because my living account is related to another account; when my account trade an order, in the fact, my account does nothing, but the related account trades really; does it?

thanks!

int start()

{

int Signal=..........

Orders_CNT=Orders_Number(); // get the orders number which traded by this EA

if( Orders_CNT == 0 )

{

if( Signal == 1 )

{

iWait();

........

if(Order_Ticket < 0) Print("OrderSend() failed: ",ErrorDescription(GetLastError()));

}}}
int Orders_Number()
{
ArrayInitialize(Tickets,0);
int x=0;
for(int i_1=0;i_1<OrdersTotal();i_1++)
if(OrderSelect(i_1,SELECT_BY_POS))
if( OrderSymbol()=="USDJPY" &&
(OrderMagicNumber()==Magic_Number_N ||
OrderMagicNumber()==Magic_Number_A ||
OrderMagicNumber()==Magic_Number_R
)
)
{ Tickets[x]=OrderTicket();x++; }
return(x);
}

5390

What problems are you having? What are you Expecting to Happen? What is it doing instead?

5390

vx0532:

Code is as below: When Signal is 1, and Orders numbers traded by this EA is 0, then send OP_BUY order; this is very simple logic.

now I have attached this EA to demo account and living account, what is surprising is that:

at the same time, this EA only trades one order on demo account and trades many orders on living account, what is the matter?

some people tell me that this is because my living account is related to another account; when my account trade an order, in the fact, my account does nothing, but the related account trades really; does it?

thanks!

Yet when you check the total number of open order you do.

if( OrderSymbol()=="USDJPY" &&
(OrderMagicNumber()==Magic_Number_N || ........ why _N?
OrderMagicNumber()==Magic_Number_A || ........ why _A?
OrderMagicNumber()==Magic_Number_R ....... why _R?

Why aren't you checking for plain old Magic_Number?

1141

ubzen:

Yet when you check the total number of open order you do.

if( OrderSymbol()=="USDJPY" &&
(OrderMagicNumber()==Magic_Number_N || ........ why _N?
OrderMagicNumber()==Magic_Number_A || ........ why _A? Others trades
OrderMagicNumber()==Magic_Number_R ....... why _R? Others trades

Why aren't you checking for plain old Magic_Number? I just want to count how many orders traded by this EA