buy(0.01,20,500,"buy",0);
sell(0.01,20,500,"sell",0);
return(0);
}
int BUY(int sun,int ying,string comment,int magic)
{
int com=0;
int ticket=0;
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)=true}
{
if(ordercomment() ==comment)
{
com=1;
}
}
}
//if(com=0)
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,30,Ask-sun*Point,Ask+ying*Point,comment,magic,0,Green)<0,Red);
}
return(0);
} 这里出错误了
int SELL(double,int sun,int ying,string comment,int magic)
{
int com=0;
int ticket=0;
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)=true}
{
if(ordercomment() ==comment)
{
com=1;
}
}
}
if(com=0)
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Ask,30,Bid+sun*Point,Bid-ying*Point,comment,magic,0,Green)<0,Red);
}
return(ticket);
}
|