请大家给我看看,这个简单的系统不能编译是什么原因?

 

//+------------------------------------------------------------------+
//| ming.mq4 |
//| Copyright ?2009, Ming Software Corp. |
//| https://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2009, Ming Software Corp."
#property link "https://www.metaquotes.net/"

//---- input parameters
extern double lot;

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
double ma5,ma12;
int rs,x=0;
lot=NormalizeDouble(AccountFreeMargin()/20000.0,1);
if(lot<0.1)lot=0.1;
ma5=iMA(Symbol(),0,5,0,MODE_EMA,PRICE_CLOSE,0);
ma12=iMA(Symbol(),0,12,0,MODE_EMA,PRICE_CLOSE,0);
//----
if( ma5>ma12 )
{
x=1;
}
if(ma5<m12)
{
x=-1;
}

for(int i=0;i<OrdersTotal();i++)
{
rs=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if (OrderSymbol()==Symbol()
{
if( x=1)
{
if (OrderType()==OP_SELL)
OrderClose(i,OrderLots(),Ask,3,White);
}
if (x=-1)
{
if(OrderType()=OP_BUY)
OrderClose(i,OrderLots(),Bid,3,White);
}
}
}
if (OrdersTotal()<1)
{
if(x=1)OrderSend(Symbol(),OP_BUY,lot,Ask,3,Ask-20*Point,0,"",16384,0,Red);
if(x=-1)OrderSend(Symbol(),OP_SELL,lot,Bid,3,Bid+20*Point,0,"",16383,0,Green);
}
//

//----
return(0);
}
//+------------------------------------------------------------------+

 

错误比较多。都是小问题。

if(ma5<m12) m12在哪里?


if( x=1) 应该是==,还有几个地方是这种情况。