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

 

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++)

{ if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

{ if (OrderComment()=="buy")

{ com=1; }

}

}

if( com==0)

{ OrderSend(Symbol(),OP_BUY,0.1,Ask,30,0,0,"buy",999,0,Green); }

if (close0<close2)

if (OrderType()=OP_BUY)

{ 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 (OrderSelect(i1,SELECT_BY_POS,MODE_TRADES)==true)

{ 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)

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

}

return(0);

}

 

楼主的这段代码不符合我的阅读习惯,修改起来比较麻烦,也不是什么复杂的问题希望是已经决定了。

祝你好运。