# 请问这个EA出了什么问题-

9
2012.04.11 03:46

EA错误的意思似乎是少了”}”,但我在86行即if( com1==0)

{ ，加了”}”也没用，到底出了什么问题呢?

int timef=15;

int pinT=10;

int ticket;

int init()

{ return(0); }

int deinit()

{ return(0); }

int start()

{

double close0=iClose(Symbol(),timef,0);

double close1=iClose(Symbol(),timef,1);

double close2=iClose(Symbol(),timef,2);

double ma100=iMA(Symbol(), timef,pinT, 0, MODE_SMA, PRICE_CLOSE, 0};

double ma101=iMA(Symbol(), timef,pinT, 0, MODE_SMA, PRICE_CLOSE, 1);

double ma102=iMA(Symbol(), timef,pinT, 0, MODE_SMA, PRICE_CLOSE, 2);

//=========================== ====确认只有一单=====================

if ((ma100>ma101)&&(ma101>ma102))//10均向上

{ if (close0>close2)//k线向上

{ int com=0;

for (int i=0;i<OrdersTotal();i++)

{ com=1; }

}

}

if( com==0)

if (close0<close2)

{ OrderClose(OrderTicket(),1,Bid,3,White); }

}

//========================== ================================

if ((ma100<ma101)&&(ma101<ma102))//10均向下

{ if (close0<close2)//k线向下W

{ int com1=0;

for (int i1=0;i1<OrdersTotal();i1++)

{ if (OrderComment()=="sell")

{ com1=1; }

}

}

if( com1==0)

{ OrderSend(Symbol(),OP_SELL,0.1,Bid,30,0,0,"sell",111,0,Red); }

if (close0<close2)//平仓

if (OrderType()=OP_SELL)

{ if(OrderSelect(OrderTicket(),SELECT_BY_POS)==true)

}

return(0);

}

842
2012.04.14 11:37