下载MetaTrader 5

EA如何一次下5个订单?

要添加评论,请登录注册
hls2020
11
hls2020 2016.01.08 10:35 

本人刚开始学EA,遇到点问题,请教下高手, 我想当满足一定条件时,EA一次下5个订单,我自己写的代码如下:

我这个代码写的EA有时只下1-2个单,请问要如何修改呢? 

int openbuy()

  {

  int odb01,odb02,odb03,odb04,odb05;

  if(OrdersTotal()==0)

    {

          odb01=OrderSend(Symbol(),OP_BUY,lot,Ask,huadian,Ask-sl01*Point,Ask+tp01*Point,"",0,0,0);

          odb02=OrderSend(Symbol(),OP_BUY,lot,Ask,huadian,Ask-sl02*Point,Ask+tp02*Point,"",0,0,0);

          odb03=OrderSend(Symbol(),OP_BUY,lot,Ask,huadian,Ask-sl03*Point,Ask+tp03*Point,"",0,0,0);

          odb04=OrderSend(Symbol(),OP_BUY,lot,Ask,huadian,Ask-sl04*Point,Ask+tp04*Point,"",0,0,0);

          odb05=OrderSend(Symbol(),OP_BUY,lot,Ask,huadian,Ask-sl05*Point,Ask+tp05*Point,"",0,0,0);

          //return;

    }

  return(0); 

  } 

reetin 李婷
9
reetin 李婷 2016.01.09 05:10  

for(x=5,x<1,x--)

{odb[x]=OrderSend(Symbol(),OP_BUY,lot,Ask,huadian,Ask-sl01*Point,Ask+tp01*Point,"",0,0,0);

hls2020
11
hls2020 2016.01.09 08:34  
reetin 李婷:

for(x=5,x<1,x--)

{odb[x]=OrderSend(Symbol(),OP_BUY,lot,Ask,huadian,Ask-sl01*Point,Ask+tp01*Point,"",0,0,0);

 

谢谢!  我想设置每个订单的止损和止盈不一样, 如何写呢?

万分感谢! 

要添加评论,请登录注册