ผิดที่เครื่องหมาย }
extern double Lot=0.1;
int start()
{ double up=iCustom(NULL,0,"Forex Freedom Bars",0,0);
double down=iCustom(NULL,0,"Forex Freedom Bars",1,0);
if(OrdersTotal()==0)
{
if(up>0)
{OrderSend(Symbol(),OP_BUY,Lot,Ask,3,0,0,"EX3",0,0,Green);
}
if(down>0)
{OrderSend(Symbol(),OP_SELL,Lot,Bid,3,0,0,"EX3",0,0,Red);
}
}
if(OrdersTotal()==1)
{
if(up>0)
{
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_SELL)
{
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),3,Pink);
}
}
if(down>0)
{
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY)
{
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),3,Pink);
}
}
}
return(0);
}